• 3 Posts
  • 39 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle

  • To me at least angular makes a bit more sense than React’s way of doing things does. React tries to be functional with its components and yet it seems like they end up basically trying to mimic classes with useState and useEffect. To me Angular’s class-based approach makes a bit more sense (though I am primarily interested in backend development more than frontend so that could be why)

    It does kind of fall into a lot of the traps of Object-Oriented programming though so I can see why a lot of people don’t like it




  • You know neovim can use the exact same LSPs (Language Server Protocol) for intellisense as VS Code right? There’s intellisense, git integration, code-aware navigation, etc. Neovim can be everything VS code is (they’re both just text editors with plugins), except Neovim can be configured down to each navigation key so it’s possible to be way more efficient in Neovim. It’s also faster and more memory edficient efficient because it isn’t a text editor built on top of a whole browser engine like VS Code is.

    I use a Neovim setup at home (I haven’t figured out how to use debugger plugins with Neovim and the backend I work on is big enough that print debugging endpoints would drive me insane) and I can assure you I have never given variable names one letter unless I’m dealing with coordinates (x, y, z) or loops (i, j) and usually in the latter scenario I’ll rename the variable to something that makes more sense. Also, we don’t do it to seem hardcore, it’s because there are actual developer efficiency benefits to it like the ones I listed above.

    By your own logic you “can’t be bothered” to learn how to edit a single config file on a text editor that has existed in some form for almost 50 years (vi). Stop making strawman arguments.


  • My bad, that’s on me, it looks like the C++ libraries I found use either templates or boost’s reflection. There might be a way to do it with macros/metaprogramming but I’m not good enough at C/C++ to know.

    I’m learning rust and C at the same time and was mixing up rust’s features with C’s. Rust’s answer to reflection is largely compile-time macros/attributes and I mistakenly assumed C’s attributes worked similarly since they have the same name.


  • See my other comment for more detials but it kind of destroys the type safety of the language. In Java for example, it lets you modify private/protected fields and call private/protected methods.

    It’s also slower than accessing a field normally since you need to do a string lookup (but slightly faster than a hashmap/dictionary) so if you use it over a large enough list it’ll cause slowdowns.

    Most use cases for it in Java/C# revolve around testing, serialization, and dynamic filtering/sorting. And most of those cases can be handled more safely using macros/attributes (EDIT: and templates as well, though those are also pretty painful to deal with) because that gets handled at compile-time in C/C++.


  • It’s pretty cool when you use it right but it’s also really easy to shoot yourself in the foot with, even by C++ standards. For example, in other languages (I’m coming from Java/C# which both have it) it lets you access private/protected fields and methods when you normally wouldn’t be able to.

    There’s also a noticeable performance penalty over large lists because you’re searching for the field with a string instead of directly accessing it.

    For the times it is necessary (usually serialization-adjacent or dynamic filtering/sorting in a table) to use reflection, it’s faster at runtime than converting an object to a dictionary/hashmap. However, 99% of time it’s a bad call.





  • That’s definitely true but at the same time why do people have to cause fights in the first place, they’re all part of a community for a game they enjoy playing :(

    I also agree with you on the sodium license change, it’s definitely the most reasonable of the ones I listed since the dev seemed to be getting maintainer burn-out and had some bad experiences with other people in the MC modding community. I don’t really like the idea of it not being OSS though because the key strength of that is not being tied to a single maintainer or group.



  • The lead developer changed the license to a much less permissive one because of drama surrounding being credited in modpacks. The dev thinks there are forks that exist solely to sidestep crediting the original mod, I’m not up to date enough on Minecraft modding lore to know if this is true or not.

    I’m pretty sure there’s also a fork that branches off of the last GPL commit but I forget what it’s called.




  • TypeScript is still built on JavaScript, all numbers are IEEE-754 doubles 🙃

    Edit: Actually I lied, there are BigInts which are arbitrarily precise integers but I don’t think there’s a way to make them unsigned. There also might be a byte-array object that stores uint8 values but I’m not completely sure if I’m remembering that correctly.





  • That’s fair. I was mostly commenting on my own experiences with JS/TS, I’ve never used PHP so I can’t say if it’s better or worse but a few people I know have said that modern PHP is actually pretty good for personal projects. I’m guessing it would have its own set of nightmares if it was scaled to an enterprise level though.


  • That’s true but at the same time the fact that JavaScript equality is so broken that they needed a === operator is exactly the problem I’m talking about.

    And those examples were low hanging fruit but there are a million other ways JavaScript just makes it easy to write buggy code that doesn’t scale because the JavaScript abstraction hides everything that’s actually going on.

    For example, all of the list abstractions (map, filter, reduce, etc.) will copy the array to a new list every time you chain them. Doing something like .filter(condition).map(to new value) will copy the list twice and iterate over each new list separately. In most other languages (Java, C#, Rust, Go, etc.) the list abstractions are done over some sort of iterator or stream before being converted back into a list so that the copy only has to be done once. This makes using list abstractions pretty slow in JavaScript, especially when you have to chain multiple of them.

    Another simple but really annoying thing that I’ve seen cause a lot of bugs - Array.sort will convert everything into strings and then sort if you don’t give it a comparison function. Yes, even with a list of numbers. [ -2, -1, 1, 2, 10 ] will become [ -1, -2, 1, 10, 2 ] when you sort it unless you pass in a function. But if you’re looking over code you wrote to check it, seeing a list.sort() won’t necessarily stand out to most people as looking incorrect, but the behavior doesn’t match what most people would assume.

    All this is also without even getting started on the million JS frameworks and libraries which make it really easy to have vendor lock-in and version lock-in at the same time because upgrading or switching packages frequently requires a lot of changes unless you’re specifically isolating libraries to be useful (see any UI package x, and then the additional version x-react or x-angular)

    Tldr; Why can’t we have nice things JS?