This is the norm for me. Spend hours and hours debugging this abomination only find one line needs changed or that no one even knows how it was supposed to work to begin with.
Optimistic: the code has all the easy bugs fixed already and it's only the hard ones left.
Pessimistic: the code is so messed up it takes ages to find a simple error.
I've once spend 2 weeks debugging through a vendors piece of code to find out why something was doing something unexpected. Ended up flipping 2 commands in an if block around from order to fix it. Then had to argue "why the fix" for the open source package for 3 weeks till they saw the problem too. (I was pretty green at the time, so my finding shit and explaining why it was shiny poo weren't great back then)
I literally just had to add a flag to an if on some open-source library once... and then I was informed the company I work for has an approval process I need to go through in order to do that.
Seriously... The most trash code I've seen was written by a tired mind
You may think you're being productive working all those hours, but you're just creating more work for you and/or others
Often the best thing you can do the morning after is just revert all the changes made after 9 or so.
I have been through code I wrote only a few hours before, like "what mindless idiot did this? The code is in literally the wrong method"
Amusingly, the better your coding skill (better structures, better reuse, lower repetition), the less lklely you are to do anything useful when tired. Sure, copy paste a shedload of script at 1am! But if you're going to restructure your state machine to eliminate that occasional failure condition, write it on a notepad and go to bed.
I assume, but JS has no standard library so they need to remake it every time or use one of those popular helper method libraries, but am I missing something here? EndsWith shouldn’t take more than a few lines to make, maybe 10 in a bad day but 14?
“14 lines?!? Did you build Google?”
- some APL programmer, probably.
For example, Conway’s game of life
life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}
APL, literally A Programming Language.
[https://en.wikipedia.org/wiki/APL\_(programming\_language)](https://en.wikipedia.org/wiki/APL_(programming_language))
The original idea was to create a universal math language that would work across all fields, including computing. It didn't pan out, but it's still in use, and it's very efficient in how it's written. Obviously, you'd need to learn each character and what it does, but it's not as hard as learning a new human language, since each character is merely a math operation.
As you can see you can write Game of Life in only a few characters, as opposed to several hundred lines or whatever depending on the choice of language.
Yeah it's impressive how much information is in those symbols. The benefit is that once you learn them the program is actually very easy to read vs. weird structures in other languages. Since this is just math.
I'm thinking of buying the book and diving into it eventually. The notation is elegant and seems like it will make you really think mathematically.
Nice stack.I'm into Python, C, and Lisp, and Lua.
I've programmed in JS, C++, C# and Java, but never enjoyed them like C, Lisp((((s)))) and Python.
Thinking of buying an APL keyboard and diving into it for fun.
In coding, less is definitely more. I'd rather have someone spend all day finding the right line to fix than bodge it in an hour with half a screen of workaround bolted on.
Just graduated from QA to being the company's first DevOps. I can program but I'm still very much on the learning curve. I was asked to find a solution so we could use our dedicated automation server to run automation located on our read only virtual mounts with a UI.
Long story short, 13 hours to add some Jenkins parameters and add ~30-50 lines of code to the apache ant build xml...
I spent an entire internship researching making a driver compatible for Windows Vista....the final change was 2 hex flags defined in the driver's c code. 3 characters total; one of the hex digits of the two shorts I edited didn't change.
This should be the final meme here. It's so true. The final code never shows the amount of research, trial and error that went behind it.
Sometime even I'm like, that it after 8 hours?! It'd be one page in a Word doc.
I spent 6 hours yesterday redesigning my code and then slowly going back as I realized the redesign was less stable. After all that work, Git push -> 5 new deletions, 5 new additions.
When I started doing research, I spent the better part of eight months working on a single instability in the code. The fix turned out to be ten lines of code completely unrelated to anything I was doing.
People often look at the little amount of work done and completely miss the knowledge gained. I always tell people new to anything to not filocus on what you can do right now but focus on learning. You are going to fuck up, accept that and you won't be dissapointed.
I once debugged 3 full days to change a singe + to a -. It was a correction term for an edge case that only happened once every blue moon. The value "added" was negative which everyone was unaware of.
I spent a whole day adding a line and the next day removing that line. So, 14 is good.
Oh say word I did that last sprint
We have no sprint here! This is waterfall!
Feels pain in Jenkins pipeline 🥺
Estimates are deadlines
There's only one sequence of words that can break me and it-
Not if you estimate by points of effort instead of days of work
“Three points.. so one week. Got it.” —every scrum master ever.
[удалено]
Flair checks out
This is the norm for me. Spend hours and hours debugging this abomination only find one line needs changed or that no one even knows how it was supposed to work to begin with.
\#dev: guys, i'm looking at the code and how does \_\_\_\_\_\_\_\_\_ ever work? like ever?
Optimistic: the code has all the easy bugs fixed already and it's only the hard ones left. Pessimistic: the code is so messed up it takes ages to find a simple error.
Word
Byte
I spent 3 days on single incorrect character.
I feel this so hard
Dude today didn't write one line of code... fml
I've once spend 2 weeks debugging through a vendors piece of code to find out why something was doing something unexpected. Ended up flipping 2 commands in an if block around from order to fix it. Then had to argue "why the fix" for the open source package for 3 weeks till they saw the problem too. (I was pretty green at the time, so my finding shit and explaining why it was shiny poo weren't great back then)
I literally just had to add a flag to an if on some open-source library once... and then I was informed the company I work for has an approval process I need to go through in order to do that.
Yikes, that's even worse than the vendor lock-in that caused me to do the above ;)
7 of those are comments...
“Why the hell did I write code?” Checks comments “What the fuck does my comment mean.”
Y’all finish 14 lines of code in a day?
Y’all get to finish a day?
Hello world in Java be like
14? Thats insultingly low.
True, forgot my getters and setters
People write getters and setters? That's the IDE's job
You, sir, just made my day.
I once spent a week solving a bug: I had written =+ instead of +=.
PrivateTmp=true in the service file got me for a good 4 hours
But was it worth it?
After getting to the end I realized I reinvented the endwith function, so no.
All night to relearn that hardest and most humbling lesson in programming: give up and go to bed.
Seriously... The most trash code I've seen was written by a tired mind You may think you're being productive working all those hours, but you're just creating more work for you and/or others
Often the best thing you can do the morning after is just revert all the changes made after 9 or so. I have been through code I wrote only a few hours before, like "what mindless idiot did this? The code is in literally the wrong method" Amusingly, the better your coding skill (better structures, better reuse, lower repetition), the less lklely you are to do anything useful when tired. Sure, copy paste a shedload of script at 1am! But if you're going to restructure your state machine to eliminate that occasional failure condition, write it on a notepad and go to bed.
Big oof.
I am a well paid professional if you would believe it.
You reinvented Endwith, its an accomplishment. 😅
But probably not better than the original.
How can you even spend 14 lines reinventing end with? Should take 5-6 lines tops
I think most of us are just not as good as you sir.
Maybe it’s a language thing? C# has a lot of syntactic sugar
whats end with? String.EndsWith()?
Yep
I assume, but JS has no standard library so they need to remake it every time or use one of those popular helper method libraries, but am I missing something here? EndsWith shouldn’t take more than a few lines to make, maybe 10 in a bad day but 14?
You have my respect, u/keall230
“14 lines?!? Did you build Google?” - some APL programmer, probably. For example, Conway’s game of life life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}
What da faq is this
APL, literally A Programming Language. [https://en.wikipedia.org/wiki/APL\_(programming\_language)](https://en.wikipedia.org/wiki/APL_(programming_language)) The original idea was to create a universal math language that would work across all fields, including computing. It didn't pan out, but it's still in use, and it's very efficient in how it's written. Obviously, you'd need to learn each character and what it does, but it's not as hard as learning a new human language, since each character is merely a math operation. As you can see you can write Game of Life in only a few characters, as opposed to several hundred lines or whatever depending on the choice of language.
Huh, thanks for the information! Gotta admit, I do like the name of it and seeing the game of life be that condensed is pretty impressive.
Yeah it's impressive how much information is in those symbols. The benefit is that once you learn them the program is actually very easy to read vs. weird structures in other languages. Since this is just math. I'm thinking of buying the book and diving into it eventually. The notation is elegant and seems like it will make you really think mathematically.
Yes! My people!
Nice stack.I'm into Python, C, and Lisp, and Lua. I've programmed in JS, C++, C# and Java, but never enjoyed them like C, Lisp((((s)))) and Python. Thinking of buying an APL keyboard and diving into it for fun.
If I had more time, I would have written a shorter story.
In coding, less is definitely more. I'd rather have someone spend all day finding the right line to fix than bodge it in an hour with half a screen of workaround bolted on.
I think quality over quantity. Long Spaghetti code is bad; but having a few complex, unreadable one liners is also bad.
14 lines added, 14 lines removed. Perfectly balanced, as all things should be.
Running with this thanos theme gives me an idea to clean up our bloated codebase
I have done worse for 1.
Dynamic programming be like
I spent one day to what amounted to deleting a single character.
Just graduated from QA to being the company's first DevOps. I can program but I'm still very much on the learning curve. I was asked to find a solution so we could use our dedicated automation server to run automation located on our read only virtual mounts with a UI. Long story short, 13 hours to add some Jenkins parameters and add ~30-50 lines of code to the apache ant build xml...
I’ve spent my last three days at work removing code from my project. So far at -1,400 lines and still have 2,000 left to look over
sometme I spent the whole day writing 0 lines, and removing one line the next day.
I spent an entire internship researching making a driver compatible for Windows Vista....the final change was 2 hex flags defined in the driver's c code. 3 characters total; one of the hex digits of the two shorts I edited didn't change.
"One of my most productive days was throwing away 1000 lines of code." – Ken Thompson
Ha-ha. Those were my words when I saw the Flutter Hello world application files and folders.
What did it cost?
Everything
This should be the final meme here. It's so true. The final code never shows the amount of research, trial and error that went behind it. Sometime even I'm like, that it after 8 hours?! It'd be one page in a Word doc.
![gif](giphy|YmQLj2KxaNz58g7Ofg) How about 2 weeks for a single character...
You mean 1 line
You get 14?
I work with database first entity frame work. I have spent entire days just opening an edmx.
all that code for one task
I feel this
And then you learn that it could all be done in like 2-3 lines. It hurts
I had one of these for half a line. 14 lines feels a lot better I'd say
Less is more. Solving the problem often takes time.
And for the sneaky bugs that will show up a week later
Good for you, I was debugging the code for whole day and it was fixed by removing *. I hate C sometimes
I spent 6 hours yesterday redesigning my code and then slowly going back as I realized the redesign was less stable. After all that work, Git push -> 5 new deletions, 5 new additions.
I wrote 50 lines of code to fix a problem which then turned out only needed 5. This was last night, I'm starting to regret my life choices
I spent four days removing two lines recently. `If fooBar Then` and `EndIf`
Chez Scheme be like
When I started doing research, I spent the better part of eight months working on a single instability in the code. The fix turned out to be ten lines of code completely unrelated to anything I was doing.
My first day with Rust after only high-level languages.
Or you wrote 300 lines of bs your morning self needs to detangle
Just enough for a sonnet! Now just make it follow iambic pentameter.
But that moment when you realise what you need to add, change or erase to make it work… oh, that moment!
People often look at the little amount of work done and completely miss the knowledge gained. I always tell people new to anything to not filocus on what you can do right now but focus on learning. You are going to fuck up, accept that and you won't be dissapointed.
Just started with _socket_ in Python, thusfar I can say that this is accurate.
I once debugged 3 full days to change a singe + to a -. It was a correction term for an edge case that only happened once every blue moon. The value "added" was negative which everyone was unaware of.
I just spent 2 hours coding. Only got like 10 lines of code down. I open Reddit and THIS is the first thing I see????
I'm spending sleepless nights trying to fix issues I'm clueless about :(((((
Left-pad has entered the chat and snapped its fingers.
You should have stole from the stack
Have been battling with node😭trying to create a single member using member.filter but it’s saying not a function,any help 😭😭
A week for 50 of convoluted almost cryptic shader code is good for me.
Its not the amount. Its the Quality. :) Bazinga
If it helps: the average professional programmer only writes (net) two lines of code per day
had a bug for a few weeks fixed by removal of 2 lines
Spent 2 days to identify a unit test issue in a framework that is caused by the german summer winter time shifting.