DEV Community

Cover image for Programming is easy, ain't it?
Eden Jose
Eden Jose

Posted on • Updated on

Programming is easy, ain't it?

My glimpse on how I approach the idea of programming.
I've also included the core concepts that one must know when you're starting to dive into coding.

To start with, I want to say that you made the right choice opening this post. You might be someone who's been dabbling with code since you were little or you could be someone who wandered around some interesting links in Google and you find yourself craving for more nuggets about programming.

Either way, you still have that one thought, or rather a question, in your mind:

Is programming really easy?

Well, let's clearly answer that question once and for all.

Programming is relatively easy.
Say it with me.

Yes. For the most part, it's actually just putting up keywords into perfect one-liners and then moving on to the next line, pretty much like when you're trying to form a sentence. But is it really just that?

Going back to example, when you form a sentence in the English language, there are a certain set of rules of vocabulary that you'll have to follow such as what tenses to use, from whose point of view is the statement, and what punctuation marks should you use in closing the sentence.

Similarly, that's pretty much how programming works.
But of course, there are other core concepts you need to learn when it comes to creating your own code.

What's the word

When you are first learning a new language, such as Nihonggo (japanese) let's say, you have this initial expression when you first come across a Kanji writing:

jackie-chan-meme.jpg

Looks complicated, must be complicated.
But it's not really not that difficult once you take the first steps of learning the basics of it. Everything will always be confusing and frustrating when you're doing something new for the first time but once you've broken down the individual sections of how that language works, it'll be easy peasy.

What comes before
Regardless of what language you're trying to learn, they're almost always the same when it comes to their conception. Programming languages are created to solve problems or inefficiencies of the languages before them.

With that being said, these new languages are most likely developed based on the languages that preceeded them. This means that it could follow some techniques, and they could borrow these sets of rules from their predecessor languages.

So I guess you could say all languages operate in the same way.

In its core

As I've mentioned, all programming languages operates in the same way, which means that they share the same core concepts. They are just written in a different way.

  • Syntax
    Recall that every language have its own rules. These rules maybe based on other early languages but we can say that any language will always have it's innate set of vocabulary.

    syntax.JPG

    When you've actually first read the title of this post, you had this tingling sense that there's something wrong with how the title was structured. If you did, then you actually understand what syntax is.
    Now, programming is indeed easy, isn't it? 😄

  • Variables
    The main idea of variables is associating a certain value to a container word. These variables essentially stores the data and can be manipulated, passed, and used within your program.

    variables.JPG

  • Printing
    This is basically the action where all the results of the operations you've done in your code are outputted in your screen, similar to when you hear programmers say that "the code returned this value". What this essentially means is that the code fetch the result from the memory and delivers onto the browser's or editor's output.

    syntax.JPG

    Recall the concept of backend programming - the calculations are being done behind the curtains. Now, for the users to see what are the result of those calculations, users can use a command that prints the output. Note that programs don't automatically print the output, you'll have to tell it. You actually had a glimpse of how values are printed in the sample picture for variables above.

  • Comments
    The purpose of putting comments in code is to explain to anyone who's going through the code what the code is intended for, what's the purpose of a variable or a block, etc. Note that comments doesn't follow any verbal rules nor syntax restriction as these are not being processed by the code. They are only there for documentation purposes.

    syntax.JPG

    The way you "comment out" is to prefix the line with a particular symbol. For example, in python you use # to label a line as a comment and it is automatically greyed out - this tells the computer to skip this line when processing the entire code.

  • Strings
    Recall that when the computer sees the # at the start of line in a python code, it automatically knows not to process that line since it's a comment. This prevents the text from being confused as a code. Another way to tell the computer that a line is not a code but rather a sentence that you want to be printed out is by associating the line or the word to a variable, normally what's called a string.

    strings.JPG

    When you assign a line of text in a string, you will normally enclose it with quotation marks. You can also insert the value of another variable within the string by using escape commands or formatting.

  • Array
    An array is basically a group of pieces of information which could be formatted the same. When a variable contains more than one value, then it is considered an array. Array can be comprised of numbers or integers, text, strings, or variables.

    list.JPG

    Another thing that you need to remember that arrays are also stored in the computer or server's memory. When you tell the computer to get an array, it'll go into its memory, grab all the values associated with the array, and returns them. If you don't want all the values but instead the first one in the array, you can indicate the position and this basically acts as a pointer to the specific section of the memory where that value is stored.

Wait, there's more

Now we can honestly say that you have a good grasp of how easy programming really is. Too many people focus on what programming language to learn first, which is fine, but in reality, what we ought to learn first is the core concepts that's common in all of them.

If you'd like to learn more on what are some pre-requisites that you can explore, you can check out Evan Kimbrell's course in Udemy, Pre-Programming: Everything you need to know before you code

You could always go straight to the language of your choice, but I suggest you check the course out, especially if you're someone that's non-technical and you've grown an interest in programming.

As always, happy learning!

And oh, if ever you're someone who's as curious in learning new things in tech, I'll be glad to connect with you in Twitter!


jeden image

Top comments (3)

Collapse
 
memattchung profile image
memattchung

I do like the spirit of this post: it encourages those to get into programming. I would say, however, the deeper you dive into the programming stack, the more difficult it becomes. Just piggybacking on your array example. Say you end up transitioning from writing a higher level language like Python to a lower level programming language like C. You'll discover that an array is actually just a pointer, a memory address. And why arrays are awesome for their constant time access!

In any case, thanks for sharing and encouraging other folks to get into programming. It can be a very rewarding journey.

Cheers,
@memattchung

Collapse
 
jeden profile image
Eden Jose

Thanks for the feedback @memattchung .
Yes, that is my intention when I was formulating this post. I myself is still in the early part of improving my programming skills, and I thought it'll be cool to document everything as I progress. :)

Collapse
 
memattchung profile image
memattchung

Great idea on documenting your progress. I suspect you'll look back, now too long from now, and be blown away by your progress. It's always great to take stock of everything you've learned and accomplished over the years. Good luck on the journey!

Cheers,
@memattchung