Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
jestdotty655021h#2 when working with idiots or spaghetti
#1 becomes an architecture problem and you'll need to own the code because if someone lesser touches it you'll have problems. but it's a nice fancy race car vroom vroom -
CaptainRant454721h@jestdotty #2 lmao
#1 :scientist-voice: Innnnteresting, jestdotty. Thank you for the insight. Something to think about. Vroom vroom, rarrr. -
#1 be prepared for side effect methods/functions. lot'o'fun sigfaults in true multi threaded (actual vroom vroom) runtimes, and similar, but still lot'o'fun data race (not so vroom vroom).
#2 where can I download more ram? the link from 1998 works only for 2Mb. Also, "Is this functional programmimg?" morons. -
Lensflare2075520hFor the vast majority of cases, you don’t need to be worried about performance or memory usage (premature optimization).
Use whatever is the cleanest and less likely to bite you in the ass later.
Avoiding mutable state is a good rule of thumb. -
whimsical90418hYou did too much React. But tbh, everyone does, even thinking about it, is just too much. Now you see state everywhere like something hard and problematic. I wish I could help you 😂 But I think it's too late :p
-
BordedDev272315h@CaptainRant This will end up being linked lists vs arrays, which is faster ;P
In general, 1 will always be faster (and it can be A LOT faster, it's one of the things that will cause a lot of performance speed in js :D), 2 will always be "safer", and make equality checks easier, which is pretty much a requirement for react, since that's how "dependencies" are tracked (ever wondered why it's the slowest framework of all of them ;P) -
@BordedDev
Yes, I know about the pros and cons of the various data structures.
I had no idea React was the slowest framework. lol. They market it as blazing fast.
Related Rants
Regarding coding style, would you rather prefer:
1) Mutating state
This one sounds intuitive and performant because you are working with only one memory segment in place. I think that if you are skilled enough to efficiently modify the state without bugs, then everything should be efficient and powerful.
2) Copying state and modifying the copy
This one seems counter-intuitive to me because it sounds like you are doubling the resources it takes to perform the operation
Funny enough - at least for React, Python and my experience at work - it seems approach 2 is gaining popularity. Does this also apply to C? I would think not. Hm.
question
code
efficiency