Wednesday, October 8, 2014

OddballGreg - The Adventures Of A Programming Novice

The first header image to ever feature 2 images in one. WOW! Also, great drawing skills no? Teehee

Programming is not hard. In fact, programming is, for all intents and purposes, designed to be as easy as possible for the programmer. What is hard, however, is actually learning everything you need to know to do it. Let's talk about that.

A few blogposts back, I spoke about the fun I had learning HTML, CSS and Javascript online. This, interestingly enough, spurred an interest in expanding my knowledge of programming and scripting and led to what has been a very interesting week of learning since that post. (It has also been somewhat frustrating, but i'll get to that in a second.)

So what exactly have I been doing in all this time? EVERYTHING. In these past few days, I have tried my hand at PHP, VB, Java, C, C++, C# and Python. (I have in the past tried out Ruby On Rails and Lua of course.) What's interesting though, is that none of these languages can actually be called "the best" or "the worst", as they all have their pro's and con's to use in various situations and circumstances.

The most interesting thing to note is that these programming languages are, in most cases, designed to be fairly intuitive in their design. As I said in my Web Design post mentioned earlier, one of the most integral parts to understanding why you're supposed to do certain things in a programming language is understanding why it was designed that way. (For me at any rate, parrot (or "rote") learning has always had a cumulative success rate of "almost failure" for me, as shown by my 40% maths pass at the end of High School. Fun fact, I can do calculus and circle geometry perfectly, since those were the things that were properly explained in their use and design, unlike the 'here's the formula, do this" approach everything else was give.) But I digress, a lot of my time was taken up reading the thought process that went into the design of these programming languages.

Now, while I'm not going to spit out the definitions word for word, the programming languages I listed above are what they refer to as "High Level Languages", which were designed for the purpose of making it easier to create larger and more complex programs, while maintaining a relative degree of cross platform portability. The reason for this is that a computer cannot actually read these language by default. If you have any knowledge of programming, you probably understand that you need a "compiler" in order to make the code that you have written into something that the computer can run. The reason for this is that the compiler takes the code you've written and translates it into "machine language" which your CPU and can understand and perform.

Allow me to just reiterate what that implies: before there was C++ and Java and etc, people were writing programs directly in MACHINE LANGUAGE. Trust me, learning a high level language is far preferable to writing out "10110000 01100001" just to say that "A= 97"(Though there was also Assembly Language, but that had it's own caveats like only working for the CPU it was written for.)

That considered, it can still be a somewhat steep learning curve to climb before you're programming things yourself. The hardest part of learning is figuring out the syntax, which is fairly unique to each language. (Similar made languages like C, C++ and C# do not apply.) Take the following C++ code for example:


  // #include "stdafx.h"
  #include <iostream>

  int main()
  {
  using namespace std;
  int x;

  // print the value of x to the screen (dangerous, because x is uninitialized)
  cout << x << endl;
  }

"int main()" is the main function of the program being told to initialize. Inside the curly brackets, the code is effectively telling the computer its using "namespace" which allows it to use the "cout" and "endl" functions, which are effectively "Console out" and "end line" respectively. They are functions that affect what is going on in the console as you run the program. (If you don't know what a console is, you're likely out of your depth by this point and wondering why you're bothering reading this. I applaud you making it this far though.)

In any case, the ironic thing is that a common saying on the internet is to start programming with Python, as it is a far more literal language and uses terms like "Print" instead of "cout" and various things like that. Perhaps I'm weird, but I found C++ to make more sense than Python due to how C++ is written, and promptly decided that Python wasn't really worth the effort yet. Maybe later I'll try again, but I think i'll go with what makes sense to my brain for now.

Funnily enough, the most frustrating part of this entire ordeal was not, in fact, learning how to write in these convoluted languages, but actually just getting the necessary programs to efficiently write and compile them. In a conversation I had with my good friend @yestinj about Web Design, who comically pointed out that my first mistake was that I was writing javascript in the first place, it was suggested that I check out getting and IDE, or Integrated Development Environment.

What does an IDE do you ask? It basically makes your life as a programmer as easy as it can. IDE's come packaged with compilers for High Level Languages, plugins and addon's, and are designed to make the code easier to read and write so that you make less mistakes and as such write a better program. All in all, good programs to have... provided they work as intended. In these past few days, I have installed Netbeans, Intellij, Notepad++ and Microsoft Visual Studio in order to test out their uses as IDE's.

The verdict: if you don't need to program (hobby and professional interest does count as a need), and have a short temper, steer clear. Netbeans, which came lauded for being open-source and highly effective for what it does, was perhaps the buggiest thing I had ever tried to install. 10 Error logs generated just from me trying to install the program, a further 50 in my repeated attempts to get it working in any way once I finally got it installed.*facedesk* While probably a good program and my issues a isolated incident, I cannot actually tell you if it's worth using since my 3 hours of troubleshooting were rather ineffectual, and Netbeans remains useless on my harddrive.

By contrast, Intellij was the most miraculously functional IDE I tried to install, (if you consider that Notepad++ is not technically an IDE), taking all of 5 minutes to run and go. Plugins, options for use of many languages beside Java, and a clean and efficient design made me quite impressed with Intellij, definitely worth exploring if you are researching IDE's.

Notepad++ is not actually an IDE, though does have a fair couple features similar to them. Technically a writing program, Notepad++ is useful for it's numbered line editor and support for High Level Language syntax in which is highlights the aspects of and helps you to write in any chosen language. While perhaps not overly useful for writing code like C++, this is a Web Designers dream in my opinion. Just thought I'd mention it for that if nothing else.

Finally, we come to Visual Studio from Microsoft. Common opinion on Visual Studio is that it's not the best IDE you could use, mainly because it's buggy. In all honesty, I don't think anyone would fault you for avoiding it, if just to avoid downloading it at a snails pace. *facedesk* The original VS Express 2010 download is only 80mb... which proceeded to download at 0KB per second and only finished 24 hours later... Consider me irritated. Then, having done that, the very first program I try to compile, the longtime "Hello World" gag that almost ever programmer has done, fails to compile because of one of those aforementioned bugs. Cue a 400mb download of a service pack.... at 0kb per second. While homicide is by no means a funny subject, I think I was seriously considering it by that point. 3 days later, I was finally able to start using Visual Studio Express. It's not terrible, and is clearly designed to be simple to use, especially for a native Windows user. Too bad it's such a pain to get to that point.

All in all, it has been a rather fascinating experience in these past few days with regards to expanding my knowledge about how computers function, and look forward to researching and learning more about it all as time moves forward.

Of course, I'm sure I've probably done or said something stupid in this post or my efforts, and as such, fully expect to be told such. If you're someone who wishes to do so, or simply have some questions about anything I spoke about in this article, then please feel free to tell us down in the comments below, or via Facebook/Twitter as we here at TCSA love you hear from you. And if you happen to have any friends who are interested in computers or learning programming, consider sharing this post with them. I'm sure they'll appreciate the thought. Better yet, if you yourself would like to read more interesting articles like this one, consider liking the Official TCSA Facebook page and/or following us on Twitter in order to get all the latest posts, as they're published. Regardless of what you do, I thank you for having taken the time to read this article; hope that you have/had and absolutely FANTASTIC day, and I will speak again soon.

Happy programming my friends.
Related Posts Plugin for WordPress, Blogger...