• 1 Post
  • 105 Comments
Joined 1 year ago
cake
Cake day: June 1st, 2023

help-circle









  • I don’t think you necessarily need to have studied a lot of math to be successful in programming, but you will need it if you want to get a CS degree, which in turn can be a good lever to a fruitful programming career.

    My advice when it comes to math - math skills build upon the concepts you’re expected to have learned before, meaning that if you didn’t fully get everything in the past, then your foundation is not in great shape and you will struggle at higher levels. Going back and repeating the fundamentals just so that you fully understand everything is very helpful in my experience.

    I also think that understanding math is rewarding in itself, for what it’s worth!






  • Consider the following: You have a class A that has a few dependencies it needs. The dependencies B and C never change, but D will generally be different for each time the class needs to be used. You also happen to be using dependency injection in this case. You could either:

    • Inject the dependencies B and C for any call site where you need an instance of A and have a given D, or
    • Create an AFactory, which depends on B and C, having a method create with a parameter D returning A, and then inject that for all call sites where you have a given D.

    This is a stripped example, but one I personally have both seen and productively used frequently at work.

    In this case the AFactory could practically be renamed PartialA and be functionally the same thing.

    You could also imagine a factory that returns different implementations of a given interface based on either static (B and C in the previous example) or dynamic dependencies (D in the previous example).





  • Iceland runs plenty of these and has a nice culture of frequenting the public bathhouse. It’s one of the few things you can do that is actually affordable there.

    They do have the advantage of having essentially infinite clean energy in the form of geothermal heat. As do Japan in many cases, for that matter. I’m sure that has something to do with these institutions having staying power there.

    Anyway, I think this idea has merits, but not as an energy saving measure. The reason for this is that in order to maintain good water quality, you have to shower thoroughly before getting into the bath, negating the potential energy benefits of the initiative. We can bring it back for it being nice, though!