Design Development

Programming languages, libraries and frameworks

Programming books stock

When you want to learn new programming language you are suddenly faced with many challenges. What language should you learn, what abilities should it offer and so on. There are many ways to limit your options from the whole array of existing programming languages. You can for example take a look at the lately updated one, or use some kinds of usage statistics. You can also ask people on sites like Stack Overflow, your friend or colleague. Let’s consider different option … Going straight to libraries and frameworks instead of language.

What is programming language

A programming language is artificial language designed by human to communicate instructions to a machine (computer). It usually composes of two parts. First part is syntax – the form of instructions – and second is semantic – how these instructions should be interpreted by machine (computer). Programming languages can be used to create programs to control the behavior of a machine or to express algorithms. Programming language can be split into various categories depending on which condition will you use.

Two often used categories are low-level and high-level programming languages. In the first example, the word “low” refers to the limited or nonexistent amount of abstraction between the language and machine language. Think about it as being closer to the hardware. Generally this refers to either machine code or assembly language.

Example of machine code:

b8 21 0a 00 00
a3 0c 10 00 06
b8 6f 72 6c 64
a3 08 10 00 06

Example of assembly language:

section .text
 global _start ;must be declared for linker (ld)
_start: ;tells linker entry point
 mov edx,len ;message length
 mov ecx,msg ;message to write
 mov ebx,1 ;file descriptor (stdout)
 mov eax,4 ;system call number (sys_write)
 int 0x80 ;call kernel

On the other hand, high-level programming languages have a stronger abstraction from low-level languages and are easier to use and read. You probably already heard about at least few languages of this type. It can be PHP, Python, ECMAScript, C++, Java or Ruby for example to name the most used language today.

Example of Ruby:

for current_iteration_number in 1..10 do
 puts "Hello world, this is number #{current_iteration_number}."
end

Example of JavaScript:

for (var i = 0, j = 10; i < j; i++) {
 console.log(“Hello world, this is number” + i + “.”)
}

What is a library

In programming, a definition of library can be following: a collection of pre-compiled and non-volatile routines used by programs. These routines, sometimes called modules, can include configuration data, documentation, message templates, subroutines, classes, values or type specifications. The greatest asset of a library, and reason for their use, is the ability of reusing the behavior. When you use a library, program gains the behavior implemented inside that library without having to implement that behavior itself.

What libraries are available today? Well, the spectrum is pretty wide and as the saying goes, the sky is the limit. The stars of today are jQuery, underscore.js, Raphael, YUI or typeface.js.

What is a framework

A framework is a real or conceptual structure created to serve as a support or guide for the building of something that expands the structure into something useful. Frameworks can include various tools, code libraries, compilers and also application programming interfaces (APIs) bound together to enable development of a project or solution too a specific problem. You can imagine these frameworks as a ready-to-use packages (instant soup?).

Some examples of the most popular frameworks today can be for all-in-one web development (HTML, CSS and JavaScript) Twitter’s Bootstrap, ZURB’s Foundation, Front-end Boilerplate or Themosis. For JavaScript Node.js, backbone.js, knockout.js, Angular.js or Ember.js. In case of PHP you can use CakePHP, Symfony, Laravel, Nette or PhalconPHP. For Ruby it can be Ruby on Rails, Lotus, Padrino or Sinatra.

Learning programming language or framework (library)

The question I asked in the beginning is whether should you learn a programming language or go for framework instead. At the first moment, my vote was one hundred percent for programming language because you should know the fundamentals before narrowing your focus on individual framework or library. However, more important than following any advice is to understand the underlying purpose of your goal to learn new framework.

If you are going to use only some specific framework or you want to get done only some specific goal, you might not want to learn the whole language and its logic. As with everything else, learning requires investing your time and effort, languages particularly. In case you are not in it for a longer run, this investment can become a waste of your resources (psychological and physiological). It was just recently, I had to change my view on this.

In short, if you want to get job done fast without hiring and never look back, wiser choice would be to pick the framework or library of your choice, learn all necessary to use it and then move on. Is this the best practice I would recommend? Absolutely no. Through my career as a web developer and designer I saw very often that code created by someone with short-term approach – learning just the critical amount to get the job done – was not in the best shape, don’t even think about following the best practices.

In a result the first steps were often just cleaning up the code and bringing it to maintainable level. In other words, a big amount of time spent on something that would not be necessary otherwise. For this reason, I often advise people to “suffer” the pain of learning new language(s) including understanding the best practices before doing any programming. Still, if you are not building anything that will be used by more people (personal website, side project), feel free to dump the language and the fundamentals.

For the rest of you aiming for long-term approach or mindset, the best thing to do is to learn the programming language of your choice, master the fundamentals and practice the best practices. The difference will be immediate. In comparison with the result of short-term approach, your code will be much cleaner, faster, simpler and easier to maintain. The important question seems to be what are your intentions or the next future steps. Answering this might help you choose the right way you should go – language or framework / library.

Conclusion

If you want to build something (in the case of programming), you can either pick the programming language according to the requirements of your project or grab some ready-to-use framework or library without getting proper knowledge. The first choice is more time-consuming and not necessary for someone who just wants to get something done and never look back. The second will be the favorite for the rest, people eager to try something.

However, both choices will come with consequences. Skipping the learning part will increase the probability of missing out some, if not all, good practices related to that programming language which can make the code harder to maintain or understand after a certain time. Every shortcut you take has its own consequences, you had better think twice and choose wisely. So, do you prefer learning whole programming language or just the “critical amount”?

If you liked this article, then please consider subscribing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.