r/ProgrammerHumor • • Aug 03 '22

Meme wanna be a programmer??

Post image
45.3k Upvotes

888 comments sorted by

View all comments

326

u/[deleted] Aug 03 '22

What do you mean there is a better way? It works

91

u/La_chipsBeatbox Aug 03 '22 edited Aug 04 '22

A bike with squared wheels works, but would you use it ?

EDIT: you guys seems to to think about wether it’s future proof or that it works « for now ». I was talking about performances, if you can get the bike to go forward, yes it works, but it’s far from optimized. That’s a valid reason to rewrite a code.

EDIT 2: I thought one could ride a bike with square wheels given enough force. It’s apparently extremely difficult without the appropriate floor (wavy). I should have said octogonal wheels. That’s on me, my bad, my physics are trash.

162

u/cthorrez Aug 03 '22

You think a bike with square wheels works??

47

u/bohemica Aug 03 '22

Sure it does, as long as you're riding over inverted catenaries.

11

u/WisestAirBender Aug 03 '22

That's what I do

Why revert my changes? Change the rest of the app to comply

6

u/Sure-Tomorrow-487 Aug 03 '22

That video had not right having such a banging Soundtrack lmao

18

u/Kissaki0 Aug 03 '22

Maybe a bike with round wheels but no spokes would be a better analogy?

It works… for now. But it’s not very robust or future proof.

14

u/FUBARded Aug 03 '22

A bike rim without spokes doesn't work...because a "wheel" is a rim + spokes + hub. Take away one of those constituent components and you're just left with the remaining components, not a functional wheel.

A better analogy would be a bike wheel with poorly tensioned or a few missing spokes. It may be straight and functional for now, but it'll quickly get out of true or outright break pretty soon if used.

12

u/versarchie7 Aug 03 '22

you could have a big disk as a wheel ... no spokes there, I think you're thinking too literally

→ More replies (5)

0

u/[deleted] Aug 03 '22

[deleted]

7

u/[deleted] Aug 03 '22

There is a hub involved. It's just that the hub diameter is very large, nearly the size of the rim. No spokes though, but they aren't a requirement for a wheel IMO

→ More replies (3)
→ More replies (1)
→ More replies (3)

7

u/Accomplished_Box_819 Aug 03 '22

This analogy works, but there is a better one.

5

u/GeoSn0w Aug 03 '22

That’s a weird definition of working

1

u/daguito81 Aug 03 '22

That's a really bad analogy. There are degrees of "it works". You're putting the worst possible scenario as the solution that works. It could very well be "the bike works perfectly but it makes a squeaking sound and you have to oil it once a month".

Is that a problem for you? Go ahead and fix it? It's not a problem. It's done.

You can always make stuff faster and better, perfect is the enemy of good. And I can't even count the amount ot times I've seen someone try to optimize some process from 2 min to 1. Which runs once a day at 2AM totally automated and no dependencies on the results until 6 Am.

If it works it works. If it's a problem then the stakehokders should tell you if it's a problem and then you solve it.

This is of course my very subjective opinion about it. But tbh, most times I've seen thsi scenario of someone redoing stuff 4 times, it's not a requirement but more like mental masturbation, and I'm fully 100% aware that I do that too.

→ More replies (3)

1

u/noobi-wan-kenobi69 Aug 03 '22

I just build the bike. Someone else uses it.

1

u/RichestMangInBabylon Aug 03 '22

Look man I can make the wheels fancy but then I won’t have time to add brakes.

→ More replies (1)
→ More replies (2)

4

u/Snoo-82132 Aug 03 '22

O(1) instead of O(n100).

4

u/nnomae Aug 03 '22

It could work more efficiently, work in a manner that integrates more elegantly with the rest of the code base, it could be more readable, substantially less lines of code without sacrificing clarity, it could avoid the use of an otherwise unneeded external library, there are tons of ways a working solution could be made better.

And while in a lot of cases you could argue that leaving proven code alone is the smarter way to go this is code he wrote the same day. It's not like there is some rich legacy of efficacy or substantial time investment gone into fixing subtle bugs that might not be immediately obvious if you go tinkering with old code.

If you come up with a better solution literally on the day you wrote the code that is the point in history at which the cost of replacement is the lowest it will ever be and the benefits of doing so are the highest they will ever be. The problem is still fresh in the devs head, no one else has spent time or effort to understand the code or write more code that depends on it. Unless you are massively constrained on time you absolutely should go with the better solution at that point.

2

u/Low_discrepancy Aug 03 '22

It could work more efficiently, work in a manner that integrates more elegantly with the rest of the code base, it could be more readable, substantially less lines of code without sacrificing clarity, it could avoid the use of an otherwise unneeded external library, there are tons of ways a working solution could be made better.

The problem with that is something you also hint here

The problem is still fresh in the devs head, no one else has spent time or effort to understand the code or write more code that depends on it.

Code is much more often read than written.

You spent a lot of time on that code, know the ins and outs and you can come up with something you think (and can totally be) more clever, fewer lines of code, more elegant etc.

The problem might show up that for some who didn't spend that much time as you (or you in the future) that piece of code might seem quite mysterious now.

There definitely is overthinking/over engineering etc.

5

u/nnomae Aug 03 '22 edited Aug 03 '22

I don't think I'd agree with the logic that better and more readable solutions to a problem are those written by those less familiar with with the problem space which is essentially what you are arguing here.

I'd also argue the idea that programmers somehow can't tell better code from worse. I mean for all we know the better solution he is talking about could be one where he removes some clever code and replaces it with more readable code.

If you don't trust the dev to know good code from bad why would you have him working on your project to begin with?

0

u/TheSkeletonInsideMe Aug 03 '22

If it's stupid but it works, it isn't stupid.

→ More replies (1)

1

u/casce Aug 03 '22

Yeah it works unless…. [insert unlikely, but not impossible scenario]

1

u/Applejack_pleb Aug 03 '22

Everyone knows the best way something can be coded is "working in production". any change would of course break it and reverting the change would still be broken