magic_lobster_party

  • 0 Posts
  • 63 Comments
Joined 4 months ago
cake
Cake day: August 15th, 2024

help-circle
  • I agree with the first point. Always go for clarity over cleverness.

    I somewhat disagree with the second point. Consistency is important. Stick with the same name when possible. But I think mixing camel case and snake case should be avoided. It can make the code less ”greppable” IMO, because now you need to remember which casing was used for each variable.

    Kind of agree on the third point. I think flatness should be preferred when possible and when it makes sense. Easier to find the variables with the eyes rather than having to search through nested structures.


  • From a professional perspective I’d say: don’t rewrite if you’re unsure about it. Rewrite if there’s a particular problem you need to solve and a rewrite is the only way to do it.

    For example, you need to make major changes in the tech stack. Like switching from PHP to NodeJS. This is difficult to do without a complete rewrite.

    Rewrite for the sake of rewrite is usually a waste of time, and it’s not certain that the code will turn out better in the end. You might end up with a similarly convoluted system either way. And the worst part is: now you have two systems to maintain at the same time.

    Likewise, refactor if there’s a particular problem you want to solve. Don’t refactor just for the sake of refactoring. If you don’t have a clear goal, then you’re just scrambling the code around.

    From a hobbyist perspective: do whatever you feel like. A complete rewrite can be a good learning experience.







  • This is just so wrong. He’s too nostalgic of the Amiga days.

    First, he has no concrete proof that many lines of code is bad. He’s just saying “I feel like things are worse now and here’s a graph that correlates with my feelings”.

    And then he shows a graph of the number of lines in the Linux kernel. Yeah, Linux grew in size mid 90s because that was when people wanted to make it work on computers other than Torvald’s own!

    Secondly, no one wants to plug in an USB and grant whatever is in it full machine access. It’s a major security concern, and people want multitasking. What if I want to listen to Spotify while I play my game?

    The USB thing is likely not going to work either way because it can’t take into account for all possible configurations. Too bad, this program doesn’t recognize your specific WiFi card. You have to survive without internet.

    Unless someone manages to perfectly standardize everything that can possibly happen in a computer. That ain’t going to happen.












  • From the original document:

    Software manufacturers should build products in a manner that systematically prevents the introduction of memory safety vulnerabilities, such as by using a memory safe language or hardware capabilities that prevent memory safety vulnerabilities. Additionally, software manufacturers should publish a memory safety roadmap by January 1, 2026.

    My interpretation is that smart pointers are allowed, as long it’s systematically enforced. Switching to a memory safe language is just one example.