Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I liked Groovy, but Kotlin was the better successor. Scala was beyond ridiculous as far as learning curve--crazy language. I always thought Java sucked and I spent far too much time working with Java (because money) and having to deal with framework on top of framework as well as all those idiotic design patterns that seemed so important only for me to realize years later that it was all basically a waste because OOP itself is a waste. I was writing better code in Python and Go five years ago without needing those all-important design patterns (okay, a few still translate). I just didn't know it at the time how horrible the situation was in Java. In hindsight, everything about Java was someone's money grab that I was dealing with. Mockito did help me a lot through those times, but I wish I had never gone through them at all!




I still miss dependency injection in Python

FastAPI rolled their own using annotations. It's... ...okay.

Unfortunately it also constructs dependencies per request instead of singletons, so you have to rely on hacks like `@lru_cache(maxsize=1)` on the factory functions.

I'd really like to see a Python framework that embraces class-based controllers to do away with this problem; beyond that writing a dependency injection system is not too difficult of a task (the last time I did it for a hobby project many years ago, it was around ~150 lines of code).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: