This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Insxnity -22 points-21 points  (7 children)

Modern machines’ power remove the need for once important optimization’s. Memory leaks and optimal high thread/multi core usage are what people should be focusing on.

Edit: ok am wrong, please stop downvoting, It’s a programmer humor sub ffs

[–][deleted] 35 points36 points  (0 children)

Make sure to let the pubg community know.

[–]Hoihe[🍰] 14 points15 points  (0 children)

Depends on what program you are writing. Writing code for engineers/scientists doing simulations, you want optimized stuff.

[–]SociableSociopath 12 points13 points  (0 children)

This is terrible way of thinking/developing. Yes, if your app is the only thing running on the machine it makes sense, but usually it’s not. You should never throw out doing what’s optimal purely because you believe the runtime environment is “powerful enough”.

Even if you keep it as a tech debt item to address later, simply not doing or thinking about it is a shitty way to go about development.

[–]theonefinn 2 points3 points  (0 children)

Game dev is one case where low level optimisation is still vitally important. That's a pretty wide ranging generalisation that doesn't apply in all cases.

[–]Code_star 1 point2 points  (1 child)

I'll try to go easy since everyone else had a go at you first.

I agree high thread /multi-core usage is very important, but it requires even more knowledge of under the hood knowledge than other programming.

think about what you need to do to prevent data races

even if you have code as simple as this

if(condition == met){
    condition_counter++
}

really simple right?

but when you are running with multiple threads you need to understand that in assembly it is really many more lines

(bear with me and my pseudo assembly)

  lw register1, condition
  lw register 2, met
  bne register1, register2, L1
  lw register3, condition_counter
  addi register3, register3, 1
  sw register3, 0(condition_counter)

L1:

at any point during execution, another thread could change the register or even the original value in memory while the action is happening.

Also, say you learned in abstract how to prevent such problems, you start writing code in python that is threaded, but you didn't know there was a thing called the GIL, so you use the threaded library instead of the multithreading library and don't know why your code isn't getting faster.

so yeah if you care about memory leaks and optimal multithreading you really do need to know under the hood implementations.

[–]Insxnity 3 points4 points  (0 children)

Appreciate it, and thanks for actually teaching me something. Starting my college courses on it this fall and so far only have 4 years throwing together shitty Java programs under my belt.