2 ms·
I kinda wish the code for the Clojure and Java implementations were posted. In my limited Java experience, I've found that Java itself is fine, but for some re
by Sohcahtoa82 9y ago
I kinda wish the code for the Clojure and Java implementations were posted.
In my limited Java experience, I've found that Java itself is fine, but for some reason, professional Java developers stick to these crazy idioms that result in these monstrosities of code. I'm sure we've all heard of FizzBuzz Enterprise Edition[1]. It's satire, sure, but every dollar of satire contains a couple cents of truth.
I bet the Java version of that Spark job could have been done in under 100 lines of Java, but it was divided into 7 files totaling over 400 lines of code because there's this feeling that you're "supposed" to write Java like that.
EDIT: Back in college, I took a machine learning class and wrote programs that would load training data, use it to classify data, and output results. I did all the tasks in a single .java file. If I were to do it following Java idioms, I probably would have needed to separate the code that read the training data into a TrainingDataLoader class, the code that classified data into a DataClassifier, and then used a DataPrinter class to output it all, plus a main class to pull it all together. Great, my single file, ~200 LoC project is now 4 files and gained dozens more lines of boiler plate to pull it together.
Stop writing stupid Java code and then blaming Java for your code being stupid.
[1] https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...