Wednesday, 30 October 2013

Post 2: Coming to terms with the reality of being a programmer

Or beating through CH3 of the rango app

I've often read a lot of articles on the web that state how 'easy' or 'simple' it is to become a programmer nowadays. As I've progressed rather slowly through the Django tutorials, I've come to realize that being a programmer is not as simple as one might think.

In order to expand, I recently discovered a large gap between what the online coding schools are teaching and what you are required to do in real-world programming scenarios.

In doing a coding class of some sort, you will be taught how to utilize variables like:

var x = 1;
if (x != 1){
do this...
}

So far, I have not ever seen that situation play out in my 3 chapters of reading/coding. It may be a bit premature for me to assume that I won't face a situation like this in the near future, but based on how things are going, I expect that dealing with a variable equal to an integer will be a small part of a much larger project that one needs to grasp.

What I have come to learn is that a lot of aspects are not shown in beginner coding lessons, that would otherwise be necessary in an everyday situation.

In CH3 of the tango with django project, the main point of the chapter is to teach one how to map a URL to a view. In other words, you need to create a link between the actual page-link in the browser and what will be rendered (which is what the view does). This seems simple enough from a birds-eye view, but to technically code this isn't that easy (as per my own experience). It gets even more complex when you attempt to do it in a generic way (meaning that you try to do it without hard-coding each URL - which you need to know if you plan on having a site that generates tons of content and thousands of pages are created on the fly).

Apart from doing that, I have also needed to monitor and maintain my Git activity, ensuring that I'm adding files and also doing checks to make sure modified content is being included too.

The 3 important commands I have used are:
git add .  (Exactly as you see it - It adds all new and modified stuff to the index)
git status (a very important command to use when dealing with git)
git commit / git commit -m (The '/' is separating 2 different versions of the command. The difference between the 2 is that the second version allows you to add comments to the commit. For example: git commit -m "this is a comment")

An important thing I should mention is that having some familiarity with the command-line is critical to doing development. In my case, the command-line tool is called "Terminal" and this is where those git commands above are written.

The points I made above again re-enforce the fact that there is just so much more to learn than could otherwise be taught in any beginner class. It should also be kept in mind that most beginner classes have a steep learning curve in any case and pushing as far as writing real-world apps/websites will possibly drive away even more students than those "3-day/1-week  and give up" kind of people.

A good counter-argument to my own reasoning that "programming isn't as simple as it seems" is the JavaScript-way of doing things.

Basically, by combining the aspects of JavaScript front-end programming with a Back-end service of sorts (something like Parse or FireBase) you can:

1) Focus on building the application itself (the logic and how it will look)
2) Eliminate the need for pages altogether (think of something like how gmail works)
3) Auto-scale (scale is a big catchword nowadays and I agree that your app shouldn't 'break' or crash if you hit a magical 10 million views a month or 5000 concurrent views)
4) Make rapid-prototyping possible


I can't think of more reasons right now, although there are plenty. I will however dedicate a future post that speaks about this topic specifically (I plan on using EmberJS for a little project I have in mind).

Even with these counter-arguments, I still feel that learning how the full-stack works will be of greater benefit to me. All that is in the end is: my preference

This is what all beginners should keep in mind and realize that no amount of flame-wars like:

Ruby vs. Python; Django vs. Rails; AngularJS vs. EmberJS

is going to matter when you are trying to build something that you can code, understand and modify.

I will be blogging again soon, but not before I've gone a lot further than a single chapter. Expect to read more from me at (hopefully) CH 6/7.

Monday, 28 October 2013

The first post - Learning Django

Doing the tango with Django

I'm currently looking into this tutorial or guideline on working with Django:

http://www.tangowithdjango.com/

So far things have worked out okay. However, my installation has, on a grand scheme of things, failed.

The problem is that what is supposed to install into my localized python install using "Pythonbrew" is in fact installing on the system-used Python version (which in my case is 2.7.3)

In order to get around this, I used a simple hack and copied all the python-extras from here: usr/local/lib/python2.7/dist-packages

To the pythonbrew folder that stores all the extras. Surprisingly, it has worked so far.

Also, part of the process of learning Django has been to adopt the "Git" mindset.

Git isn't easy to learn, but the basics of using it are pretty straightforward.

I plan on sharing more detailed blog posts in the future, but this was just to get the "ball rolling".

Back to learning!