Category: C

Sad passing of Dennis Ritchie

Saw a tweet earlier on today and it caught my eye.

Then learnt that the creator of the C programming language and also Unix, passed away over this weekend.

RIP Dennis Ritchie.

On a more serious note, need to get this off my chest, and no dis-respect either in this regard to Apple’s Steve Jobs who also passed away last week, but…and this is what I find absolutely gob-smacked about, very little was mentioned of Dennis Ritchie (dmr). The twitter-sphere has been going on about Steve Jobs for the last week or so. The cruel twists of fate has been made… when you read on and realize…

But what the twitterers fail to grasp the concept and realization, there would have been no C language nor Unix for that matter, no applications/games that was possible in the 1980′s and 1990′s either, and no operating systems either.

When you think about it for a moment, the influx of different designs of operating systems was programmed in C, combined with assembler programming language.

Nor would the advancements  in chip design have been achieved, which is a catch-22 in this regard, some kind of a package to be able to program the logic flow of chips etc. Hell, even, there would be no mobiles/smartphones, no Android, no Apple OS….

Even in the telecommunications sector, without C, there would have been no improvements somewhat in the arena of phone switching etc, nor even a operating system to run, in the sense of to manage the telecommunications infrastructure either.

There would have been no internet (TCP/IP protocols which was formed on the backbone of the C programming language), or even would DARPA have existed only for that once when the gates to the internet world was opened up? What about web pages, blogs, Twitter, Facebook, the things that we take for granted now today in this electronic age where communication is even more emphasized.

And it was not Steve Jobs that is a legend either, for that matter, sure he pushed and raised the bar for Apple has become of today. No dis-respect to him either, without him, certainly, smartphones would not have been made possible in terms of features and raising of the bar for standards across the board.

The real legend was the quiet man who hacked away and coined the biggest revolution in his hands alongside with Brian Kernighan that totally changed the IT world forever.

You may object and say hang on… but I digress, sure it sounds a little one sided, but have you not thought of what the world would be like today without the Unix, C today.

What would have become if dmr did not pioneer  C, or Unix. What would the IT landscape be like without it, would Apple have existed, would Microsoft have existed, internet, tcp/ip protocols, Windows, you name it…

So for all people out there, I ask you to re-tweet a simple tweet of your liking to salute dmr for he totally changed and revolutionized the IT landscape right back in the late  1960′s/early 1970′s.

From me, who was a self-taught C programmer, and Linux fanatic, I salute you dmr, you’re the real legend!

Post to Twitter

Updated code for ZTE Blade FM Radio + CM7

Hello again, I have updated the code on github to make it a daemon server that will handle the simple and intuitive command set to control the FM Radio. As from the previous blog posting, the code has been revamped. I have discovered a thing or two about the Android NDK that made be go “WTF”…

Read more »

Post to Twitter

A worthy insight into undefined behaviour

While reading this article about how undefined behaviour in the aspect of C and C++, which can cause headaches and aimless hours lost, by banging your head of the wall, on the nuances of the syntax which can throw you off completely… this article is a worthy read and ensures that code do not fall into the trap of producing “weird errors” or “it works fine on my dev machine/environment, but but…. on the production, it behaves strangely”….

Heh… this article shows a completely undefined behaviour here…

<pre><strong>$ cc test.c -o test
$ ./test
Formatting root partition, chomp chomp</strong></pre>

Well, not really undefined but… you get the drift… the author explains how certain compiler emitted code can cause “odd behaviour” which is the essence of  ’undefined behaviour’

Credit is due to this author of the blog, John Regehr, cheers for that article… thought provoking and interesting to read…

Post to Twitter

Hilarious C Code question posted on Google’s newsgroups…

Thanks to AmberJ of #crunchbang@irc.freenode.net for sharing a link which I just had to share.

The poster on the Computer Programming Language Newsgroup on Google, was in desperation of some code to deal with a very simple problem using C, involving ‘for’ loops, until someone posted his reply which emits sarcasm, ingenuity and wit and possibly a contributor to the IOCCC…the original link to the question is here

