Sunday, December 23, 2012
Saturday, December 22, 2012
Using Java’s reflection for testing private methods
Groovy is the dynamic language syntax for Java. As such, it can interact pretty seamlessly with
Java code (including compiled byte code), allowing you much more flexible syntax. You can invoke the standard reflection mechanism in Java using the Groovy syntax as shown below.
Ship Vasa
In 1625, King Gustav II Adolf of Sweden commissioned the finest
warship ever built. He hired the best ship builder, grew a special forest of
the mightiest oaks, and started work on the ship Vasa.
The king kept making requests to make the ship grander and
grander, with ornate decorations everywhere. At some point, he decided that he
wanted a ship with two gun decks, unlike any in the world. His ship was going
to be the most powerful in the ocean. And he needed it right away because of a
diplomatic issue that was popping up.
Of course, the ship builder had designed the ship with only
one gun deck in mind, but because the king asked for it, he got his extra gun
deck. Because they were in a rush, the builders didn’t have time for “lurch”
tests, where a group of sailors would run from one side to the other to make
sure the ship didn’t rock too much (in other words, wasn’t too top heavy).
On the inaugural voyage, the Vasa sank within a few hours.
While adding all the “features” to the ship, they managed to make it
unseaworthy. The Vasa sat at the bottom of the North Sea until early in the
20th century, when the well-preserved ship was raised and placed in a museum.
And here is the interesting question: whose fault was the
sinking of the Vasa? The king, for asking for more and more features? Or the
builders, who built what he wanted without vocalizing their concerns loudly
enough? Look around at the project on which you are currently working: are you creating
another Vasa?
Little things that can make you a productive programmer
- Launchers that allow you to type the first part of the name of an application (or document) to launch it.
- VI editor that allows mouseless editing.
- Auto completion
- Clipboads. Allows to copy multiple things before pasting begins. Prevents context switching
- History in command line
- IDE shortcuts
- Most used icons on the top of screen
- Switch off email notifications
- Have an official quite time at office
- Search over navigation
- Know find commands
- Rooted views
- Multiple monitors
- Virtual desktops
-The Productive Programmer by Neal Ford
What can Galileo teach a software engineer?
One of the great rebels of history was Galileo, who apparently
didn’t believe anything that anyone told him. He always had to try it for
himself. The accepted wisdom before his time maintained that a heavier object
would fall faster than a lighter one. This was based on Aristotelian thinking,
where thinking hard about something logically had more merit than
experimenting. Galileo didn’t buy it, so he went to the top of the Leaning
Tower of Pisa and dropped rocks. And fired rocks from cannons. And discovered that,
nonintuitively, all objects fall at the same rate (if you discount air
resistance).
What Galileo did was prove that things that seem
nonintuitive can in fact be true, which is a valuable lesson. Some hard-fought
knowledge about software development is not intuitive. The idea that you can
design the entire software up front, and then just transcribe it seems logical,
but it doesn’t work in the real world of constant change.
-The Productive Programmer by Neal Ford
-The Productive Programmer by Neal Ford
Subscribe to:
Posts (Atom)


