Design Con 2015
Breaking News
News & Analysis

Celebrating, Not Cursing, Convoluted C Code

6/12/2014 02:15 PM EDT
26 comments
NO RATINGS
View Comments: Oldest First | Newest First | Threaded View
Page 1 / 3   >   >>
DrFPGA
User Rank
Blogger
Double Prize
DrFPGA   6/12/2014 4:40:46 PM
NO RATINGS
I think you should shoot for a double prize and submit here too:

http://columbiaspectator.com/multimedia/arts-entertainment/2013/11/16/bad-poetry-contest 

Wnderer
User Rank
CEO
The Spoiler Explains It? LOL
Wnderer   6/13/2014 5:41:24 AM
NO RATINGS
That spoiler gives somes hints but not an explanation and the spoilers point 2 is just confusing.

Here's an explanation.

http://www.cprogramdevelop.com/1448772/

 

 

Yog-Sothoth
User Rank
Freelancer
Re: The Spoiler Explains It? LOL
Yog-Sothoth   6/13/2014 10:17:36 AM
NO RATINGS
What a pointless waste of time! A competition to write the best readable code would be better than one to write deliberately unreadable code.

kfield
User Rank
Blogger
Re: The Spoiler Explains It? LOL
kfield   6/13/2014 10:42:25 AM
NO RATINGS
@yog-sohoth: I don't view it as a waste of time, as the article points out, the winners are incredibly talented programmers and if this content is used as a teaching tool (which we plan do to at our event next year) it's an extremely powerful way to learn: By seeing how NOT to do things and why. Plus, we'll teach programmers techniques for fixing poorly written code, which I'm sure we've all run into at some point in our careers!!!

Max The Magnificent
User Rank
Blogger
No experience could be worse...
Max The Magnificent   6/13/2014 10:53:00 AM
NO RATINGS
No experience could be worse, except maybe sticking pins in your eyes.

Hmmm -- have you tasted my ex-wife's cooking?

Yog-Sothoth
User Rank
Freelancer
Re: The Spoiler Explains It? LOL
Yog-Sothoth   6/13/2014 11:05:37 AM
NO RATINGS
@kfield: If you teach people how to write obfuscated code just for fun, chances they will use it one day - maybe they are being taken off a project, maybe they are getting fired, who knows?


Now if you teach them how NOT to do things, but how to do them better and more cleanly, then I am 100% in agreement.

I have seen some code where a subsequent maintainer added the comment 'the f*****r who wrote this should be shot', and indeed it was truly unreadable. And also the opposite, where the code was elegantly written and comments just enough to it was simple to understand, and also admire. I know which coder I would hire.

Max The Magnificent
User Rank
Blogger
Re: The Spoiler Explains It? LOL
Max The Magnificent   6/13/2014 11:08:54 AM
NO RATINGS
@Yog-Sothoth: What a pointless waste of time

Hi Yog, what's one of the Outer Gods doing here on EETimes. The last I heard, you were described as: "congeries of iridescent globes, yet stupendous in its malign suggestiveness" -- and this was from someone who liked you.

I was going to say one can only hope that time has tempered your disposition ... howrever, reading your comment, I fear this is not so.

Personally, I think that anything that makes people think is a good idea -- and this type of thing certainly makes you think. Actually, when you do come to think about it, doing something badly when you know how to do it well is pretty difficult, like a brilliant singer trying to sound like someone who can't sing ... it's not as easy as it sounds (no pun intended).

Similarly, it's easy to write bad code if you don't have a clue (like me), but writing truly bad code when you are a good programmer takes some effort -- we're not talking about ordinary bad code here -- we're talking about code that would cause another good programmer to cringe at its awfulness.

BrainiacVI
User Rank
CEO
Got to look at that >stuff< everyday
BrainiacVI   6/13/2014 2:57:27 PM
NO RATINGS
A company I worked for had finally brought in-house the software that some consultants had written. We used to joke that all the developers there were regular contributors to the C Obfuscation Awards. Most of the code was unreadable. The first thing you were taught was "Names mean nothing", just because the subroutine was named "Print", does not mean it would ever get around to doing any. My favorite piece of code I had to unravel was named "DoSomething" with parameters A, B, C, D, E, F, G, H and no comments in the alphabet soup that followed. Subroutines would do 10 different things, but would be called because they were only interested in 2 of them, and hoped the other 8 did not have any adverse effects. A colleague and I traced one subroutine down 25 levels of calling such garbage and never hit bottom. By then we had absolutely no idea what the intent of the function was at all.

Sorry for the rant, but some people see this as being "clever" when they are coding.

betajet
User Rank
CEO
Re: Got to look at that >stuff< everyday
betajet   6/13/2014 3:40:33 PM
NO RATINGS
Brainiac VI wrote: some people see this as being "clever" when they are coding.

I would venture to say that some people regard this as "job security".

It's like Car Talk's director of guaranteed repeat business "Lucinda Boltz".

mhrackin
User Rank
CEO
Re: The Spoiler Explains It? LOL
mhrackin   6/13/2014 4:47:41 PM
NO RATINGS
Gee, Max, I thought the reference to beer and bacon would have you as the very first to sign up!  I'm completely disqualified in any case, as I gave up trying to master C syntax back in the mid-'80s.  I can read it, but no way can I write any C code!

Page 1 / 3   >   >>
Radio
NEXT UPCOMING BROADCAST
EE Times Senior Technical Editor Martin Rowe will interview EMC engineer Kenneth Wyatt.
Top Comments of the Week
Like Us on Facebook

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
EE Times on Twitter
EE Times Twitter Feed
Flash Poll