Hello, world

--Originally published at Codebuster

Almost like a fraternity initiation, hello world is the first program the majority of us creates in a new language, because it is the most basic of the commands. Some people actually judge the quality of the programming language by  seeing how easy is it to do this “Hello World”, which would mean, by this standard, that python is top notch.

We can do this in an editor and then run it:

hello world codehello world.PNG

Or we can even do this simple passing of the torch in the shell mode:

hello world shell


Lost in translation

--Originally published at Codebuster

I’ve met several foreigners in my life and the’ve all told me the same thing. Spanish is such a hard language to learn- we have so many idioms and slang varying from state to state. Well, if its hard for people, it sure as hell is worse for computers. Italian, German, English and such are all natural languages, but computers can’t run on this. They use what is called a formal language, this is an important difference.

In a formal language, a statement has one -and only one- meaning, despite redundancy.  They need to be very concise and specific, since they literally mean what is written, a misplaced comma or spelling error could be fatal.

literally.gif

Lastly, because of the way they are written, formal languages shouldn’t be read like we read a normal book. Instead, we should learn to break up the program in our head, interpreting the structure.


A bug’s life

--Originally published at Codebuster

A big tremendous part of any programmer’s life, whether we like it or not is debugging.

Debugging sounds like a repulsive word when in reality, although frustrating, it is one of the most challenging parts of programming.  As much as we want to, humans aren’t perfect. So it is only natural that since programming is done by us, the not perfect humans, errors happen.

This errors are called bugs, and as such, tracking them down and getting rid of them is what is known as debugging.

yelling

There are three types of errors: syntax errors, runtime errors and semantic errors.

So how exactly do you debug? Well, if you fancy yourself a Sherlock Holmes, you are in luck. In order to debug, you gather clues and have to infer what led to the error. Once you cluing for looks.gifhave a thought of where things went wrong, you modify your programm and try anew. If you were wrong, you simply have to come up with a new hypothesis of what the problem might be, but if you happen to be correct, that takes you closer to your dream program.

 


The chosen Py.

--Originally published at Codebuster

Python is generally considered a great first programming language, but what makes it stand out from the rest languages? Is it the fastest? the most used? the best?

  1. It is easy
    For real tho, if you are just getting started on writting programs, hearing about input, output, loops, functions and such can send a chill down your spine – but fear not – Python designers had this in mind, so much so that one part of the Zen of Py literally says it ought to be simple.
  2. It is a trampoline
    By learning Python you learn the basics of most programming languages, so that later you can jump into them deeper. Python is object oriented just like Javascript, C++, Perl, Ruby and such, so you can use your knowledge of Python as a foundation for them.
  3. Recognition
    Python is currently one of the most used languages by tech companies. Yahoo!, Google, Nokia and IBM are all known users, and the community keeps growing.
  4. Get online
    We all know The New York Times or The Guardian, and if you don’t, then at least you’ve heard of Pinterest and Instagram; but did you know that Django, the web application they are foundated in, is written in Python?
    wicked.gif