I find that I’ve been using C/C++ a lot less these days. Not by choice, but my the what is needed by companies. A lot of my projects deal with Internet technologies and on the LAMP stack. If I need a quick way to parse text I’ll use PHP which has a great string parsing library. No need to deal with NULL delimited strings. Companies are building web application rather than desktop application. I don’t see C/C++ disappearing any time soon. The languages are the backbone of operating systems, web servers and lower level utilities. There just isn’t as much growth in jobs available compare to higher level such as Java, PHP, Ruby and Python. Proof? Look at the job trends on indeed.com.
When I was about 12, I began my programming career. My first programming language was C++. My dad had an old Intel 286 computer he used to run his spreadsheet software. It gave me an opportunity to play around with a computer. I have fond memories of running Borland Turbo C++ and doing some while loop to print consecutive numbers. Those were the good ol’ days.
After C++, I moved to C because there were a lot of open source software that used C. The one I was particularly interested in was the Vim text editor. When I started university back in 2001, the Introductody to Computer Science course use Java. Coming from C/C++, Java wasn’t too hard to pick up. It was just before the dotcom burst and Java the the hot word du jour. In third year of the CS progrom courses such as OS and Compilers use C, my knowledge came in handy.
I’m glad I started my programming career using a low level programming language such as C/C++. For one, it gives me a greater appreciation why higher level languages such as Java, PHP, Perl, and Python were invented. An advice by Joelonsoftware for college graduates “Learn C before graduation.”
As technology advances, we continue to build layer of abstraction to hide the lower level and give programmers for productivity. Lately, I’ve been using PHP a lot development and love how the language implements Arrays. I don’t think people fully appreciate just how easy and useful Arrays in PHP are. PHP Arrays act as lists, maps, stacks and generic data structures all at the same time. Arrays are implemented in the language core and are used all over the place which results in good CPU cache locality. Perl and Python both use separate language constructs for lists and maps resulting in more copying and potentially confusing transformations.
Doing some review on C++, I stumble upon a funny post. Funny in a geeky sort of way.
The little-known operator “–>”
“After reading this post on comp.lang.c++.moderated, I was completely surprised that it compiled and worked in both VS 2008 and G++ 4.4. The code:”
#include <stdio.h>
int main()
{
int x = 10;
while( x --> 0 ) // x goes to 0
{ // prints 10 9 8 7 .. 0
printf("%d ", x);
}
}
It's amusing because there is no such thing as "GOES TO" operator in C. It actually a combination of two operators, -- and >. It is decrementing x and then comparing x and 0 with the > operator. The while loop is a lot clearer if written with parenthese:
while( (x--) > 0 ) // x goes to 0


