Programming hints everyone could use

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

User avatar
Yogi
Jedi Council Member
Posts: 2163
Joined: 2002-08-22 03:53pm
Location: Los Angeles
Contact:

Programming hints everyone could use

Post by Yogi »

Actually, I was kidding. Never use any of these practices in real life. An interesting and funny read though.
I am capable of rearranging the fundamental building blocks of the universe in under six seconds. I shelve physics texts under "Fiction" in my personal library! I am grasping the reigns of the universe's carriage, and every morning get up and shout "Giddy up, boy!" You may never grasp the complexities of what I do, but at least have the courtesy to feign something other than slack-jawed oblivion in my presence. I, sir, am a wizard, and I break more natural laws before breakfast than of which you are even aware!

-- Vaarsuvius, from Order of the Stick
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post by Durandal »

I read this yesterday. It's fucking brilliant.
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
InnocentBystander
The Russian Circus
Posts: 3466
Joined: 2004-04-10 06:05am
Location: Just across the mighty Hudson

Post by InnocentBystander »

That lisp code made me cry.
User avatar
phongn
Rebel Leader
Posts: 18487
Joined: 2002-07-03 11:11pm

Post by phongn »

InnocentBystander wrote:That lisp code made me cry.
ROFLOL. Ever program in it?
User avatar
Yogi
Jedi Council Member
Posts: 2163
Joined: 2002-08-22 03:53pm
Location: Los Angeles
Contact:

Post by Yogi »

InnocentBystander wrote:That lisp code made me cry.
I know the feeling. For my company to get hired I had to take an evaluation test where they gave us heavily obsfucated code and had us figure out the output value.
I am capable of rearranging the fundamental building blocks of the universe in under six seconds. I shelve physics texts under "Fiction" in my personal library! I am grasping the reigns of the universe's carriage, and every morning get up and shout "Giddy up, boy!" You may never grasp the complexities of what I do, but at least have the courtesy to feign something other than slack-jawed oblivion in my presence. I, sir, am a wizard, and I break more natural laws before breakfast than of which you are even aware!

-- Vaarsuvius, from Order of the Stick
User avatar
NecronLord
Harbinger of Doom
Harbinger of Doom
Posts: 27384
Joined: 2002-07-07 06:30am
Location: The Lost City

Post by NecronLord »

This is just wicked...

Really now.
Superior Moderator - BotB - HAB [Drill Instructor]-Writer- Stardestroyer.net's resident Star-God.
"We believe in the systematic understanding of the physical world through observation and experimentation, argument and debate and most of all freedom of will." ~ Stargate: The Ark of Truth
User avatar
Manus Celer Dei
Jedi Master
Posts: 1486
Joined: 2005-01-01 06:30pm
Location: I need you to relax your anus.

Post by Manus Celer Dei »

Åccented Letters
Use accented characters on variable names. E.g.
typedef struct { int i; } ínt;
where the second ínt's í is actually i-acute. With only a simple text editor, it's nearly impossible to distinguish the slant of the accent mark.
Devious!
Image
"We will build cities in a day!"
"Man would cower at the sight!"
"We will build towers to the heavens!"
"Man was not built for such a height!"
"We will be heroes!"
"We will BUILD heroes!"
[/size][/i]
User avatar
Dooey Jo
Sith Devotee
Posts: 3127
Joined: 2002-08-09 01:09pm
Location: The land beyond the forest; Sweden.
Contact:

Post by Dooey Jo »

I've seen it before, but it's still great. That LISP code is truly a piece of art!
Image
"Nippon ichi, bitches! Boing-boing."
Mai smote the demonic fires of heck...

Faker Ninjas invented ninjitsu
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post by Durandal »

The one that really had me cracking up was the statement

marypoppins = (superman + starship) / god;
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
Tinkerbell
Jedi Master
Posts: 1487
Joined: 2004-10-24 01:04pm
Location: Neverland

Post by Tinkerbell »

Obscure film references

Use constant names like LancelotsFavouriteColour instead of blue and assign it hex value of $0204FB. The color looks identical to pure blue on the screen, and a maintenance programmer would have to work out 0204FB (or use some graphic tool) to know what it looks like. Only someone intimately familiar with Monty Python and the Holy Grail would know that Lancelot's favorite color was blue. If a maintenance programmer can't quote entire Monty Python movies from memory, he or she has no business being a programmer.

