November 26, 2011

SE: The house

Burndown to hell

Some basic but very useful burndown chart we used for building a house model.

November 13, 2011

Object Calisthenics

Yet again I come here to share something learned from very smart people. Initially when I saw these rules my head exploded. Even though they are reasonable rules, they break the traditional non-object-oriented I've been doing for a while.



  1. One level of indentation per method
  2. No else keyword
  3. Wrap all primitives and strings
  4. Use only one dot per line
  5. Don’t abbreviate names but keep them short
  6. Keep all entities small
  7. No more than two instance variables per class
  8. Use first-class collections
  9. Don’t use any getters/setters or properties
I'm still trying to wrap a prototype project around them, and the partial results are astonishing.

Sources

November 4, 2011

Software Architecture, lessons learned

There are very good developers, that can create great products out of nowhere without thinking too much. Well, I'm not one of those, it takes me a while to get the right idea, and several times I had to throw everything I've bee working on and start from scratch.

But even in situations like these, there are some things you learn from time to time.


Minimalism

This is something I learned from Robert Martin's Clean Code (but I think it just takes common sense). When your components are not meaningful and don't relate to each other in an almost 'natural' way, you need to refactor it. Your system might work beautifully, but your internal structure is a mess and it will create problems to future maintainers.

Keep it simple

Complex design leads to complex code, complex code leads to complex tests, and the mess has now started. The design has to be as simplest as possible, and your code has to be consequent to this. And by code I mean production code and the test units related, because that it's maintainable code too!. Check KISS Principle on Wikipedia.
 

Life time

System components and inner objects must follow the natural law, die. While shorter your objects live the better, are easier to handle, to test, and to refactor. Including memory usage improvements, as your objects are created and dropped as soon as they are used. This is something I find very useful, and I discovered by playing around with Google's Guice project.

Patterns

Check the patterns once a while, review your architecture, don't reinvent the wheel. There are several good references for it, but I tend to enjoy Martin Fowler's patterns (and the articles describing them). Have a look at the LMAX architecture.

November 2, 2011

Ubuntu usage report: 2 months after

So far I've been using Ubuntu as my laptop's system for two months, did a lot of things with it, including serious applications development.

For doing it so, I performed several package installations and system configurations, including very low-level scripting and server-oriented configurations.



Considering everything I did, this are some things I find very useful in Ubuntu:
  • Package management system, this is perhaps its most obvious feature, it's really simple to install any package present in a repository.
  • User experience, this is also something very well worked. The system is built to make user's life as simple as possible,
  • Boot speed, it makes the difference.
  • Security updates, very robust updates that don't break anything.
  • Software center, a huge amount of software applications available for simple click-installations.
  • Huge community, it's perhaps the biggest Linux community I've ever seen.
But, it has some things that can get potential users away of it:
  • Dependency hell, do you mean I have to install the entire open-jdk stack if I want to install Maven? even if I already have sun-jdk installed?
  • User constraints, if you touch some system configurations that Ubuntu is keeping track of, you are going to have problems.
  • Configuration complexity, Slackware is a heaven compared to this.
  • Imposition, once you update the distribution, you will get your beloved desktop replaced by an awful Unity desktop.
  • Unofficial packages, I had very rough moments try to install something Ubuntu doesn't support, I ended up compiling all the custom software I required.