Created
July 7, 2011 08:46
-
-
Save pavel-drabushevich/1069118 to your computer and use it in GitHub Desktop.
Java is bad Lisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Document doc = document( | |
| keys("comments"), | |
| values(asList( | |
| document(keys("content", "date"), values("test1", date("14/01/2011"))), | |
| document(keys("content", "date"), values("test2", date("12/01/2011")))))); | |
| Of cource it was refactored to: | |
| private Document comment(final String content, final String dateStr) { | |
| return document(keys("content", "date"), values(content, date(dateStr))); | |
| } | |
| Document doc = document( | |
| keys("comments"), | |
| values(asList(comment("test1", "14/01/2011"), | |
| comment("test2", "12/01/2011")))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment