Hm... I could screenshot a single character and say: "I chose this character because if it's removed, the no one can log into twitter, and the whole system stops working.
Or maybe I'd show a line of code that initiates advertiser charges, and say: "without this line of code we'd just be giving away as space, and we would lose most our revenue!
But actually, I'd probably try to find a fiendishly complex snarl of logic (yeah, I sometimes do those, on my bad days) to befuddle the poor fella with.
Yeah, there's some shitty code here.
There are some things that shouldn't
be done. I did them. Sometimes, I had
my reasons. Sometimes, I was just being
lazy. But guess what? You're sitting
there reading the source on some guy's
blog. So fuck you.
“ After reading their code, I am getting more old-school hacker vibes than a newbie hobbyist. Plenty of technical terms like "race condition" thrown around accurately. Meanwhile the heavy use of global state, and commenting out code with stuff like:
Code:
if 0
...
endif
It hints at somebody who has never worked in a modern dev agency. Fair enough, I don't mean that as an insult. But, definitely old-school style. Like someone learned to code in a time before the age of internet hacking.” A great comment in the article
/*
Yeah, there's some shitty code here.
There are some things that shouldn't
be done. I did them. Sometimes, I had
my reasons. Sometimes, I was just being
lazy. But guess what? You're sitting
there reading the source on some guy's
blog. So fuck you.
*/
Not to mention the "I'm writing this code to hack this system before the guy wakes up, but I should still comment it! Someone may have to maintain it." part.
> I like a bit of humour in my code, and I wanted to name it GodComponent.
No. Just no. Do not ever be funny in code. No one else likes your humor, and it's distracting. (Ignoring the other reasons "GodComponent" is a bad name.)
the last thing I did was changing the constants to decimal - they look way more scary this way ;>
because, you know, programming should be innately difficult and confusing so we can laugh at others who understand less than we do.
Never underestimate how many times code (any code) posted online will be copy/pasted throughout the world everywhere from school projects to production systems.
"Often, however, the same effect is had under the guise of "clever hacks" - look how clever and awesome I am!"
Sometimes I write code like that. Then I delete it and write it the proper way.
Clever code is code you will not be able to understand in the morning.
There is Kernighan's adage
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
Indeed I fear I wrote code like that yesterday (a particular problem that, after talking to 3 other engineers, everyone agreed did not have a simple solution) that I am going to have to debug today. I am not looking forward to it!
"Look at this cool code-trick I found... Maybe it's good?"
"Look at this cool code-trick I found... Warning: Despite the cool part, it actually contains several subtle and horrifying flaws and no sane person should ever trust it in production."
I think he is being sarcastic. That code is a nightmare and if a company has code with that cognitive overhead then they better get cleaning that mess.
It's harder to read the code than to write it so if you can barely comprehend the thing you just wrote, you probably won't understand it in the future: https://sonnet.io/posts/code-sober-debug-drunk/
2) I think it's more like speaking with ghosts (including a spoiler for The Sixth Sense):
in case you don't make it to the end, the closing line is
"But at the very least, fake operator overloading allows you to impress your friends by unusual-looking code."
I wonder what that's supposed to mean?
Hm... I could screenshot a single character and say: "I chose this character because if it's removed, the no one can log into twitter, and the whole system stops working.
Or maybe I'd show a line of code that initiates advertiser charges, and say: "without this line of code we'd just be giving away as space, and we would lose most our revenue!
But actually, I'd probably try to find a fiendishly complex snarl of logic (yeah, I sometimes do those, on my bad days) to befuddle the poor fella with.
reply