Programming tutorials for beginners PART 1: programming without writing code

in #programming8 years ago (edited)

A common misconception about programming is that programming is all about writing extremely complicated code. While that does happen of course, the truth is that good programmers are only writing code less than 40% of all the time they spend working on a project. And it gets even more interesting now. Writing code is in fact nothing more than translating. The "real" programming is done before writing the code.

It's just like when you want to start a business. Do you just start the business without a business plan and hope for the best? A lot of people do, and that's no different in programming. A lot of people just start writing code and most of the time it gets so messy they get stuck, frustrated and discouraged and more often than not leads to failure to complete the project.

In this first introduction to programming i will teach you how think like a programmer, without learning the actual syntax of a specific programming language. Programming looks extremely complicated to beginners, but in reality programming is nothing more than automating certain actions. The secret to programming is to keep it simple and efficient. Let's start with an example to give you an idea of what a programmer does before writing code:
 

Example

Assignment: Write software that shows the age of your colleague's "William" and "Jeff" on the screen. William is 28 and Jeff is 52.

Solution: Some of you might think, that's really easy, just write "William is 28" and "Jeff is 52" and you're done. While that is technically correct, that's not how programmers think. What good programmers do is make the software dynamic so it's compatible with any other situation. Right now this piece of software only works in this specific situation. So we need to make it dynamic, for example by making an extremely simple database (textfile). Below is a simple implementation of the database and the software:

[Contents of textfile]

William 01-01-1988
Jeff 01-01-1964

[Code to execute]

For every line in the textfile do:

  1. Calculate the age of the colleague and save it in the memory of the PC
  2. Write the name + age of the colleague to the screen
  3. Delete the age of the current colleague from the memory of the PC

This specific implementation of the software works for every workplace in the world as long as the database is kept up to date and this implementation doesn't become outdated when one of your colleague's had his or her birthday.
 

Closing remarks

I hope you learned something from this programming introduction or maybe even became interested in becoming a programmer :)

See you in the next lesson!

Sort:  

Thank you for the introduction lesson.... always want to learn the basic :)

"Hello, World!"

I guess i'm the first beginner tutorial that doesn't teach people to write "Hello, World!"? :)

I was only remembering my first time. ;)

Loved the read. Thank you.

No problem, and you thanks for the $0.01, i bet i can feed a whole country now :)