[–] 10 points 2 weeks ago (1 child)

In the beginning we had aalib for rendering ASCII-art, which allowed saving GIMP images as ASCII art and playing movies in a text console with MPlayer. Then libcaca added colour support. And caca means poo in Latin languages like Spanish, Portuguese, Romanian or French, so...

  • source
  • [–] 4 points 2 weeks ago* (last edited 2 weeks ago)

    Tired of this trope. Learning data structures and algorithms is not about memorizing the specifics of some particular algorithm. That's like thinking that learning math is about memorizing formulas.

    DS&A is about learning *algorithmic thinking" and how common data structures actually work, so you can begin to build a toolbox of things you can use when making your own data structures. Software engineers that are actually good know this shit backwards and forwards, because it does actually come up all over the place (and these are the kind of people that actually write libraries). Even the basic things you learn in school are actually incredibly useful for understanding the implementation details of databases and how query planners and indexes work, for example (very helpful when trying to understand query performance).

    And don't get me started on just how fucking much directed acyclic graphs come up in the real world. Git? DAG. Any package manager? DAGs. Nix? DAGs. Open Telemetry? DAGs (the main data structure is a tree which is a special case of DAGs, but if you use linked spans, it would form a DAG). Hell, I'm working on something right now that needs to be modeled as a DAG. It's almost comical how useful they are.

    We should be encouraging people to learn and grow more, not less.

  • source
  • parent
  • context
  • [–] 2 points 2 weeks ago (1 child)

    Oh yeah, and that's where I think that knowledge comes in handy because they don't just say "here's a list of structures to use and the rules of when to use them" but they give you tools for evaluating how good various ideas are for handling that problem. It boils down to pretty much counting the CPU operations (which IMO is obvious, if tedious-seeming) and then goes through examples of how to do this to show that the math isn't actually that overwhelming.

    Also it helps seeing equivalence between problems. Like your example is pretty much equivalent to scheduling threads on shared CPU resources with different priorities, especially if there's a shared global cooldown between all those skills so they don't just fire off when ready. They are a bit different but they might be close enough for a similar solution to work. So research can include CPU schedulers. Though on the other hand, something running at a game time resolution is trivial compared to the OS that needs to determine this as quick as possible so it can switch to the next thread (which is also an important consideration because it might not be worth optimizing this part at all vs say the order you process the data in each frame, though this isn't a lesson from algorithms or data structure class but more general "how to optimise usefully" advice).

  • source
  • parent
  • context
  • [–] 3 points 2 weeks ago* (2 children)

    Yeah just for me personally I also really liked making things as efficient as possible, but I thought data structures and algorithms were lame because I had zero context around it.

    Maybe that's just how it's taught though, because there are really cool examples of what data structures to use and why. For instance if you have npcs with attacks that all have different cooldowns, and a central system that applies the attacks, what's the best way to store it? A min tree is O(log n) on insertion, so that seems best, but what if it's very likely an attack is invalidated and you need to remove it before it triggers? Lots of interesting concepts to consider there, instead of just "this does x and has y properties, so it's good in this use case."

  • source
  • parent
  • context
  • [–] 2 points 2 weeks ago

    Nothing specific offhand as I went to university for it and even that was a long time ago.

    My top suggestion would be if it's available through one of those free online university programs, that would probably be the best bet (aside from attending a good university computer science program).

    Other than that, my usual method for learning something programming-related is to just do a web search. Not all sources will be great but there should still be some decent ones.

    Just did a search myself, and while I haven't delved into exactly what is on this site, it does appear to be pretty comprehensive at least, plus has sample problems (which helps turn things from "something you read" to "something you know"):

    https://www.geeksforgeeks.org/dsa/dsa-tutorial-learn-data-structures-and-algorithms/

  • source
  • parent
  • context
  • [–] 3 points 2 weeks ago

    Even if you aren't implementing them directly, it can help to just understand how a library you're using implements them. Most data structures have scenarios where they are the best option and other scenarios where they are the worst option. Which one you pick can be the difference between an operation taking under a second vs minutes or hours. Hell, even if you pick the correct structures overall but layer them poorly, you can see a difference like that.

    It's like adding an understanding of engineering to woodworking skills. Sure, a carpenter could probably build a house frame on their own, but it takes engineering knowledge to minimize the amount of wood used while still being sure that it won't fall over if the wind gusts to 100 km/h or it snows during winter.

  • source
  • parent
  • context
  • [–] 2 points 2 weeks ago (3 children)

    Somehow I got into an efficiency/performance focused mindset pretty early on, so I appreciated the algorithm analysis when I got to it (though I thought then and still do think that big O notation simplifies it a bit too much... Those dropped terms can be just as or even more significant as the final term when it comes to typical data sets, but it's still useful in understanding how an algorithm scales).

    And I'd say that just going over the existing data structures and understanding their strengths and weaknesses can help just by being aware something exists. Like if all you know are arrays and linked lists, you'll probably struggle a bit to handle key/value pairs. And then, once you learn about them, you might use them for everything and then wonder why your code runs so slowly.

    And the main reason why I'd like more people to be aware of how to be good programmers is that there seems to be a lot of people that just go from "something I'm doing as a hobby" to "something I'm doing for money" or "a large hobby project that has been picked up by the community". And software quality has been dropping at a similar rate to how much hardware is improving.

    But you're right that, without the greater context, a lot of it can be confusing and can beg the question of "why do I need this?"

  • source
  • parent
  • context
  • [–] 2 points 2 weeks ago* (last edited 2 weeks ago) (4 children)

    algorithms and data structures are overrated IMO. No average programmer is manually writing sorting algorithms or reversing linked lists. And if you do need something like that, you can just google it

    edit: People have raised some VERY good points about why DSA is actually really helpful, and I guess I have to agree. I think this comes from my disappointment upon entering the professional programming scene and realizing that readability, maintainability, organization and structure are 10x more important when it comes to collaborating with others on production-grade codebases.

  • source
  • parent
  • context
  • view more: β€Ή prev next β€Ί