Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "1-liners"
-
Day 1 at internship:
Manager: Can you get this RFID tracking system working? We have the full source we just need it installed.
Me: Sure thing, shouldn't take too long if it's a working system.
Me: (opens VS project)
Code is a sprawling abyss devoid of any intelligible structure, commented with broken one-liners which serve only to annotate method names.
In Mandarin.
For the record the system was broken, took me several weeks to track down all the issues.4 -
Code review:
i ? plus.push(i) : --i ? neg.push(i) : zeros.push(i) || printThis() || checkAge() || !!window.MediaSource...
F***ing such a brilliant programmer, spent 4 hours to write it in 1 line, and will take your the guy who replaces you 4 hours to decipher, why are you so adverse to writing #readablecode?!!!
\n is cheap, if(){} is too
This isn't math class where a 3 line proof gets you kudos, stop wasting my time with your genius.1 -
Hey fastlane!
Great tool and all, but your documentation is at 🤡 levels, I need to read 20+ pages to get a full overview and understanding. So far I've had to read a dozen plus blogs and stackoverflow posts to find hidden flows (authentication first to do this, etc. etc. etc.)
Don't market your tool as "reducing complexity & saving time" and showing one-liners in the docs when in reality there are lots of hidden steps and NOT one-liners!!!!!!
This is why everyone complains it takes 1-2 days to just get a freaking pipeline working!!!!🤡 -
The programming things I've seen in code of my uni mates..
Once seen, cannot be unseen.
- 40 if's in 10 lines of code (including one-liners) for a mineswepper game
- looping through a table of a known size using while loop and an 'i' variable
- copying same line of code 70 times but with different arguments, rather than making a for loop (literally counting down from 70 to 0)
- while loop that divides float by 2 until it's n < 1 to see if the number is even (as if it would even work)
..future engineers
PS. What are the things you've been disgusted by while in uni? I'm talking about code of your collegues specifically, I'm also attaching code of my friend that he sent me to "debug", I've replaced it with simple formula and a 2D distance math, about 4 lines of code.6 -
A beautiful but fundamentally flawed Rust one-liner I found in my own code during refactoring today:
iter.size_hint().1.map_or_else(Vec::new, Vec::with_capacity)random size_hint.1 gets _really big_ sometimes rust allocate maximum possible memory needed one-liners14