Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

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.

Thursday, October 2, 2014

OddballGreg - Web Design (HTML, CSS, Javascript, More)

The best header images are the ones where you can't see anything useful... right? My apologies for getting in the way. Teehee. Screenshot is from the third tutorial project at https://dash.generalassemb.ly

HTML. Even the acronym sounds intimidating. Too bad most of the internet runs on it, so it's probably a good idea to realize that it's not actually that hard. If someone bothers to explain it properly. It also happens to be really awesome.

Yesterday, I started doing a set of tutorials for HTML, CSS and Javascript made by a website called Dash, as was suggested to me by someone because of my interests in web design. The good news was, I already had a somewhat rudimentary understanding of HTML thanks to tinkering with the blog you're reading right now. The bad news was that tinkering and doing aren't the same thing, and a day later and 2 cups of coffee later, (that's a lot considering I don't drink coffee ever really), I had experienced several interesting things in the process of doing these tutorials at https://dash.generalassemb.ly.

Firstly, when someone. (or something in this case), actually explains something to you properly, it is VERY easy to learn new skills. Although I had learnt a fair chunk of HTML skills through trial and error, I've gotta say, these tutorials would have saved me days of arduous effort if I'd found them first. (*facedesk*) The GeneralAssembly tutorials go to great lengths to explain not only how to do certain things, but why you need to do them, why they work the way they do and why they were designed to work that way. Quite frankly, if you don't come out of these tutorials feeling like an HTML expert, then you should get some sleep and try again tomorrow, since it's hard to learn when you're that exhausted.

As I soon learnt though, HTML is actually an immensely intuitive language once you understand how it works. HTML, or HyperText Markup Language, is effectively a list of tag's that tell your computer what it needs to display. CSS, or Cascading Style Sheets, are what tells you computer how to display those HTML tags by assigning attributes to the tags. (That's the layman's version at any rate.) Once you understand that, the hardest part of HTML is learning what you actually want to do to get the desired effect. Thankfully again, the earlier linked tutorials slowly introduces you to effectively everything you would need to know in order to do everything from making fancy blogs to designing robots purely from HTML. (Not as difficult as you would expect.)

Robots are fun. They're also fun to give flashing red eyes. Dash teaches you how to do that too if you're interested.
What gets interesting later about the Dash tutorials is that it eventually starts introducing you to Javascript in order to do everything from creating interactive page elements to showing alerts about various things, as well as all manner of other interesting things. The first thing I realized when doing these Javascript tutorials is that programming is far more fun than I expected. The second thing that I realized is that programming is far more irritating than I expected, and I suddenly understood why all my programmer friends always sounded so suicidal. (Sadly not a joke. If you are feeling suicidal by the way, please contact a suicide hotline. Suicide is not the answer my friend, no matter how appealing it might sound.)

Macabre subjects aside, part of this whole endeavor was to have some interesting new experience to blog about, so I hope you appreciate the amount of work I put into this one considering I've effectively been researching this subject since yesterday afternoon. (Though it was somewhat to my benefit, so don't sweat it too much.) The subject got fairly interesting when my javascript fun took me to Twitter where I began speaking to good, and rather experienced, friend, @yestinj who has been using Javascript for over 7 years now. Apart from humorously pointing out that my first mistake was actually deciding to learn Javascript, he went on to say how it is actually his favorite language, and that having an IDE (Integrated Development Environment) is invaluable for someone attempting to write code, most likely in the hopes of preserving both time and sanity. 

While likely sage advice, I fear I was unable to actually test them out for myself due to the unfortunate fact that of the 3 suggested programs, the highly acclaimed NetBeans became the most unstable program I've ever even tried installing in years. a cumulative 10 crash report dumps from 3 reinstalls, and another 50 in total from plain attempts to get the program to run. (Irony is a program lauded for it's open source compatibility and ease of use, being a bitch to even install... let alone run.)
I'm sure I'll get it functioning eventually if I can figure out what's causing it to behave in such an ornery fashion. The other suggested programs were IntelliJ from http://www.jetbrains.com/idea/ and Eclipse from https://www.eclipse.org/, though both are actually more focused on pure Java code, rather than Javascript for the internet. (A blog topic for the future I think.)

In any case, I look forward to tinkering further with Javascript and HTML in general, and perhaps even some more advanced programming languages down the line. But first, I need to go sleep off 10 straight hours of coding and 2 cups of caffeine that I never intended on drinking. If you have some specific questions about HTML, or simply have some interesting tutorial or programming language to suggest I check out, perhaps for future blog post, then do be sure to say so down in the comments below, or via Facebook/Twitter. We here at TCSA love to hear your feedback. Of course, if you have you have any web design enthusiast friends, consider sharing this article with them. I'm sure they, like us here at TCSA, will appreciate it immensely. Better yet, if you yourself would like to read more interesting articles such as this, then please do be sure to like the official TCSA Facebook page and/or follow us via Twitter using the associated buttons on the bar the left so that you can 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 post; hope that you have/had an absolutely FANTASTIC day, and I will speak again soon.

Happy coding my friends.


Related Posts Plugin for WordPress, Blogger...