4 ms·
I’ve read a lot of code as a consultant. The best codebase I’ve read had almost no comments and was written in erlang. Besides that every codebase I’ve read in
by baby 7y ago
I’ve read a lot of code as a consultant. The best codebase I’ve read had almost no comments and was written in erlang. Besides that every codebase I’ve read in Golang were super clear and of excellent quality for the exception of one that was written by java developers.
I can say I hated reading C because of maccros and different build systems. I hated C++ codebases because people abused generics. And I hated Java the most because of the verbosity and the directory structure and all the layers of abstractions and all the factories and all the singletons and all the...
- Insanity 7y agoThat is always a risk if a team decides to pick up a new language but does not make the effort to learn the language properly. At work we are going through a similar Java - Go transition, so I know :(
- noir_lord 7y agoIt's always a problem when people shoe-horn a non-idiomatic approach from one language into another. It makes me wish the language creators wrote a single none-trivial 'this is how we intended it to look' project. When learning a new language I find as many big projects written in it as I can and spend time exploring them. It helps but there is often no guarantee those projects are doing it idiomatically either.
- chubot 7y agoLooking through the Python standard library or Go standard library should be a clue not to use Java idioms, but yes I realize those habits are hard to break. I have seen Java-in-Python and it is indeed painful.
- noir_lord 7y agoThe problem with reading framework and library code is that it's very coupled to what it is, so while it's interesting and valuable to read it's not really the type of code you'd see in a business app or whatever.
- JamesBarney 7y agoYeah I've tried this several times and the code written for the std library is so different from LoB code(because the domains are so different) that you can only learn a small % of possible idioms from them.
- asdfman123 7y ago> because of the verbosity and the directory structure and all the layers of abstractions and all the factories and all the singletons and all the Fair, but a lot of those abstractions make life more difficult for new programmers (Why do I have to look through 12 classes to find out what this button does?), but make life much easier when you know the code base and have to maintain and extend it. Or, legit question - is Java more prone to these types of issues due to its design?
- marcosdumay 7y ago> is Java more prone to these types of issues due to its design? Yes. Except on the actively powerless languages (mostly C and Go), people write code on other languages with the same flexibility that all that indirection creates on Java, but they use much simpler structures.
- ofrzeta 7y ago> .. the layers of abstractions and all the factories and all the singletons and all the... You can have that in PHP, too, when the project builds on Symfony, that is to say the style is not only dictated by the language but also on the framework used.