95% of all code makes me cry. The other 5% are white space.
(children :\ 0) (_.size + _) // is equivalent to children.foldRight(0)(_.size + _) // and is also equivalent to children.foldRight(0)((a,b) => a.size + b)
After our collective minds have finally gotten rid of C++ and Perl, here come the Scala guys and treat us to beautifully cryptic operators all over the place. Because really, the new 'paid by the number of lines of code' is 'paid by the number of special characters
(We know, it's not overloading, it's symbolic method names. It reads just the same)
Source: http://stackoverflow.com/a/19892108/521799
comments powered by DisqusSend us your own example of code that made you cry! Please include:
Send the above to ctmmc@datageekery.com. All accepted submissions will be licensed as CC BY-SA 3.0. Submit only code of a compatible license.
Note that we may choose not to publish some submissions if we feel they're not appropriate. We hope you understand.
Use jOOQ, instead of JDBC.
jOOQ generates Java code from your database and lets you build typesafe SQL queries through its fluent API.