Hacker News new | past | comments | ask | show | jobs | submit login

If the boilerplate is the horrific part, well that's just Java isn't it? The meaningful functions are straightforward and do what you expect. Describe the level of the first radio that returns non-zero starting with the most advanced technology. Or in the case of CDMA/EVDO, the lowest level.



Well no, Java isn’t the best of languages but my criticism stems from other issues, such as weak type system, certain inscrutably bad decisions about the runtime libraries and other, but this code is bad also according to any self respecting java developer.

An untyped (that is, it cops out to int) bunch of public static’s that should’ve been an enum. Daft combination of builders and constructors. Magic numbers. Adapter methods that should go into their own class. Validators that should also go into their own class (and even there, implemented differently, not as a parameterless method). Transformers that could be modeled as their own class (all these “in their own class” are for testabilty.) some of the names in these adapters suggest some other domain concerns (UI) are leaking into this model class.

IOW, it’s a mess by any standard


> An untyped (that is, it cops out to int) bunch of public static’s that should’ve been an enum.

Java platform code does not use enums since they are more taxing in terms of memory usage. Till Google I/O 2018, Google use to officially recommend that you should avoid enums in your app code if you can.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: