You Are Here:

Community: Blogs

Ron Liechty's Forum Nokia Blog

And Now For Something Entirely Different

Nokia Ron | 30 August, 2007 03:24

Ah the words I loved to hear right after the giant foot smashes the nude lady as the band plays Sousa’s Liberty Bell march. What, you only know Monty Python’s Flying Circus from movies and the dead parrot bit? The 45 episodes that began in 1969 have lasted 40 years and still stand up today. Something else began development in 1969 and was released in 1972 even before Monty Python made it to the American shore. That is the programming language called C, truly this was something entirely different.
 
C is a modular (structured) programming language that was designed to be a portable assembly language. John McEnerney one of the original authors of Think Pascal once wrote an e-mail saying he had finally found pure eloquence and it was pointers in the C language. Programming languages have come and programming languages have gone but C has endured and spread in dozens of variants and the basis for Java. All POSIX compatible operating systems come with a C Compiler built into the system. With just 30 words a language that is so powerful that it changed the world. It is not UNIX or Linux that made open source acceptable it was the portable language of C that allowed everyone on a wide variety of platforms to write something that they can share with the world.
 
So lets all raise a toast to something entirely different C, the eloquent programming language. Thirty-five years young and still it endures.
 
Ron

RSSComments

Re: And Now For Something Entirely Different

alexbk | 30/08/2007, 18:07

One of the more important design decisions in C was not to do any boundary checking. In effect, C invented the buffer overflow bug. In his 1980 Turing Award lecture, C. Antony R. Hoare (the quicksort inventor) described his experience in the design of Algol 60, a language that included bounds checking, saying:

"A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interest of efficiency on production runs. Unanimously, they urged us not to - they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980, language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law."

We can still feel the effects of this design decision 35 years later, in the form of viruses, spam and general insecurity of software. So sorry Ron, I won't be joining your toast. That's even before we get to daft design decisions such as making all strings end in a , because PDP-7, the original C machine, supported them on a hardware level - how does that fit with a portable assembly philosophy?

Alexander Kanavin

Re: And Now For Something Entirely Different

Nokia Ron | 31/08/2007, 05:32

Nokia Ron Hi Alexander,

That is a good one, thanks for the laugh. And you only had to go back 25 years to find someone that said something against C. C is designed as a low level language for intelligent professionals that know what they are doing and those that can't meet this high standard should be using the higher level languages.

BTW
My first hack was with a hex editor does that make all 16 bit systems evil?

Ron

Re: And Now For Something Entirely Different

alexbk | 31/08/2007, 13:28

Ron,

your original post implied that C is a general purpose tool for everyone, and now you seem to say it's for kernel hacking and 3D graphics only :) Programming in C is a resource management hell, and no amount of programmers' intelligence can help with it. If you want criticisms of the language from this century, here are some:
http://www.faqs.org/docs/artu/why_not_c.html
http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language

Have fun,
Alex

Re: And Now For Something Entirely Different

Nokia Ron | 31/08/2007, 17:06

Nokia Ron Hi Alex,

I said that C allowed for open source and was very powerful and elequent. I don't think any of that implies it isfor everyone.

I own about ten different types and sizes of hammers. Two ball peen hammers, two mallets, two plastic tipped hammers, a tack hammer, a framming hammer, one designed to tack canvas to a picture frame. All of these hammers are great and do the same function, but the best hammer I have and the one I use most of the time is the simple carpenters claw hammer.

I can build a great house with a claw hammer or I can build a crappy one, the house does not make the hammer good or bad, it merely shows my craftsmanship.

Ron

Re: And Now For Something Entirely Different

TwmD | 31/08/2007, 15:18

>> intelligent professionals that know what they are doing

That sounds pretty naive. The best engineers in the industry know that everyone including themselves makes mistakes and design systems and tools which detects those mistakes early. Good engineers know that C can lead to certain errors and deal with it using an engineering methodology.

Re: And Now For Something Entirely Different

Nokia Ron | 31/08/2007, 17:31

Nokia Ron I don't understand your response.

C has exception handling and string length limitations and checks in other areas to catch mistakes early. A good criticism of those who use and teach others in C is that they do not use these available tools.

Anyway thanks for reading and the response.

Ron

Re: And Now For Something Entirely Different

TwmD | 13/09/2007, 00:17

I guess my point is that intelligent professionals don;t always know what they are doing, they know they are human and have mood swings and make mistakes with logic and loop terminators when they are tired or stressed or hungover. So i'm sure that long time C programmers make less "schoolboy errors" but it only takes one schoolboy error to produce a buffer overun vulnerability or to trash memory that doesn't belong to you and so "professionals" put in place extra code (such as asserts and OOM tests) and when a error is really common, may wrap it up in a e.g a bounds checking container.

Re: And Now For Something Entirely Different

Nokia Ron | 13/09/2007, 01:23

Nokia Ron I agree, but a good program is not created in one day or one week, if you are hung over for days on end or having mood swings that last for weeks then you really need to find a type of work that makes you happier.

I think we agree, if I need to write a database program, I'm just going to dig out Access, I'm not going to screw around using C. But if I want to write the baggage handling system for the Denver airport and have it work.. I want C or one of its derivatives.

Ron

Re: And Now For Something Entirely Different

hartti | 31/08/2007, 02:16

hartti You really lost me there with your first paragraph, huh.. what giant foot smashes the what nude lady and what band plays whose and what song? I guess it shows I am a foreigner in the States...

Yep, C is beautifully designed language, which I abandoned more than 10 years ago snif. But I remember photocopying pages from Kernigham-Richie C book as a student - I did not have money to buy it...

Re: And Now For Something Entirely Different

Nokia Ron | 31/08/2007, 05:35

Nokia Ron Sigh, Hartti,

It is time to give up on the San Jose Sharks and get some culture in your life. Monty Python is British and still shown world wide even in Finland.

Ron

Re: And Now For Something Entirely Different

savago | 09/09/2007, 09:13

Ron

I agree with you, C is a small and beautiful programming language, and K&R book is a landmark of *how* to describe a complex and powerful language in clear and concise way.

The language and the Unix family of O.S. are both centered around the idea of simplicity, as a quote from Dennis Ritchie says: "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Eric Raymond's "The art of Unix programming" describes well the 'rules' in which Unix is built.

Concerning pointers, as Joel Spolsky says in "The perils of JavaSchools" if you are *not* able to understand and use pointers, you should be doing anything else but computer science...
;-)

In this days you have plenty of tools to help development (valgrind, electric fence, compiler warnings, stack smash protection, etc) with C for free.


Best regards

Savago

Re: And Now For Something Entirely Different

Nokia Ron | 13/09/2007, 01:08

Nokia Ron I apologize in the delay in posting this, I was on vacation and forgot I had a new response. Thanks for the words

Ron
You must login to post comments. Login
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia