Bash: Parse Options And Non-Options With Getopts
getopts
Continue reading →
Bash Magic: List Hive Table Sizes in GB
sudo -u hdfs hadoop fs -du /user/hive/warehouse/ | awk '/^[0-9]+/ { print int($1/(1024**3)) " [GB]\t" $2 }'
Continue reading →
Fast Code To Production Cycle Matters: For Pleasure, Productivity, Profit
Continue reading →
My 2012 in Review
This has been my second year in Norway and I am still very much enjoying it, there is a very active developer community organizing great conferences such as JavaZone (followed by an amazing trip to the nature a.k.a. SurvivalZone) and Smidig (Agile) where I have also presented, Scala-focused flatMap, many meetups etc.
Events & side jobs
Thanks to my company I had the opportunity to do some real consulting work, namely helping with a technical audit of an R&D department and co-organizing a TDD and refactoring workshop for the customer, and I have learned a lot from both of these.The most exciting event was a week long educational stay with Ken Beck that has resulted in the most popular blog post ever of my company and myself, Programming Like Kent Beck. Another exciting event was the workshop BDD - Specification by Example by Gojko Adzic, simply the best workshop/course I have ever attended, with plenty of valuable content about how to build the right software. I also very much enjoyed preparing and presenting an introductory workshop into Clojure with my friends and collegues Lars and Ivar.
Continue reading →
Blogging Stats of 2012
Continue reading →
Most interesting links of December '12
Recommended Readings
Software developmentContinue reading →
What Is Clean Code? - In Quotes
Continue reading →
Most interesting links of November '12
Recommended Readings
- James Roper: Scaling Scala vs Java (recommended by M. Odersky) - writing scalable apps in Scala is much easier then Java because idiomatic Scala uses immutable structures and lends itself naturally to asynchronous processing while doing these things in Java is possible but very unnatural and laborious. "It [Scala] is biased towards scaling, it encourages practices that help you scale."
- Exception Handling Antipatterns (2006, still valuable) - Log and Throw, Throwing Exception (instead of a suitable subclass), Throwing the Kitchen Sink (declaring many exceptions in method signature), Catching Exception (instead of a particular subclass), Destructive Wrapping (not including the exception as cause), Log and Return Null, Catch and Ignore (swallowing the exception), Throw from Within Finally, Multi-Line Log Messages (via repeated log calls instead of \n), Ignoring InterruptedException (instead of breaking the loop etc.), Relying on getCause().
- The GitHub way: Your team should work like an open source project - a provocative article about the development process in GitHub that strongly prefers asynchronous and on-line communication over face-to-face meetings and communication, which, according to the author, leads to increased productivity. That is quite the opposite of what is usually practiced. I can think of situation where direct interaction is invaluable but, on the other hand, I could certainly live with less meetings. (Comments on Hacker News)
Continue reading →
Most interesting links of October '12
Recommended Readings
- David Veksler: Some lesser-known truths about programming - things newcomers into the field of IT don't know and don't expect, true and an interesting read. Not backed by good data but anyway. F.ex.: "[..] a programmer spends about 10-20% of his time writing code [..] much of the other 90% thinking, researching, and experimenting". "A good programmer is ten times more productive than an average programmer. A great programmer is 20-100 times more productive than the average [..]" "Bad programmers write code which lacks conceptual integrity, non-redundancy, hierarchy, and patterns, and so is very difficult to refactor." "Continuous change leads to software rot, which erodes the conceptual integrity of the original design." "A 2004 study found that most software projects (51%) will fail in a critical aspect, and 15% will fail totally."
- Brett L. Schuchert: Modern Mocking Tools and Black Magic - An example of power corrupting - interesting for two reasons: a good analysis of a poorly written piece of code and discussion of the code injection black magic (JMockIt) vs. actually breaking dependencies to enable tests. The author presents a typical example of low-quality method (mixing multiple concerns, mixing different levels of abstractions, untestable due to a hardcoded use of an external call) and discusses ways to improve it and to make it testable. Recommended to read.
- It’s Not About the Unit Tests - Learning from iOS Developers: iOS developers don't do much testing yet they manage to produce high quality. How is that possible? The key isn't testing itself, but caring for the code. (Of course, iOS is little special: small apps, no legacy, a powerful platform that does lot for the apps, very visual apps.) "It’s not about the practices. It’s about the spirit and intent behind them, and how they are applied." (M. Fowler had a similar observation about a team that used mock-based testing exclusively and thus lacked integration tests yet all worked. [I've lost the link to the post and would be grateful for it])
- Java Code Quality Tools – Overview - brief descriptions of 44 quality-related tools including some interesting tools and Eclipse plugins I didn't know or knew but forgot. F.ex. analysis of dependencies with JBoss Tattletale or JarAnalyzer, Clirr to check libraries for source and binary backwards compatibility, JDiff generates JavaDoc-based report of removed/added/changed in an API. Spoon - read and check or transform Java code. Java PathFinder (NASA) - special JVM capable of checking all execution path to discover concurrency defects etc.
Continue reading →
Do You Know Why You Are Testing?! (On The Principles Underlying TDD)
Continue reading →
Tip: Import Leiningen Project to IntelliJ (With Dependencies)
Continue reading →
Puppet Troubleshooting: Compiling Catalog, Locating a Cached Catalog
Where to Find the Cached Catalog On Client
Continue reading →
Tool Tip: Byob - Screen With Text UI
Continue reading →
My Scala vs. Clojure Impression In Pictures
(By kristobalite) Clojure: Clean Structured Focused | (By agiamba) Scala: Adorned Overflowing Magnificent |
Continue reading →
Note: Loading Tab-Separated Data In Cascalog
Continue reading →