Breaking News
Comments
Newest First | Oldest First | Threaded View
Page 1 / 3   >   >>
dbenavides110
User Rank
Author
Re: Got to look at that >stuff< everyday
dbenavides110   8/5/2014 10:00:55 PM
NO RATINGS
I think would be redundant at the end, so is the semicolon just needed for lame compilers If I'm not mistaken, which means this convoluted line is one piece out of place of code, cheers ;)

Stargzer
User Rank
Author
Re: Got to look at that >stuff< everyday
Stargzer   7/24/2014 11:09:11 AM
NO RATINGS
Am I the only one who noticed that each of the two comments by dbenavidess110 are all one sentence apiece, but without a period (or even a semicolon) at the end? Is there a competition for a one-line (one-sentence) comment?

kfield
User Rank
Author
Re: The Spoiler Explains It? LOL
kfield   6/23/2014 10:59:21 AM
NO RATINGS
@yog-sothoth  "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."

That's exactly what we are doing with the code from the contest - using it to teach engineers how NOT to do it. But based on this dicussion here, it sounds like rather than having people do obfuscated code intentionally we have more than enough real-world examples out there to share. The challenge is, of course, finding out how it works and how to fix it.

Max The Magnificent
User Rank
Author
Re: The Spoiler Explains It? LOL
Max The Magnificent   6/16/2014 1:12:35 PM
NO RATINGS
@BrainiacVI: After I was halfway through my rant I figured that was the case, but continued anyway in case I was mistaken.

It's hard to stop when you are full of righteous indignation and you are in the middle of a good rant ... and then you realize that maybe the other person didn't mean what you thought he/she had meant...

Max The Magnificent
User Rank
Author
Re: The Spoiler Explains It? LOL
Max The Magnificent   6/16/2014 1:09:55 PM
@BrainiacVI I got my satisfaction a year later when one of them had to modify a program he had written and I had to contain my laughter as his expressions cycled between quizzical, astonished, confused, and dumbfounded.

There's that classic old comment: "When I wrote this, only God and myself knew what it did and how it worked... now God only knows!"

BrainiacVI
User Rank
Author
Re: The Spoiler Explains It? LOL
BrainiacVI   6/16/2014 1:01:18 PM
NO RATINGS
daleste: I was being sarcastic about self documenting code.

After I was halfway through my rant I figured that was the case, but continued anyway in case I was mistaken.

But yeah, pretty funny.

I used to point out to my colleagues the end of my S/370 Assembly compiles where it would say, "No errors found." as to why I knew my code was bug free. :-)

daleste
User Rank
Author
Re: The Spoiler Explains It? LOL
daleste   6/15/2014 12:21:52 PM
NO RATINGS
BrainiacVI, I was being sarcastic about self documenting code.  It was always a joke with my co-workers.  Your story makes it clear that documentation is always needed and can save even the author a lot of time and heart ache.

BrainiacVI
User Rank
Author
Re: The Spoiler Explains It? LOL
BrainiacVI   6/14/2014 11:55:14 PM
daleetse: Well my code doesn't need them because it is self documenting...

I worked at one place where the "older and wiser" heads told me there was no need to document the code, the instructions told you what it is doing.

I just smiled and keep documenting my code. I had learned my lesson years earlier when I had to throw out about 6 boxes of cards with programs I had written without comments and couldn't figure out what they did.

I got my satisfaction a year later when one of them had to modify a program he had written and I had to contain my laughter as his expressions cycled between quizzical, astonished, confused, and dumbfounded.

Instructions tell the computer what to do, comments tell you why.

Although I must admit I had once written a program in FORTH where I extended the compiler (FORTH lets you do stuff like that) and there was a block that looked like documentation of the OPTO I/O panels but in fact the compiler read it to generate the port addresses and bits within the port I/O byte.

The company I wrote it for brought in FORTH, Inc. to look over the code. FORTH, Inc. told me the majority of the code was vanilla, which I intended it to be, but then they flipped to the I/O declarations and said, "But this was pretty neat."

Made my day.

dbenavides110
User Rank
Author
Re: The Spoiler Explains It? LOL
dbenavides110   6/14/2014 9:34:16 PM
NO RATINGS
I think there are a lot of examples of malicious code out there too be counted, but don't quote on that ;), in safe system languages you can tell by module which program behaves well or can behaves bad, honestly saying we write good code anyone can do but in unsafe system languages nobody can proof as unintended acceleration case proves, is a shame we failed to understand that, too bad, people are getting hurt or killed, a shame

daleste
User Rank
Author
Re: The Spoiler Explains It? LOL
daleste   6/14/2014 5:48:54 PM
NO RATINGS
I have seen a lot of bad code in my career, but most don't do it out of malice.  There may be a few that think it is job security, but they are no longer in the industry...  Of course, my code is perfectly readable and maintainable...  It's just like writting, why use a big word when a small one will do.  And comments?  Well my code doesn't need them because it is self documenting...

Page 1 / 3   >   >>


Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Radio
LATEST ARCHIVED BROADCAST

What are the engineering and design challenges in creating successful IoT devices? These devices are usually small, resource-constrained electronics designed to sense, collect, send, and/or interpret data. Some of the devices need to be smart enough to act upon data in real time, 24/7. Specifically the guests will discuss sensors, security, and lessons from IoT deployments.

Brought to you by:

Most Recent Comments
resistion
 
David_Ashton_EC
 
Ron Neale
 
Alvie
 
resistion
 
David_Ashton_EC
 
David_Ashton_EC
 
Ian Johns
 
Alan Patterson
Like Us on Facebook
Special Video Section
The LTC2380-24 is a versatile 24-bit SAR ADC that combines ...
In this short video we show an LED light demo to ...
02:46
Wireless Power enables applications where it is difficult ...
07:41
LEDs are being used in current luxury model automotive ...
With design sizes expected to increase by 5X through 2020, ...
01:48
Linear Technology’s LT8330 and LT8331, two Low Quiescent ...
The quality and reliability of Mill-Max's two-piece ...
LED lighting is an important feature in today’s and future ...
05:27
The LT8602 has two high voltage buck regulators with an ...
05:18
Silego Technology’s highly versatile Mixed-signal GreenPAK ...
The quality and reliability of Mill-Max's two-piece ...
01:34
Why the multicopter? It has every thing in it. 58 of ...
Security is important in all parts of the IoT chain, ...
Infineon explains their philosophy and why the multicopter ...
The LTC4282 Hot SwapTM controller allows a board to be ...
This video highlights the Zynq® UltraScale+™ MPSoC, and sho...
Homeowners may soon be able to store the energy generated ...
The LTC®6363 is a low power, low noise, fully differential ...
See the Virtex® UltraScale+™ FPGA with 32.75G backplane ...
Vincent Ching, applications engineer at Avago Technologies, ...