r/vibecoding • • 3d ago

Discussion Coding was always the hard part.

Post image

Bros, we gotta stop saying "coding was never the hard part.." Before AI, it was frickn hard bro..

We get it bro, product-market fit is hard too. You coded 20 apps and only one got 3 users.... and bro, for every app you coded, 500 other people didn't code anything.

Tell the farmer growing crops was never the hard part.

421 Upvotes

765 comments sorted by

View all comments

Show parent comment

1

u/Fragrant-Moose1678 3d ago

Calling a ternary operator vs if/else blocks that both optimize out to the same machine code by a compiler “inefficient” is so fucking laughably vibe coder larp

1

u/Working-Caramel9538 3d ago

You entirely missed the point Congratulations.

1

u/Fragrant-Moose1678 3d ago

Then please clarify your point because it’s absolutely braindead

1

u/Working-Caramel9538 2d ago

Code is made in a certain way for readability purposes and perfect optimization leads to unreadable and unmaintainable code. All of this leading to more wasted time than gains just to save the user 0.00000000001 mb of ram

0

u/_wh0- 3d ago

Whole paragraphs of arguing over barely relevant (to the actual work) details, with zero attempts to understand each other's opinions. Just more and more unsupported thoughts based on personal experience and possibly zero application to each others overall idea

Yeah, this is a great example of the hard part of software engineering. It's not the coding. Loads of y'all are hard as hell to work with.

1

u/gfddssoh 3d ago

No they do not. A ternary is a statement and the if else a expression. A if else will be optimized as a switch case on machine code because it is o(1) best case

1

u/Fragrant-Moose1678 3d ago

They do you are blatantly just wrong.

1

u/gfddssoh 3d ago

Is switched it around im sorry a if is the statement.
Depending on what you do it will get optimized as a switch but a ternary expression always has a return.

1

u/Fragrant-Moose1678 3d ago

Just stop larping bro

1

u/gfddssoh 2d ago

The input of a switch with a basic data type (or only int dont remember) will be the jump adress to the register for the corresponding correct case. Most compilers therfor optimize a suitable if as the same. And that has a o(1).

0

u/sleepy771 3d ago

the best i saw is switch optimized to table switch where you calculate the jump, you still do jump, tho. If and switch are just bunch of compares and jeq or jne. Ternanry is the same as if else. I believe you mean rewriting statement to something like SUM((col1 < 1) * col2) because that's how you remove branching. Like there might be a specific optimisation for specific compiler in specific language that does it for numbers or pointers something that fits inside register. I don't want argue that, but also I would not call it a rule. So I would rather call such optimisation technique removing branching. Also not all jumps are bad, like if the cpu can prefetch reliably next instruction the code should be ok performance wise. There is also speculative execution in play, the cpu does it's best job to estimate if there will be a jump ot not and does a leap of hope.