• 0 Posts
  • 16 Comments
Joined 1 year ago
cake
Cake day: June 17th, 2023

help-circle










  • I think that having a strong public domain is good for everyone. For instance properties like Sherlock Holmes really took off once it was in the public domain and people could write spin-offs and whatnot without worry that a copyright lawyer would come along and sue them.

    Linux is the same thing, Amazon using the kernel and stuff to build an OS on doesn’t take anything away from anyone else who uses Linux as a desktop or server environment, and in fact can lead to some good pass back, even if it is just that the devices are easier to root. Take a look at the Open-wrt project, where Linksys built their router on top of a Linux kernel and it led to a whole ecosystem of open routers. People went out of their way to buy a WRT-42G just with the intent of rooting it, and Linksys got their money either way.




  • The code on the left is more readable. It is easy to follow and see what is happening at each step.

    That being said, the code on the right is easier to maintain. If the requirement comes down the pipe that we now need to support a new pizza topping it is easy to jump to the add toppings method using the IDE instead of scanning the entire monolith procedural function. Or if we now need to add support for take-and-bake, we can just modify the small entry method.

    This also assumes that we are not needing to reuse any of these methods. If you want to add toppings to a sandwich or a salad, better write another huge method like the one on the left, or add a ton of nested if/else or switch statements. If you use the style on the right you can reuse the add toppings method without worrying about if you should preheat the oven for a salad.

    The author chose a very simplistic requirement for an example and it is all well and good until you let it fester in a code base for ten years, with multiple interns maintaining it and end up with a huge spaghetti code monster to deal with.