This blog post has the intent to try to make programming a easy task for "non-programmers". This post is for programming in general and is not any programming language specific.
All programming language can be simplified into 3 basic operations or ingredients. These are the building blocks for all programming languages be it the simple "Hello World" or as complicated as artificial intelligent software.
The 3 basic building blocks are:
- Assignment
- "If-then-else" / conditional statemen
- Iterations
Assignment
Most computer program has to deal with data manipulation. Often time a block of memory is reserved called a variable. This variable should be named and also with a meaningful name to remind even the author of the program as to what the variable is for. Some programmers are lazy and name their variables x, y and/or foo instead of meaningful name such as return_code, username ... etc. (As a side point, when developing a a software program, all the logics seem so obvious but then 3 months down the road in the middle of the night, we might be scratching our head asking, why did I write this logic).Anyways, getting back to the topic, assignment is when we assign a value to a variable. Depending on the programming language, some variable are very strict in the type of the variable. If a variable is reserved/declared as integer, we can only assign a number value to this variable. There are other programming language such as Python that the type is not checked by the interrupter/compiler. Type checking is another big topic that we can look into and in this post we will just concentrate on the 3 building blocks of computer programming.
Example of variable assignment in go:
var string1 string
string1 = "Hello World!"
fmt.Printf("I just wrote my first program: "%s", string1)
Depending on the context, the variable "string1" may not be a good name to use as it did not reveal how this variable is being used.
If-then-else or conditional statement
This is called the conditional statement and different programming language has different syntax to express the conditional statement but the concept is the same. Depending of the condition (or the value of certain variables) the program will execute different sets of logic.The format is:
if condition A {
do something
} else {
do some other thing
}
The "else" part is where condition A is not true. Or we can be checking the condition in anther way:
if condition A is not true "
do something
} else {
do some other thing
}
For example:
if _, err := checkMonthIndexSize(i); err != nil { |
fmt.Printf("\n%s\n", err) |
} else { |
fmt.Printf("\nSlice is initialized correctly (len = %d)\n", i) |
The above logic is written in go and it is only for demonstrating purpose. This is a more complex construct of the if-then-else logic where we we execute a function and depending on the return value or error condition of the function to decide if we should print out an error message or a informational message.
The if statement is checking for the return value of the function checkMonthIndexSize(). I have not include the function as I am only trying to illustrate the "if-then-else". The function checkMonthIndexSize() returns a value where we choose to ignore and the build in error checking feature of the go language.
In fact this is taken from the demo program that I have written for one of the episodes in "30-days-in-committmas 2015". If you are interested you can find the podcast here in YouTube
Iterations
Programming usually involve in doing the same operation multiple times or depending on the value of a variable.Most programming languages have the "for-loop" and the "while-loop".
Example of a for-loop:
for i := 6; i < 12; i++ { |
fmt.Printf(" [%d] := %s\r\n", i, string1[i]) |
Usually a "for-loop" will do 3 things:
Assign a value to a variable and this case i := 6
check certain condition and in this case if ( value of the valuable is less than 12)
increment the value of i by one and in this case i++ or it can also be i = i + 1)
Example of a while-loop
while ( condition is true) {
print a "dot" on the screen
}
This is good for user interface. Let say we are doing a file transfer using ftp and we can see the progress by seeing dots being printed to the screen and we know the file transfer is still happening. (Over simplified example for file transfer logic for illustration only).
So we can see this value assignment and condition checking is being used in the for-loop or while-loop.
Happy programming
Of course there are more to programming but this post is trying to help you get over the barrier and start programming. You can see there 3 basic elements in very complex programs.Of course there are data structure and object oriented approach plus other features to programming for the complex programs but we can use these 3 basic building blocks to start. We got to start somewhere.
So: Happy Programming.
Superb i really enjoyed very much with this article here. Really its a amazing article i had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent
ReplyDeletearticle.thank you for sharing such a great blog with us. expecting for your updation.
Digital Marketing Company in Chennai
Great Article. Thank you for sharing! Really an awesome post for every one.
DeleteA Cloud Enabled Small Cell Architecture in 5G Networks for Broadcast/Multicast Services Project For CSE
A Hybrid Computing Solution and Resource Scheduling Strategy for Edge Computing in Smart Manufacturing Project For CSE
A Low Power Cardiovascular Healthcare System with Cross layer Optimization from Sensing Patch to Cloud Platform Project For CSE
A Time driven Data Placement Strategy for a Sci entific Workflow Combining Edge Computing and Cloud Computing Project For CSE
U2 Tree A Universal Two Layer Distributed Indexing Scheme for Cloud Storage System Project For CSE
An Edge to Cloud Virtualized Multimedia Service Platform for 5G Networks Project For CSE
I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
ReplyDeleteManpower Consultancy in Chennai
Are you looking for free Google+ Circles?
ReplyDeleteDid you know you can get them AUTOMATICALLY & ABSOLUTELY FOR FREE by registering on Like 4 Like?
Good blog, thanks for sharing this useful information.
ReplyDeleteClick More Details Visit Our Website
Texus
Texus Systems
Excellent blog
ReplyDeletepython interview questions
git interview questions
django interview questions
sap grc interview questions and answers
advanced excel training in bangalore
zend framework interview questions
apache kafka interview questions
Nice blog
ReplyDeleteuipath training in bangalore
angular4 interview questions
python interview questions
artificial intelligence interview questions
python online training
artificial intelligence online training
talend training
docker training
I got nice blog
ReplyDeletesap partner companies in bangalore
sap implementation companies in bangalore
sap partners in india
aws staffing
jquery interview questions
sql interview questions
nice blog
ReplyDeletemyTectra Profile | Trainingindustry.com
myTectra | Instagram
myTectra | Youtube
Thank you for sharing this type of interview questions
ReplyDeleteIot Online Training
Itil Interview Questions
Salesforce Interview Questions
Msbi Interview questions
Salesforce Interview Questions
C Interview Questions
nice blog
ReplyDeleteandroid training in bangalore
ios training in bangalore
machine learning online training
useful blog
ReplyDeletepython interview questions
cognos interview questions
perl interview questions
vlsi interview questions
web api interview questions
msbi interview questions
laravel interview questions
ReplyDeleteaem interview questions
salesforce interview questions
oops abab interview questions
itil interview questions
informatica interview questions
extjs interview questions
sap bi interview questions
ReplyDeletehive interview questions
seo interview questions
as400 interview questions
wordpress interview questions
accounting interview questions
basic accounting and financial interview questions
Thank you for sharing this informative article. I hope this will help the App Developers in Kenya to make programming simple.
ReplyDeleteInformative Blog. Thank you for sharing
ReplyDeleteaws training in chennai
This is just the kind of information that I had been looking for a long time. Thank you very much for posting this blog its very nice.Please contact us for Oracle Fusion Cloud Financials Training details in our Erptree Training Institute
ReplyDelete
ReplyDeleteYour good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
python Training in Bangalore | python Training in Bangalore
A bewildering web journal I visit this blog, it's unfathomably heavenly. Oddly, in this present blog's substance made purpose of actuality and reasonable. The substance of data is informative
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
A bewildering web journal I visit this blog, it's unfathomably heavenly. Oddly, in this present blog's substance made purpose of actuality and reasonable. The substance of data is informative
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
A befuddling web diary I visit this blog, it's incredibly grand. Strangely, in this present blog's substance made motivation behind fact and sensible. The substance of information is instructive
ReplyDeleteOracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
Thank you for sharing your thoughts and knowledge on this topic. This is really helpful and informative, as this gave me more insight to create more ideas and solutions for my plan. I would love to see more updates from you.
ReplyDeleteWordpress Health Checkup
Here is the information regarding best training center for DevOps
ReplyDeletedevops practitioner course in USA
nagios certification course in NewYork
devops practitioner training in NewYork
nagios certification course in NewYork
Thanks for sharing
ReplyDeleteWe are the best piping design course in Hyderabad, India. Sanjary academy Offers Piping Design Course and Best Piping Design Training Institute in Hyderabad. Piping Design Institute in India Piping Design Engineering.
Piping Design Course
Piping Design Course in india
Piping Design Course in hyderabad
Nice Post
ReplyDeleteSanjary kids is the best playschool, preschool in Hyderabad, India. Start your play school,preschool in Hyderabad with sanjary kids. Sanjary kids provides programs like Play group,Nursery,Junior KG,Serior KG,and Teacher Training Program.
play school in hyderabad
Preschool in hyderabad
Preschool teacher training course in hyderabad
pre and primary teacher training course in hyderabad
Do you understand there's a 12 word phrase you can say to your partner... that will induce deep emotions of love and impulsive appeal to you buried inside his heart?
ReplyDeleteThat's because deep inside these 12 words is a "secret signal" that triggers a man's instinct to love, adore and care for you with his entire heart...
12 Words That Trigger A Man's Love Instinct
This instinct is so hardwired into a man's brain that it will make him try harder than ever before to take care of you.
As a matter of fact, triggering this dominant instinct is so mandatory to getting the best ever relationship with your man that the instance you send your man a "Secret Signal"...
...You'll immediately find him expose his heart and mind for you in a way he's never expressed before and he will identify you as the one and only woman in the galaxy who has ever truly appealed to him.
1movies
ReplyDeleteI have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this Salesforce Training who are providing certification and job assistance. Salesforce CRM certification in Gurgaon
ReplyDeleteTank cleaning company in Hail
ReplyDeleteMosques cleaning company
Company cleaning boards in Hail
A sofa cleaning company in Hail
A carpet cleaning company in Hail
Hail Cleaning Company
Cleaning company in Hail
I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this Salesforce Training who are providing certification and job assistance. Salesforce training Gurgaon
ReplyDeleteWhat a fantastic post! This is so chock full of useful information I can't wait to dig deep and start utilizing the resources you have given me. your exuberance is refreshing
ReplyDeleteyou've outdone yourself this time
This is probably the best, most concise step-by-step guide I've ever seen on how to build a successful blog. i am also writing blog about the kindly review it french language institute in delhi .
Useful posts, I really appreciate your writing skills and your hard work. You are providing such deep information, that's why I would love to see more blogs about this subject. I am inspired by you and I am also writing about the Canada work visa . Please review it.
ReplyDeleteI really like the blog and I hope people will have a new blog, thanks for the blog
ReplyDeletewordpress
blogspot
youtube
កាស៊ីណូអនឡាញ
I like viewing this web page which comprehend the price of delivering the excellent useful resource free of charge and truly adored reading your posting. Thank you!
ReplyDeleteData Science Certification Course
I would like to say that this blog really convinced me to do it and thanks for informative post and bookmarked to check out new things of your post…
ReplyDeleteData Science Institute in Noida
Just a shine from you here and have never expected anything less from you and have not disappointed me at all which i guess you will continue the quality work. Great post.
ReplyDeleteData Science Training in Gurgaon
I just got to this amazing site not long ago was actually captured with the piece of resources you have got here and big thumbs up for making such wonderful blog page!
ReplyDeleteData Scientist Course
The blog and data is excellent and informative as well your work is very good and I appreciate well hopping for some more informative posts.
ReplyDeleteBusiness Analytics Course in Gurgaon
Having read your article. I appreciate you are taking the time and the effort for putting this useful information together.
ReplyDelete