• glibg10b@lemmy.zip
    link
    fedilink
    English
    arrow-up
    8
    ·
    23 days ago

    I love how everyone’s missing your point

    By default, we write readable and maintainable code. But sometimes the results of profiling indicate that we need to optimize a function so much that it stops being readable. In these cases, you need comments so people can still understand how the function works, so they know how to use and change it if necessary

    This is more common in high-performance and real-time applications (the sorts of applications where you need to be thinking about cache locality, CPU pipelining, etc.)