this post was submitted on 03 Jul 2023
17 points (94.7% liked)

Programming

17450 readers
156 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Olap@lemmy.world 10 points 1 year ago* (last edited 1 year ago) (11 children)

I keep telling noobs that writing code is like 10% of what they do, and each line of code is a millstone round their neck. Terse, optimal performance (not optimized!) code meeting user requirements is the route to success. And so, doing less is how to go faster, but not what the video means

[–] Kolanaki@yiffit.net 2 points 1 year ago* (last edited 1 year ago) (6 children)

Now, I am just a modder and not a full blown dev or anything, but I've always questioned others who critcized my scripts and suggested much more complicated ways of doing the same thing. Like I can do exactly what I wanted with 1 line of code, and someone would come in and say "do it this way for better results" and it's 6 lines of crap that ends up working exactly the same. Why?! Especially when this was for a game that has a notoriously slow script engine, meaning more lines of code = slower, no matter what you were doing.

[–] douglasg14b@programming.dev 5 points 1 year ago* (last edited 1 year ago) (2 children)

That single line of code may be using a slow abstraction, doesn't cover edge cases, has no caching of reused values, has no optimization for the common path, or any other number of issues. Thus being slower, fragile, or sometimes not even solving the problem it's meant to solve.

More often than not performance and robustness comes at a significant increase to the amount of code you have to write in high level languages... Performance optimizations especially.

A high performance parser I was involved in writing was nearly 60x the amount of code (~12k LOC) of the lowest LOC solution you could make (~200LOC), but also several orders of magnitude faster. It also covered more edge cases, and could short circuit to more optimal paths during parsing, increasing the performance for common use cases which had optimized code written just for them.

More lines of code = slower

It doesn't. This is a fundamental misunderstanding of software engineering and is flawed in almost every way. To the point of it being an armchair statement. Often this is even objectively provable...

[–] pragma@programming.dev 1 points 1 year ago

This makes me feel better about my if..then..else walls.

load more comments (1 replies)
load more comments (4 replies)
load more comments (8 replies)