|
|
|
|
|
by Dewie
4205 days ago
|
|
> Also, I'm in college for computer science and the school will only teach Java courses. It's dreadful and maddening. Classical inheritance is complete shit. Compiler error messages suck. The language itself is just too bloated for me to want use. Whatever I can write in Java I can do in a fraction of the time with js with much more modular and maintainable code. Whoever likes writing Java in CS courses? > I think java interfaces are a clear sign of stockholm syndrome, as every time I asked the professor why they are necessary I never got an answer other than "to hide part of your code from the outside world", "to use as a blueprint for your classes", or my personal favorite "Because in Java you write interfaces." I tried shifting my question to "Why don't I have to write an interface in js?" That one never got answered. Maybe someone here who is crafty with Java could explain and justify for me the reason for writing what feels like more code for no obvious benefit. Almost all modern, statically typed languages have some equivalent of Java interfaces. Inheritance a la Java is controversial, but the concept of interfaces/signatures/typeclasses/traits is a very accepted language feature[1]. Maybe the benefit of it will become apparent to you once you have to write a project with more than 7 Java classes - or when you don't have to answer to lecturers that profess that you have to make all your throwaway course work super modular and generic. [1] Litmus test: even Go has it. |
|