Thursday, 30 May 2013

Why C++ and Perl are dead

I would like to start by saying never follow people's advice, the greatest adventures in life come from disobeying.

But since this is an opinion article 

The question you should first ask yourself is why?

Maybe you need these languages for code someone else wrote>

What Do you Mean by Efficient Code?
You need more efficient code

code which runs faster?
code which uses less memory?
code is easier to write?

I think the key lesson to remember is that your time is more precious than the computer's time.


Experimental Languages
Both C++ and Perl are ill designed languages which were both designed as "macro" languages to leverage existing programming languages.
I think we could call them experimental languages or maybe prototype languages in their design.
They are organic languages which have grown according to need and lack a grand design
This is precisely the key to their success, they have evolved like a genetic mess to fill in the niches of need.

The point of Perl was to avoid writing long shell and awk programs whereas C++ was at the time the best way to combine the efficiency of C and the object-oriented properties of slower language like Smalltalk.
There are many interesting ideas that came from these languages like templates in C++ and regular expressions in Perl but these have now been taken further.

Lessons Learned from These Languages
In my opinion the only practical reason one should learn these languages is to maintain existing code.
Studying these languages is also a lesson in what works and what doesn't and the principles one should adhere to in designing a language.
You can write your C code to work like C++ code.
You might also find that once you've learned these languages they don't stick in you memory.
The Ruby language was designed with the principle of least surprise or intuition.
You need only remember a few key points and then you can derive everything from first principles.
Which is why language which have an interpreter are much easier to pick up

My Advice for What It's Worth
If you think you need to learn C++, learn C first.  Once you've learned C you will realise C++ is just a coverup for C.
If you think you need to learn Perl, learn Python first.

No comments:

Post a Comment