Mahdi Yusuf

Mahdi Yusuf


Everyone is thinking why in the world would anyone pick static, when you can be dynamic, so much more agile bro. Usually the thought process is what language am I most proficient in, that can do the job. Totally not a bad way to go about it. Now does this choice affect anything else? Testing? Speed of development? Robustness?

Dynamic vs. Static

Dynamic languages are languages that don’t necessarily need variables to be declared before they are used. Examples of dynamic languages are Python, Ruby, and PHP. So in dynamic languages the following is possible:

We have successfully assigned a value to variable without declaring it before hand. Simple enough, try doing this in Java (you can’t). This can *increase* development speed, without having to write boilerplate code. This can somewhat be a double edge sword, since dynamic languages types are checked during runtime, there is no way to tell if there is a bug in code until it is run. I know you can test, but you can’t test for everything. You can’t test for everything. Here is an example albeit trivial.

Now if you are raging to some serious dubstep, its easy enough to miss that small typo, you go screw it and do it live, and deploy to production. Python will simply create the new variable and not a single thing will be said.

Only you can stop bugs in production!

Static languages are languages that variables need to be declared before use and type checking is done at compile time. Examples of static languages include Java, C, and C++. So in static languages the following is enforced

Many argue this increases robustness as well as decrease chances of Runtime Errors. Since the compiler will catch those horrible horrible mistakes you made throughout your code. Your methods contracts are tighter, downside to this is crap ton of boilerplate code.

Weak and Strong Typing can be often be confused with dynamic and static languages. Weak typed languages can lead to philosophical questions like what does the number 2 added to the word ‘two’ give you? Things like this are possible with a weak typed language.

Traditionally languages may place restriction on what transaction may occur for example in a strong typed language adding a string and integer will result in a type error as shown below.

Conclusion

Regardless of where you land on this discussion, claiming one is better than the other would lead to flame war, but there are places where each is strong.

Dynamic languages are good for fast quick development cycles and prototyping, while static languages are better suited to longer development cycles where trivial bugs could be extremely costly (telecommunication systems, air traffic control).

For example if some giant company called Moo Corp. spent millions of dollars on QA and Testing and a bug somehow gets into the field, to fix it would mean another round of testing. When sitting in that chair the choice is clear static languages FTW, its a hard job but someone has to milk the cows.

Test, test, and test.

Just a little food for thought, for when you are starting your next project. You never know what limitations you maybe placing on yourself and your team.

What do you do consider when selecting a programming language for a project?


Discussion


Most Pressed Keys and Programming Syntaxes

Wednesday, September 7, 2011

I switch between programming languages quite a bit; I often wondered what happens when having to deal with the different syntaxes, does the syntax allow you to be more expressive or faster at coding in one language or another. I dont really know about that; but what I do know what keys are pressed when writing with different programming languages. 

This might be something interesting for people who are deciding to select a programming language might look into, here is a post on the answer to the aged question of: Which programming language should I learn?

As far as I can tell languages with a wider focused spread across the keyboard are usually syntaxes we usually associate with ugly languages (ugly to read and code). ex. shell and perl.

You might argue that the variables names being used will alter the results, but as most languages programming have conventions for naming but we can assume a decent spread for variable names. I don’t offer conclusions, just poorly layout the facts. Although the heat map does miss out on things like shift and caps. ex. in perl with the dollar sign. ($)

Whitespace hasn’t been taken into consideration (tabs and spaces) which would have been a cool thing to see. 

The data that was used to gather this information was spread amongst various popular Github projects. 

Javascript

Shell

Java

C

C++

Ruby

Python

PHP

Perl

ObjC

Lisp 

Lisp code here was written by Paul Graham.

References

  1. heatmap.js http://www.patrick-wied.at/projects/heatmap-keyboard/

Discussion


Tuesday, August 2, 2011


Evolution Of Computer Languages

Evolution Of Computer Languages

Discussion


Friday, February 25, 2011


As any programmer can tell you, programming will make you swear. But did you know that writing C++ will make you swear considerably more than PHP or Python? 
Developer Andrew Vos was looking for a weekend project when he decided to grab some one million commit messages from GitHub and scan them for swear words. He limited the swearing to George Carlin’s seven dirty words and then broke down the results according to programming language. To make sure that the popularity of one language over another didn’t skew the results, Vos grabbed an equal number of commit messages per language.
C++ takes top honors, but just barely. Ruby and JavaScript are neck and neck behind C++. After that it drops off considerably with C, Java and C# placing in the middle. Python and PHP developers are either very happy about using those languages, or perhaps just very mild-mannered developers. Of course just because they don’t swear in commits doesn’t mean they don’t swear. As one commenter on Vos’s post says, “I program in Python, but all my cussing is related to IE.”
It’s impossible to know how many developers are swearing at their screens while writing code, but if you’re looking for a less swear-word-inducing programming language, PHP and Python seem to be the way to go.
Even more interesting than the statistics by language are the actual commits, which you can check out on Vos’s GitHub account. Our personal favorite: “fuck it. let’s release.” Indeed.

View in High-Res

As any programmer can tell you, programming will make you swear. But did you know that writing C++ will make you swear considerably more than PHP or Python?

Developer Andrew Vos was looking for a weekend project when he decided to grab some one million commit messages from GitHub and scan them for swear words. He limited the swearing to George Carlin’s seven dirty words and then broke down the results according to programming language. To make sure that the popularity of one language over another didn’t skew the results, Vos grabbed an equal number of commit messages per language.

C++ takes top honors, but just barely. Ruby and JavaScript are neck and neck behind C++. After that it drops off considerably with C, Java and C# placing in the middle. Python and PHP developers are either very happy about using those languages, or perhaps just very mild-mannered developers. Of course just because they don’t swear in commits doesn’t mean they don’t swear. As one commenter on Vos’s post says, “I program in Python, but all my cussing is related to IE.”

It’s impossible to know how many developers are swearing at their screens while writing code, but if you’re looking for a less swear-word-inducing programming language, PHP and Python seem to be the way to go.

Even more interesting than the statistics by language are the actual commits, which you can check out on Vos’s GitHub account. Our personal favorite: “fuck it. let’s release.” Indeed.

Discussion




Copyright 2012 Mahdi Yusuf
Errrrday I be programmin' (oh and hustlin' too)