That made me happy
Darth Wong wrote:The American "family values" agenda is simple: alter the world so that you can completely ignore your child and still be confident that he is receiving the same kind of Christian upbringing that you would give him if you weren't busy.
User avatar
SirNitram
Rest in Peace, Black Mage
Posts: 28367
Joined: 2002-07-03 04:48pm
Location: Somewhere between nowhere and everywhere

Post by SirNitram »

Tehy froogt my faovirte tirck: MIT dsicovreed taht if the frist and lsat lteters are rgiht, and the lnegth is crorect, you wlil raed it.

In other words, if every one of your functions is mispelt under those rules, people will automatically correct the spellings and break things.
Manic Progressive: A liberal who violently swings from anger at politicos to despondency over them.

Out Of Context theatre: Ron Paul has repeatedly said he's not a racist. - Destructinator XIII on why Ron Paul isn't racist.

Shadowy Overlord - BMs/Black Mage Monkey - BOTM/Jetfire - Cybertron's Finest/General Miscreant/ASVS/Supermoderator Emeritus

Debator Classification: Trollhunter
User avatar
InnocentBystander
The Russian Circus
Posts: 3466
Joined: 2004-04-10 06:05am
Location: Just across the mighty Hudson

Post by InnocentBystander »

phongn wrote:
InnocentBystander wrote:That lisp code made me cry.
ROFLOL. Ever program in it?
Some DrScheme for a couple classes, it looks to be the same, and I absolutely hate it. Of course, we never acutually used it for anything useful...
User avatar
Darth Paul
Sith Apprentice
Posts: 52
Joined: 2002-08-22 11:44pm
Location: Canada

Post by Darth Paul »

A classic. You may also enjoy http://thedailywtf.com/.

The sad thing is, after maintaining some (rather expensive) legacy code for awhile, I have seen way too many of these, uh, techniques employed for real.

I don't need to test my programs. I have an error-correcting modem.
User avatar
Admiral Valdemar
Outside Context Problem
Posts: 31572
Joined: 2002-07-04 07:17pm
Location: UK

Post by Admiral Valdemar »

Oh, I wish I had this when I was doing my final year projects in Pascal and VB. The project was shit, but hey, if I can make it as hard and interesting as possible to read in source, I don't care.

"It was hard to code, so it should be hard to read." I never did put comments in.
User avatar
Faqa
Jedi Master
Posts: 1340
Joined: 2004-06-02 09:32am
Contact:

Post by Faqa »

You used a combo of VB and Pascal? You used VB for anything besides a GUI?

[CluelessBlond]Ewwwwwwwwwwwwwwwww........................[/Clueless Blond]

Otherwise, I'm suddenly grateful the code I have to decipher is only lazy, not malicious. Force these guys to use Perl for a month, they'd learn how to document code.... *grumbles*
"Peace on Earth and goodwill towards men? We are the United States Goverment - we don't DO that sort of thing!" - Sneakers. Best. Quote. EVER.

Periodic Pwnage Pantry:

"Faith? Isn't that another term for ignorance?" - Gregory House

"Isn't it interesting... religious behaviour is so close to being crazy that we can't tell them apart?" - Gregory House

"This is usually the part where people start screaming." - Gabriel Sylar
User avatar
Admiral Valdemar
Outside Context Problem
Posts: 31572
Joined: 2002-07-04 07:17pm
Location: UK

Post by Admiral Valdemar »

Nah, two separate projects that. Pascal 7 was for one thing, VB for another. The Pascal project I forget what it was, but VB was for an automated database.
User avatar
Faqa
Jedi Master
Posts: 1340
Joined: 2004-06-02 09:32am
Contact:

Post by Faqa »

Yeah, but still....

What part of "VB is for GUI's" did your instructors not understand? Or did they not know how to link em? It's the reason VB.NET is utterly and completely useless(VS2005 already gives you GUI capabilities for C#).

Oi, never mind my snobbery. I just dislike VB..... :wink:
"Peace on Earth and goodwill towards men? We are the United States Goverment - we don't DO that sort of thing!" - Sneakers. Best. Quote. EVER.

Periodic Pwnage Pantry:

"Faith? Isn't that another term for ignorance?" - Gregory House

"Isn't it interesting... religious behaviour is so close to being crazy that we can't tell them apart?" - Gregory House

"This is usually the part where people start screaming." - Gabriel Sylar
User avatar
Admiral Valdemar
Outside Context Problem
Posts: 31572
Joined: 2002-07-04 07:17pm
Location: UK

Post by Admiral Valdemar »

I believe you could use C++ or Perl or Python or any other language you wanted with VB if you were well versed in them. Since I wasn't and nor did I really care for my second year project which was bullshit, I just used VB for that. It actually worked somewhat, just, er, not as in the brief.
User avatar
Faqa
Jedi Master
Posts: 1340
Joined: 2004-06-02 09:32am
Contact:

