Programming is Easy (part 2)

Self-taught programmer, entrepreneur, and writer Marianne Bellotti @fspublishing follows up her awesome “Programming is Easy” blog submission with a great introductory glossary of computer programming jargon. 

Vocabulary will be your biggest enemy. Tech people tend to define basic concepts in baffling CS-major speak, so even though the concepts themselves are simple they seem beyond comprehension.

No worries, here’s a run down of some of the most common terms that are thrown around without definition.

AJAX: AJAX is a layer of javascript code that submits a request to the server without refreshing the page. Although AJAX gives us all those snazzy ‘real time auto updating’ style features, the real benefit of it is being able to pass a live javascript variable back to the server (more on this later)

On the other hand AJAX can actually be a pretty big pain in the ass for beginners to debug if something is not working as planned. Because the page is not reloading, helpful error messages that point you on the right path will not display on their own. You’ll need to tell javascript to alert you to them, or else set up a file to record server errors (a lot of times this is set up for you, you just have to figure out where it is)

Algorithm: Many people falsely assume that an algorithm is some complicated mathematical equation like those you might see scribbled out on three or four blackboards at MIT. Although algorithms usually involve some math, they are processes not equations.

A standard algorithm is a decision tree for computers. The program will fetch the value of a variable and then determine what it should do next based on the rules you have given it. Is the value less than 1? If so do this… Is it a valid email address? If so do that…

API: Otherwise known as Application Programming Interface, an API is a collection of functions that allow your program to talk to another server. In most cases APIs are used to fetch data from another person’s database. There are a couple of different ways an API can be set up, although the most common is REST where the request for data is inserted into the url probably like this:

Client-side -vs- Server-side: At least two computers are always involved in web development: your server and your visitor’s machine (otherwise known as the client). Some code is executed by the server and kept away from the visitor while other code is executed by the visitor (usually the web browser) and ignored by the server. As a programmer you will use both client-side languages (like HTML and Javascript) and server-side languages (PHP, Ruby, Python).

Your web browser can’t run PHP or Ruby. It doesn’t know what they are or what to do with them. So if you’re going to develop server-side programs (and you will have to to do anything fun) you will need to install something on your computer that stimulates a server environment (or else upload the code to your actual web server, but that’s not recommended for untested code).

The other important thing to understand is that client side languages and server side languages are kind of blind to each other. Passing a variable from PHP to javascript is simple, but passing a new value back to PHP usually requires AJAX.

Framework: Think of a framework as shorthand for programming languages. The idea behind the development of frameworks is that most programmers have the same set of features they need to include in every program and writing the same core features over and over every time you start something new is pretty boring.

So a framework is a collection of the most common functions programmers need that can be dropped into a new project. It’s important to understand that a framework is not a separate language, even though a lot of developers speak about their favorite frameworks as if they are. If you use Rails you are programming in Ruby. If you use Cake you are programming in PHP.

Resist the temptation to start right away with the framework without getting your feet wet in the underlying language. Frameworks will make programming really easy but they can’t do everything for you. If you want a feature that is unique to your project, you will have to write it yourself.

Another problem with jumping into a framework too soon is that not all languages have a dominate framework. If your chosen language is Ruby, skipping off to Ruby on Rails before you know much about Ruby isn’t a tragedy; most everyone who programs in Ruby uses the Rails framework. In PHP and javascript though, not having a basic understanding of the underlining language makes it difficult to work with other programmers if all you know is Codeigniter and jQuery and your partner is a Cake and MooTools kind of girl.

It’s okay to say ‘Oi I’m little rusty on my javascript syntax because I’m been working so much with jQuery lately’. We’ve all been there ^.^ Google can fix a multitude of sins in this regard, but you have to know what to google for first.

foobar, fubar, foo: This is used as placeholder text in example programs. It’s the Lorem Ipsum of programming.

git: Git is version control software. What that means is that it tracks changes made to your code allowing you to easily undo if you need to. When you’re coding alone you can get away without using git, but if you want to work with others (especially on open source projects) git is an amazing way to ensure people aren’t overwriting each other’s changes.

IDE: Stands for Integrated Development Environment. IDEs are basically like MS Word for code: it’s a big ass program with a whole bunch of features that will help you format, debug, test and export your program with a couple of clicks.

