Sunday, May 1, 2016

Modular Programming or Just the Way You Think?

Most people interested in any scientific discipline are visual learners and INTJ ( stands for Introverted, iNtuition, Thinking, Judging ) personality types.  It is hard to accept new concepts like design before code or test when you are done, but when they realize that every decision they ever made was following a rigid flowchart and they enjoy the pre-designed flow in decision making, the program design concepts become one of the most liked tools.

Modular coding is the same concept as we divide and conquer complex situations.  Each main concept is implemented as a module where the modules are simple, focused, and improved individually as needed.  The modules can be applied to different situations for a quicker solution even if minor adjustments need to be made.

Let's see how to us this concept in getting through college.  Is it helpful?  Do you see the value of it? Did you just realize that you were confused in science classes because no one taught you this way of thinking?  You're welcome :-)



Programmer Training vs. Education

No matter how you think about programming desired outcomes, there is a huge difference between those learned programming from watching YouTube videos and those learned the basics in a classroom.  I would say, there is also a huge difference between those learned programming in a face-to-face classroom vs. on-line classroom. 

There is no substitute of human interaction, real time Q&A, and working with others who are struggling with the same concepts. 

There is a difference between how corporations view education and the level of details they need from programmers.  The basic concept in education is not to cater to current needs of the corporate environment, but to provide and complete skill set for the educated workforce to encourage innovation and adaptability to the ever changing corporate landscape. 

Training on the other hand, provides the most current technical aspects of the latest technology, but it is useless unless there is a strong foundation behind a person.  Thus, a strong educational baseline and continuing training can provide a lifetime learner who has the latest skills, able to innovate, and feels resilient even in challenging environments.

Here is a video of different requirements by the different environments for the same problem.

https://www.youtube.com/watch?v=CqLhME92guI

As far as education is concerned, it is the institution's responsibility to provide the "worst case scenario" where programming is the structured process of development by well defined stages.

Understand the problem - Interview, understand the business needs
Analyze the gathered data - Select relevant nouns and verbs related to the problem that will eventually form variables, constants, functions, and methods
Design the best fit solution - Plan the algorithm based on learned data structures and tested solutions by drawing UML for objects and pseudo code or flow charts for each method or function including all validation plans
Code the approved design - Select the language best fit the problem at hand, space requirements, hardware availability, data size, and speed requirements.  Focus on structured code structure
Compile the code - Only solve small sections of the code at a time in a modular or object oriented fashion using 3rd party libraries that are well tested and written by well respected vendors
Link the objects into an executable - Link the code to the hardware that will be used to run the final product
Load the executable - See if it runs and see if the operating system logs any messages.  Test what access privileges the application needs in order to execute properly
Test the final product - Establish proper test values ( preferably automated script ) and test all possible flowchart identified paths with values testing inside and outside ranges, end-values, and most importantly all possible wrong values to test validation rules

Are these all used in a corporate environment? Of course not, but even an architect needs to learn how to write and read a blue print.  It is the proper way of doing it, but in a corporate environment this type of programming process is too expensive and time consuming to be used all the time.  Education does not look at profit margins and deadline requirements; just proper development of reliable code.

Let see an example design and implemented code:


So, what kind of feedback you will get if you code like this?  Most likely not very positive responses from other coders, but praises from those who will actually be responsible hiring you.  So, do not give in to peer pressure, it is in your best interest to learn the hard way and adopt to the situations as needed.