Programming, is it hard? [Ramadan Journey of Arzee, Day 2/30]

in #programming8 years ago (edited)

Programming? Isn't it for Nerds?

Nope. Not at all actually. It is one of the easiest thing to learn. It doesn't take long if you have zero skill in programming or any computer related service/work. Here are the requirements for starting programming:

  • Logic and institution
  • Basic English
  • A PC
  • An Integrated Development Environment or IDE

Basically I assume you all know about the first 3 item. The last one is basically a medium where you can write your code, and compile them. Notepad is one IDE but rarely used, instead people use Notepad ++ because of features like syntax highlighting , language detector, etc.

I'm gonna show you the most basic and the must-have of all programmer, the basic program. What's the basic program?
It's the Hello World! I'm gonna show you a quick example in C++

If you run those weird words, you will get a result of

In the first image, there are two squares; the blue and red one.

The Blue Square

is something you want to make your program easier. For example in a calculator, if you want to multiply, you just press the X button. The calculator will do the multiplication later. Same as the blue square. It helps you do some function or procedure easier.

The Red Square

is different. It's the body of the programming. In my example, it starts with

int main()

which is the one thing you want to have IF you want your program to be able to run. Then it continues with a curly bracket. Everything inside the { } is part of that function. In my case, the function "main" which has been initialized by "int", has line of code consisting:

cout << "Hello World!" << endl;
return 0;

The function main in my case, calls cout. Cout itself is to print something to the screen. In my case, it will print "Hello World!" to the screen. Then the line ends with an "endl;" which means that after writing "Hello World!", the pointer that you can sometimes see blinking on the screen like when you type, goes into a new line below the writing. I'll show you what this means in the next example later. Return 0 means that the function isn't returning anything. In this case, since I only want to print "Hello World!", then I return nothing from the function.
Every line in coding must end with ";" to show you that the code ends there for that line (except some programming languages. They don't need ";" at all)

Another example I can show is:

which will give us

It's almost the same, except that I added a variable named apple in the 4th line of the code. After I initialized variable apple, I put a value in it, which is an integer of 5. After that I printed the same thing plus I printed the apple too. Now you see the effect of endl, after the program printed Hello World!, the pointer enters new line and goes back left.

I think it's enough for now. Sorry if I published this journey late, I've been busy today. If you guys have anything to ask, please don't hesitate to ask. See you guys on the next journey!

Keep Steeming!
~Arzee

Sort:  

Im thinking about learning python..steem on!

A great language, you can do almost anything with with it haha

While it's true that the most important thing in programming is a sense of logic thinking, you do really need to be motivated and willing to invest time.

I think you did a good job on writing this post in a way that everyone can understand it, but I think you should have picked another language than c++ to illustrate the simplicity of programming, hehe. c++ is a rather syntax heavy language, which might scare off non-programmers at first sight.

Yep, I remember the first time I had to code, it was horrible. After some time I realized it's just some if some condition then this else that, and so on.
Yea I agree, at first I wanted to use Pascal since it's very simple, but I think I am going to make kind of a tutorial with it in another post or something :D