There are two types of IDEs: true IDEs like Ellipse, Netbeans, or Aptana and super pimped out text editors with lots of helpful plugins for programmers like TextMate and jEdit. I prefer the second type, especially when you’re still learning, because while the features of the text editors are pretty impressive there’s only so much they can do to help you write the actual code. The true IDEs can sometimes come close to writing the code for you, which robs you of the valuable learning experience of figuring things out on your own.

On the other hand, with languages that need to be compiled (e.g. – Java) a true IDE might be worth while just because you’ll only have to figure out the interface and features of one program to go from code to testable program.

MVC Stands for Model-View-Controller, this is a philosophy of organizing code. MVC is very popular with frameworks for server side languages (Ruby, PHP, etc) so at some point you will have to get used to breaking things down in MVC way.

Suppose you owned a restaurant. A well run restaurant has different employees for different tasks: the waiters do the serving, the cooks the cooking, and if it’s a busy restaurant there may also be things like bus boys and hostesses to handle simple repetitive tasks so that your waiters and cooks can focus 100% on their job.

That’s the way MVC works: your controller is your waiter taking commands from your website visitors and passing those commands along to the appropriate functions. Your model is your cook, working hard away from where the website visitor can see them pulling up data and sending it back out to be served. Then large applications, like busy restaurants, employ libraries and plugins to handle specific functions that multiple controllers need to call.

As for the view … well the view is the bit of code that displays the data in a nice visually pleasing way for the visitor. It’s almost like a template.

Namespace: You know Wikipedia has such a great explanation I’m just going to copy and paste:

Bill works for company X and his employee ID is 123. Jane works for company Y and her employee ID is also 123. The reason Bill and Jane can be identified by the same ID number is because they work for different companies. The different companies in this case would symbolize different namespaces.

So namespace is just a grouping that keeps functions, variables and other things you might name from conflicting.

You’ll likely encounter namespace with some more complicated APIs. Twitter Search, for example, separates the data it sends you into a couple of different namespaces. Depending on what you want you may need to specify the NS before your program is able to put the proper values in variables.

Refactoring: A fancy word for editing and revising code ^_^ The idea behind refactoring is making sure your code is as clean as possible with no duplicate functions.

Relational Database: The most common type of database. Information is organized into “tables” that look kind of like Excel spread sheets. To handle lots of information we build many such tables and connect the individual pieces with keys.

For example, one table will have all your blog posts, another table will have all the comments to all your blog posts. To keep the comments with their proper blog posts there will be a column on the comments table called something like “parent_id” and the number in that column will correspond to the id number of the blog post. So when you query the database you just need to tell it ‘get me this blog post and all the comments where the parent_id = the blog post id’

SQL, MySQL, NoSQL: SQL is a language the databases need requests for data written in. Most of the time a SQL query will look like a fill in the blank sentence: SELECT (this information) FROM (this table) WHERE (this condition is true). MySQL is the most common database setup web hosts offer, but there are others (PostgreSQL, Oracle…)

NoSQL is a whole family of rival database structures, they are super trendy and you’re likely to hear the names of NoSQL options— CouchDB, Mongo, Cassandra…— thrown around at Tech events. Actually the term ‘NoSQL’ in itself is misleading. Really what this group of databases should be called in ‘Non-Relational’, because that’s all they have in common: they store data without using the table structure described above.

People will tell you NoSQL databases are much better at handling big data then SQL databases, but don’t be thrown off by this. MySQL and the like are much more powerful than people give them credit for and as long as you set up your tables correctly it should be able to handle virtually anything you throw at it.

20 Responses to “Programming is Easy (part 2)”

  1. jordan shoes for sale

    jordan shoes for sale…

    An impressive share, I just given this onto a colleague who was doing just a little analysis on this. And he the reality is bought me breakfast due to the fact I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx f…

  2. yoga pant

    yoga pant…

    you’ve got a terrific weblog here! would you like to make some invite posts on my blog?…


    An impressive share, I just given this onto a colleague who was doing just a little analysis on this. And he the fact is bought me breakfast simply because I identified it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for s…


Comments are closed.