When I broke out in laughter at the sheer depraved C code, it does actually compile and answers his question!!! I have printed the contents of the above link for reference and to keep as a namesake to look back fondly on and to admire!!!

LOL, enjoy! :)

Post to Twitter

Simple Putty title changer

Right, as I am an avid fan of Putty (the secure shell application), I often run into this situation where the title of the putty session is used (usually an IP address) and if there’s a few of them running then confusion is bound to happen as the title of the window is the same…

Read more »

Post to Twitter

Recursive main outside of C

I posted an interesting question to StackOverflow about this code

#include <stdio.h>
static int n=0;main(){
void (*fn)()=&main;printf("%d\n",n++);fn()return 0;
}

It should be noted that the question was edited and hence the code was deemed ‘not of standard C’, this code above was the original prior to the edit..

The results are interesting to look at…C ya…

Post to Twitter

Evils of C

Yup! You have read the title correctly…I stumbled across this site while someone on StackOverflow posted a question ‘Strangest language feature‘, it was very interesting to see what other people have answered to that!

Nonetheless, the link to the site on the ‘Evils of C‘ was very enlightening and makes you think twice before submitting to the International Obfuscated C Code Contest (IOCC) and come up with some hacked up code that demonstrates how the C language can be abused and emit an act of defiance against the C Compiler that you have in your toolbox and yet works…

Enjoy.. :)

Post to Twitter

Quiz on C

I have added a new page listed under ‘Portfolio’ on some of my favourite questions and answers about C, the quiz is about a selection of questions and code snippets that highlights the deceptively tricky nuances of C. There will be more snippets and questions posted on it.

Enjoy.

Post to Twitter

Programming Languages Beacon

I came across a very interesting question posted on StackOverflow, the poster was trying to find out if the programming language C++ is still used, have a look here on the above site. And one of the answers contained a link to this site aptly titled as the same as this blog entry. And I had to glance at it and read it through, it is interesting to see the evolution of writing software from C to C++. (Or should that be a C++ sorry for the pun!)

What a list. It is interesting to note that in the list, Windows was developed in C++, whoa! Now we know why the DLL’s and the core system are so bloated with too many inter-dependencies.. ;)

Nonetheless, it makes an interesting read…like I did not know Google was written in C++ – in fact, to be honest, I thought it was C for it’s versed prowess in speed and size…oh well..Look at IBM’s DB2 and Informix, makes you wonder about the whole thing on databases – I do know from experience, that DB2 is extremely powerful and fast – now, I am not knocking other database vendors and open-source databases either..but there seems to be a plain fact that anything written in C is guaranteed to be much faster!

What struck me, in the irony of it, was that Microsoft’s own .NET Visual Languages (yes, VB.NET and C#) – written in C++, that’s some irony!!

Oh and by the way, it cannot be disputed but just look at the web-servers themselves, yet Apache powers about 45% of web-sites…draw your own conclusions there in comparison to Microsoft IIS!!

A very thorough reading and one that makes you ponder….

Post to Twitter

Cdecl ahoy

While hanging out and monitoring the stackoverflow.com (SO), it is absolutely fascinating to see the faceless crowd contribute their bit towards in helping other flummoxed people with programming questions that they cannot understand or decipher.

Especially C, ahhh…the true beautiful language that has been around since 1970′s when Brian Kernighan and Dennis Ritchie invented the language. To this day, it has morphed and transcended all languages, to C++, C#. I love and admire how incredible the language is and have no doubt that it will join the ranks of programming languages that refuses to die, like COBOL.

For me personally, the C programming language is like my first love ever since I came across it when I was a lanky, gawky, nerdish teen!

There is a site that caught my eye when monitoring the SO forum, that there is a web site designed for C programmers, cdecl which has been written countless times, from the command line, to the web. Cdecl is the code that understand all C declarations and such obfuscated declarations, for an example:

void (*bsd_signal(int, void (*)(int)))(int);

Now how’s that for a C declaration which gets translated into

declare bsd_signal as function (int, pointer to function (int) returning void) returning pointer to function (int) returning void

Until then my fellow C-amigos! :)

Post to Twitter

WordPress Themes

Bad Behavior has blocked 2027 access attempts in the last 7 days.

Stop SOPA