• 2 Posts
  • 101 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).




  • Understand what tradeoffs different solutions make, then inform your decision on that. A fairly general principle for example is that the more cross-platform compatible a solution is, the less well-suited it will be for any given platform in terms of looks/behavior/performance. This may or may not matter for what you’re building.

    There are inherent qualities to some solutions (for example, a particular library may make for good solutions on a certain platform), and some qualities will be situational (a particular library is good for you because you happen to know the language/patterns/framework/whatever).

    I personally like to build things in Kotlin and Jetpack Compose, but that’s because I primarily build mobile apps for Android and I like the reactive UI paradigm that underpins this library along with the language that it’s written in. I would perhaps reconsider if I were building a desktop app (not as well supported), and definitely reconsider if I were building a web app (definitely a poor fit).

    So yeah, start with what you’re building and what its requirements are. Then think about what you already know, and finally put those together when evaluating a UI solution.







  • While Rust would probably have been a good choice for implementing a new browser, I don’t think Swift deserves the criticism it’s getting in this thread:

    • Swift was created by the same person who created Rust, and has many of the same nice traits
    • Swift is a modern language that is easy for plenty of developers to pick up; I’d place it in the same family as Rust and Kotlin
    • Swift grants access to a large pool of native iOS/Mac developers