@threejs@ForrestPKnight I mean, three.js is a confusing clusterfuck of over-engineered OOP JavaScript, if we’re being honest.
The library itself is powerful, but the code is 100x harder to follow than it would be if it was typed and written in a procedural paradigm.
@SketchpunkLabs Sometimes I think an entirely new immediate mode API built on top of WebGL or WebGPU would be better than all the existing libraries/frameworks. Accessibility would be a pain to cover though.
Sometimes you just need to learn basics so you know what you're doing.
Odin + Raylib, custom simple lighting and dithering shaders + Trenchbroom maps and basic sphere-to-triangle collisions for the player.
Loads instantaneous. Runs on potato PC.
Some people might read this and think, that's just not my world, I am stuck in this world where software breaks all the time and everything I build is disposable.
Even if that is kind of the case for you, there is still good news, because this isn't an all-or-nothing problem. It's a dial that can be turned; you can turn that dial in a direction that reduces flailing and results in more-stable long-term progress.
You don't have to remove all the dependencies, because every dependency you remove contributes to stability. Even getting rid of 1/3 of your dependencies can do amazing things.
You can look at all the things you depend on and divide them into two categories: major and minor. Major dependencies are things that, realistically, you are never going to have your own version of. I am never going to make my own graphics API, so those count as major dependencies for me (DirectX12, Vulkan, Metal, etc). I am not going to write my own CPU-side font rasterization, so anything I choose to use there (FreeType, stb_truetype) goes in that category.
With Major Dependencies, you limit your contact surface with them: You call only the functions you really need, and you do this only from the surface of your program -- you don't build data structures deep into your program that propagate the particular data structures or API decisions of any of these systems. A good API author will help you do this (stb_truetype), a bad API author will be trying as hard as they can to screw you up and force you to become tied to their system forever (anything from Microsoft or Apple).
Understanding that many API authors are hostile can cause a big change of perspective here, and once you see it, the correct tactics become much more obvious.
So, that's the major dependencies. Minor dependencies are things that are smaller, and that you want to use much more thoroughly throughout your program: for systems programmers this might be a data structure like an expanding array or hash table, for Web, maybe there are some string or file operations that you like to do.
Minor dependencies can be eliminated and it's not even hard. You just do one at a time: hey, I need this data structure, I have been importing this other code to provide that functionality, I have suffered X, Y and Z problems because of this, how about if I just implement my own simple version of this one thing?
People can get scared of implementing core stuff like this, because they look at the implementation they are using now, and it looks huge and complicated and hard to reproduce. But the thing to realize is most of this implementation is spam. It is mostly doing things for people who are not you, for reasons you don't necessarily agree with, chosen by a decision-making method that is deeply flawed. Your own implementation can be cleaner and smaller, and it can give you good feelings when you go look at it. You don't need all the functionality of the thing you are importing; you only need 8% of the functionality. Implementing that is easy.
Once you do this a few times, you have your own stable body of code that you bring with you from project to project. It won't break unless you mess with it. You can keep improving it if you want, incrementally over time, but the cost of this is small because this code represents stable algorithms that don't change with fashion, so work on this is never forced.
Every big company has their own internal version of this, but the problem in that scenario is that a big company is full of people who want different things, and have varying levels of decision-making skill, so these usually end up not so good. But when it's your own personal thing, it can in fact be very good, and help make you happy on a daily basis.
And, your software will break much less often. Which is great.
@NotAShelf@ThePrimeagen
https://t.co/p77DWbDx0X
@Hasen_Judi That makes a lot of sense, I could probably replace most of my maps with a fixed array and just accept the O(n) lookups, especially if the whole array fits well in cache.
Dealing with dynamic arrays and maps when using arena allocators. Dynamic arrays are replaceable with fixed arrays, like small_array, but what do you do when you can't replace a map with an enum array?
@AgileJebrim@OttoBunge I'm honestly becoming less and less a fan of dense areas myself, but I don't like the USA suburbia model either, I don't like cars and driving stresses me, I don't like HOAs, nosy neighbours, etc. Italian rural areas with some modernity are still the most appealing for me.
@AgileJebrim@OttoBunge Cars are obviously the fastest in an env built for cars, but in a more densely built area it's almost always faster to use a bike, and you save even more time by exercising while you get from A to B. I know you don't like dense, but sparse isn't possible in cramped areas.
@AgileJebrim@OttoBunge Imagine being born before this was invented. The humiliation of having to walk to get to your destination. The horrors of treating well your heart and burning some calories. Thank god the USA showed us the peak mode of transportation.
@zriael@AgileJebrim@sysadafterdark It has tho, you said that having no external dependencies wastes as much storage has having them, I'm telling you I disagree because with less bloat you'll also waste less storage.
@zriael@AgileJebrim@sysadafterdark Not really, external dependencies will often be bloated to some degree since they have to be generic, while an implementation specific to your requirements will cut out most of the bloat.