code-small.jpg

Cake Team Blogs

Truth about Scala

Posted by Jan Machacek

Find me on:

01/04/12 09:02

And so it came to pass that the daughters and sons of Maderakka made a statically typed, object-functional language. A language that was so complex that no programmer could possibly comprehend it. A type constructor of Towers of Babel.

As mere programmers try to learn and use the language, they pass through 7 stages; each with more and more putrid cake, left by Jambe-akka, who welcomes those who reach the last stage. Follow the terrifying journey with us and be sore afraid!


1: Bait

The project includes three Scala classes; compiler runs swiftly, IDE obediently suggests syntactically correct completions. The programmers embrace the concept of polyglot application tous ensemble.

The number of Maven dependencies: 5; build time 12 s.

2: The possibilities open

Programmers rejoice and start adding more and more classes, even objects and traits. Wise old programmer-folk warn of dangers unseen, but are ignored. The functionality in the codebase grows rapidly with every push, even tests--nay!--specifications are written.

The number of Maven dependencies: 12; build time: 22 s.

3: The phantom menace

IDEs become self-aware and decide to tease the users by showing errors in perfectly valid code. Junior programmers start looking over their shoulders, as if seeing some dark shadow lurking around the build servers. uptime shows negative numbers. IntelliJ IDEA users download the nightly build of the Scala plugin to a separate installation; Eclipse users often invoke the Clean workspace spell. (Some report the spell is more potent when holding down Ctrl+Alt+Shift+Esc+F15.)

The number of Maven dependencies: 22, 5 excludes; build time: 43 s.

4: The implicit monster

Some one|thing has added an implicit conversion from Any to TwitterUtility. The junior programmers immediately add "@cakesolutions".tweet("Interested in losing weight? bit.ly/12f44") to the codebase. Attempts to remove the implicit conversion end with IntelliJ IDEA showing the beachball of death; Eclipse crashes with SIG_SEGV. A Perl consultant is drafted in to fix the problem with a regular expression.

The number of Maven dependencies: 35, 10 excludes; build time: 65 s; and something has poo’d in two versions of the slf4j-api.jar.

5: Bakery of doom

Everyone in the company has come to understand that excess of cake can kill. Like smoking. Or drinking. Which is what most programmers have already taken to to calm their nerves, anyway. What started as a simple experiment in constructing loosely-coupled functional dependencies has ended up in a ball of intermingled traits. Some clever sod has also made the final thing a Spring bean. A @Transactional one, too!

The number of Maven dependencies: 60; 18 excludes; build time: 90 s; somehow, the project now also uses Ivy and downloads the Internet twice to build.

6: The type babel

The team decides to invoke the demons of categories to solve the most complex business requirements before serializing the result to XML and sending it to a network of actors. (Ever tried to rescue a drowning man by throwing him an anvil?) Any errors are now distributed throughout the system and there is only one programmer in the company who understands

trait C[->[_, _], ->>[_, _], F[_]] {
  def fmap[A, B](f: A -> B): F[A] ->> F[B]
}

The programmer who could implement the trait has committed Haskell-kiri. Scrum masters are seriously considering a ritual Kanban sacrifice.

The number of Maven dependencies: unknown (suspect uncountable); the project builds only with mvn clean -Drm-rf=/; mvn package -Dmaven.test.skip=true -Dmaven.please=just-work -Dfile.encoding=MacRoman -Dsbt-version=0.11.1. Also, Maven attempts to use the OS X build of Open JDK 1.7 from time to time.

7. Nothing

Putrefaction: bugs turn into features, threads into sockets, UNIX processes send each other WM_QUERYENDSESSION messages. Managers gladly take calls from recruiters; programmers add “commercial Scala experience” to their CVs.

Keep Calm and use Clojure

Happy April Fools' Day!

Subscribe to Email Updates