• 0 Posts
  • 5 Comments
Joined 2 months ago
cake
Cake day: June 4th, 2025

help-circle
  • zerofk@lemmy.ziptoProgrammer Humor@programming.devVintage
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    3 hours ago

    You know how some languages write left-to-right, and some rught-to-left? Endianness is that, for numbers.

    Or another analogy is dates: 2025/12/31 is big endian, 31/12/2025 is little endian. And 12/31/2025 is middle endian. Which makes no sense at all because the middle is, by definition, not an end.





  • A nice post, and certainly worth a read. One thing I want to add is that some programmers - good and experienced programmers - often put too much stock in the output of profiling tools. These tools can give a lot of details, but lack a bird’s eye view.

    As an example, I’ve seen programmers attempt to optimise memory allocations again and again (custom allocators etc.), or optimise a hashing function, when a broader view of the program showed that many of those allocations or hashes could be avoided entirely.

    In the context of the blog: do you really need a multi set, or would a simpler collection do? Why are you even keeping the data in that set - would a different algorithm work without it?

    When you see that some internal loop is taking a lot of your program’s time, first ask yourself: why is this loop running so many times? Only after that should you start to think about how to make a single loop faster.