Post by Faqa »

It actually worked somewhat, just, er, not as in the brief.
It's not a bug, it's a feature, dammit! :D
"Peace on Earth and goodwill towards men? We are the United States Goverment - we don't DO that sort of thing!" - Sneakers. Best. Quote. EVER.

Periodic Pwnage Pantry:

"Faith? Isn't that another term for ignorance?" - Gregory House

"Isn't it interesting... religious behaviour is so close to being crazy that we can't tell them apart?" - Gregory House

"This is usually the part where people start screaming." - Gabriel Sylar
User avatar
Ace Pace
Hardware Lover
Posts: 8456
Joined: 2002-07-07 03:04am
Location: Wasting time instead of money
Contact:

Post by Ace Pace »

Faqa wrote:
It actually worked somewhat, just, er, not as in the brief.
It's not a bug, it's a feature, dammit! :D
Is that what you tell those above you when your program fucks up? ;)

That list shall be put into operation as soon as I figure out how to make it work ;)
Brotherhood of the Bear | HAB | Mess | SDnet archivist |
User avatar
Faqa
Jedi Master
Posts: 1340
Joined: 2004-06-02 09:32am
Contact:

Post by Faqa »

Hey, if they can't appreciate pondering patience while waiting for a page to get through redundant server checks, they're not worth my time 8)

Most of that list is C++ in-jokes, Ace. Your course doesn't cover that unless I'm mistaken.
"Peace on Earth and goodwill towards men? We are the United States Goverment - we don't DO that sort of thing!" - Sneakers. Best. Quote. EVER.

Periodic Pwnage Pantry:

"Faith? Isn't that another term for ignorance?" - Gregory House

"Isn't it interesting... religious behaviour is so close to being crazy that we can't tell them apart?" - Gregory House

"This is usually the part where people start screaming." - Gabriel Sylar
User avatar
Braedley
Jedi Council Member
Posts: 1716
Joined: 2005-03-22 03:28pm
Location: Ida Galaxy
Contact:

Post by Braedley »

There's a reason why my high school CS teacher had rules to contradict these. Like no goto, break, or global, among other rules.

Gratuitous use of goto in a tightly packed program is best (hell even one, very obscure goto in the middle of the progam is good). Add or remove just one line in a program can royaly fuck it over. Using labels reduces 99% of this, so the moral of the story is never use labels with any goto statement.
Image
My brother and sister-in-law: "Do you know where milk comes from?"
My niece: "Yeah, from the fridge!"
User avatar
Braedley
Jedi Council Member
Posts: 1716
Joined: 2005-03-22 03:28pm
Location: Ida Galaxy
Contact:

Post by Braedley »

We did some relatively complex stuff, but we were always encouraged to find ways around using break (and in most loops, using the test variable is sufficient). The switch statement was an exception as it's very difficult to use without break sometimes.
Image
My brother and sister-in-law: "Do you know where milk comes from?"
My niece: "Yeah, from the fridge!"
User avatar
Dennis Toy
BANNED
Posts: 2072
Joined: 2002-07-20 01:55am
Location: Deep Space Nine

Post by Dennis Toy »

I heard that VB was actually used for Human Genome Project. The super-computers ran using VB codes.

Man oh man do i HATE Java! that shit is so hard and needlessly complex that i totally gave up trying to program in it.
You wanna set an example Garak....Use him, Let him Die!!
User avatar
Xenophobe3691
Sith Marauder
Posts: 4334
Joined: 2002-07-24 08:55am
Location: University of Central Florida, Orlando, FL
Contact:

Post by Xenophobe3691 »

Dennis Toy wrote:I heard that VB was actually used for Human Genome Project. The super-computers ran using VB codes.

Man oh man do i HATE Java! that shit is so hard and needlessly complex that i totally gave up trying to program in it.
Dammit man, you're telling me! I got my program all nice and set, only to discover that there's no exponent operator in that language.

And it doesn't make creating one easy, as well. God Damn Java...
Dark Heresy: Dance Macabre - Imperial Psyker Magnus Arterra

BoTM
Proud Decepticon

Post 666 Made on Fri Jul 04, 2003 @ 12:48 pm
Post 1337 made on Fri Aug 22, 2003 @ 9:18 am
Post 1492 Made on Fri Aug 29, 2003 @ 5:16 pm

Hail Xeno: Lord of Calculus -- Ace Pace
Image
Post Reply