Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

> most salient lines of 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.



sort by: page size:

my favorite:

/*

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.

*/


Love the line:

"LOOK AT THAT CODE! It’s absurd, asinine, just plain awful! …however, it worked!"


“ 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


And further down:

    /*

    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.

"Geez, what idiot wrote this code? Oh yeah, me."

I hate that feeling.


> 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.)


“someone sneaks in a boobytrapped compiler somewhere...”

Especially one that spits out a white supremacy message every once in a while: https://www.quora.com/What-is-a-coders-worst-nightmare/answe...


I think there's a metaphor for putting up with crappy code in there somewhere.

>"Je mange donc je chie."

Roughly : "I eat therefore I shit"

I never understood devs that do this, it reflects very poorly on them and it doesn't bring anything to the table. Way to show your immaturity.

I write code since 2006, 99% of it is private and is mostly read by me and I still don't do this.


Towards the bottom of the article it says:

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.


"All we have to do now is construct a few well chosen macros, and we can hide the gory details in something plausible-looking"

If someone left this code for me to read without linking to this article, I would stab myself in the face.


"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!


I find myself thinking of the different between:

"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."


>A VSCode Extension to make your code worse with AI

>Document the code with emoji

>Document the code in any style (Dirty Limerick, Fast Talkin' 1930s Gangster)

>worse

TIL I've been coding wrong my whole life. But it's the only way I know...


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.

This made me laugh out loud. I identify with the sentiment (I can get pretty pedantic about how code looks), but I wouldn't take it to that extreme.

1) "Code sober, debug drunk"

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):

https://sonnet.io/posts/emotive-conjugation/


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."
next

Legal | privacy