Monday, December 27, 2010
Singletons are Pathological Liars
read full story here.
Saturday, December 11, 2010
"The JCP Is Dead" ?
... and Oracle killed it.
By this time, most people know that the ASF has resigned from the JCP EC.
What was posted was our final version of the notice, but I'd also like to share with the community an earlier, rougher and more "emotional" version. It says the same, but in a more face-to-face conversational way. I feel that both versions represent the disappointment, anger and sadness over this whole issue, which has been fostering since 2006. The below just captures it from a different point of view:
Read the full story on Jim's blog
Sunday, November 21, 2010
What's in a Story? [Dan North]
Introduction
Software delivery is about writing software to achieve business outcomes. It sounds obvious, but often political or environmental factors distract us from remembering this. Sometimes software delivery can appear to be about producing optimistic reports to keep senior management happy, or just creating “busy work” to keep people in paid employment, but that’s a topic for another day.
Usually, the business outcomes are too coarse-grained to be used to directly write software (where do you start coding when the outcome is “save 5% of my operating costs”?) so we need to define requirements at some intermediate level in order to get work done.
Behaviour-driven development (BDD) takes the position that you can turn an idea for a requirement into implemented, tested, production-ready code simply and effectively, as long as the requirement is specific enough that everyone knows what’s going on. To do this, we need a way to describe the requirement such that everyone – the business folks, the analyst, the developer and the tester – have a common understanding of the scope of the work. From this they can agree a common definiton of “done”, and we escape the dual gumption traps of “that’s not what I asked for” or “I forgot to tell you about this other thing”.
This, then, is the role of a Story. It has to be a description of a requirement and its business benefit, and a set of criteria by which we all agree that it is “done”. This is a more rigorous definition than in other agile methodologies, where it is variously described as a “promise of a conversation” or a “description of a feature”. (A BDD story can just as easily describe a non-functional requirement, as long as the work can be scoped, estimated and agreed on.)
continue here : http://blog.dannorth.net/whats-in-a-story/
Writing Testable Systems
Writing Testable Systems
— Complex enterprise applications are generally hard to maintain, and risky and difficult to change. As a new developer on a team, a large legacy code base is often difficult to understand, especially when the code has evolved over a long period and new functionality has been grafted onto an existing application.
Test-Driven Development Is Not About Testing
Test-Driven Development Is Not About Testing
— I am always on the look out for good questions to ask candidates in an interview. Not the 'How many oranges can I fit in this room?' kind of nonsense (the stock response to which is apparently 'with or without us standing in it?').
Sunday, August 1, 2010
Thursday, July 29, 2010
Friday, July 23, 2010
I’ve been programming for X years … now what?
You are stuck in a rut and bored.
You still like programming but you need to do something new.
Is this you?
Career development for programmers has always been a sticky subject. The most traditional path is into management, even if the programmer doesn’t have any management skills or interest in management. This leads to disgruntled and bad managers which only aggravates the career development cycle for future programmers.
Some (usually larger) companies offer a senior level technical track, often titled “Technical Lead” or “Software Architect”. The duties are different than that of a manager, but still involves leading other programmers in some manner.
continue here
Tuesday, April 13, 2010
Agile Anti-Patterns - a discussion
1 - End of the day integration
3 - Unit testing the complex pieces is enough
4 - Move the iteration until all the user stories are done
5 - Let us try to do as much as possible during the iteration
6 - Comment the test as it is breaking the build and we will come to it later
7 - Retrospectives are not adding much value, will save time if we skip it
8 - We are doing continuous integration so we are already agile
9 - Most of the user stories are high priority
Monday, April 5, 2010
REST and SOAP: When Should I Use Each (or Both)?
Monday, January 25, 2010
JSR 229 - Dependency Injection In Java EE 6
@Statelessin this example AnotherSerivice is just a simple POJO that injected to MyService.
public class MyService {
@Inject
private AnotherService another;
....
}
@StatelessIf there are more than one implementation for a specific service Qualifiers can be used to specify the target implementation.
public class MyService {
@Inject
@MyQualifier
private AnotherService another;
....
}
@MyQualifier
public class AnotherServiceImpl implements AnotherService {
....
}
@Qualifier
@Retention(RUNTIME)
@Target({TYPE})
public @interface MyQualifier {}
There are five scope identifiers available in the API.
@RequestScopedNamed Objects
class MyBean {
....
}
@ApplicationScoped
class MyCache {
....
}
@SessionScoped
class MySessionData {
}
@RequestScoped @Named("foo")
class MyBean {
....
public String getId() {
....
}
....
}
In the JSP or JSF page you can use the bean by name :
... #{foo.id} ....
Sunday, January 24, 2010
How Pair Programming Really Works
Stuart Wray, from the Royal School of Signals, wrote a paper for the January 2010 edition of IEEE Software Magazine entitled "How Pair Programming Really Works".
In the paper he first brings together the various pairing approaches (journeyman-apprentice / driver-navigator) and identifies a common way of working:
My own experience as a developer using pair programming is that it isn’t just a technique where one person programs and the other person watches. Both programmers work closely together, chatting the whole time, jotting down reminders of things to do, and pointing out pieces of code on the screen. (One of the clichés of pair programming is that if you’re doing it right, your screen should be covered with greasy finger-marks by the end of the day.) Programmers take turns at the keyboard, usually swapping over with a phrase like, "No, let me show you what I mean."
Building on his description of effective pair programming (and identifying that not all implementations of pair programming are effective) he presents four mechanisms that make effective pair programming successful.
Mechanism 1: Pair Programmers Chat
Brian Kernighan and Rob Pike recommended explaining problems aloud, even to a stuffed toy, a practice that John Sturdy called the rubber-plant effect. Part of pair programming’s effectiveness is presumably due to this effect being continually triggered: as one programmer gets stuck, the back-and-forth chat serves to unstick them in the same way as solo programmers talking about their problems out loud.
He discusses the increased benefits that chatting brings about where what he calls the "expert programmer theory" applies - where the members of the pair perceive each other as knowledgeable problems are solved more effectively:
So perhaps this is how expert programmer theory really works: an expert is more likely to ask a deep question, which prompts the novel inference from the stuck programmer. It also seems possible that merely thinking that you’re talking to an expert - or pretending - will help the stuck programmer produce the sort of deep questions that experts have asked them in the past.
Summing up the value of chatting he states:
This first mechanism would therefore lead us to predict that programmers who chat about their programs more should be more productive and that those who pose occasional deep questions for each other should be most productive of all.
Mechanism 2: Pair Programmers Notice More Details
"You don’t see your own mistakes" is a truism of software development (and many other disciplines).
Wray links this to theories of change blindness and inattentional blindness.
What we notice depends on what we expect to see and what we unconsciously consider salient. So, although successful pair programmers will concentrate mostly on the same things, they might notice different things.
So, two people programming together won’t have the same prior knowledge or categorization: one will presumably spot some things faster and the other different things faster. Where their rate of working is limited by the rate they can find things by just looking, two heads must be better than one. And in fact, one of the earliest observations that people make when they start to pair program is that the person who isn’t typing code always picks up typos quicker: :Oh, you’ve left out the comma here."
He goes on to warn about the phenomenon of pair fatigue: When two programmers pair together, the things they notice and fail to notice become more similar. Eventually, the benefit from two pairs of eyes becomes negligible.
Pair Fatigue is a driver for rotating pairs regularly:
Some pair programmers regard rotation as an optional part of the practice, and on a small team, or with few programmers willing to pair, there might be little alternative. However, pair fatigue means they’ll ultimately be much less productive.
Mechanism 3: Fighting Poor Practices
Peer pressure not to slip into bad practices is a clearly identified benefit of effective pair programming.
He discusses the example of "code-and-fix" programming and links it to the addictive nature of slot machine gambling:
This is the special property of interactive programming that makes it difficult to do the right thing. With code and fix, we tinker haphazardly with our programs, effectively putting a coin into the slot machine each time we run our code. Slot machines are known as the most addictive form of gambling, and the similarly unpredictable rewards from code-and-fix programming mean that it could be equally addictive.
Pair programmers might be less susceptible to poor practices because they can promise to write code in a particular way and ensure that each other’s promises are kept. The prevalence of two-people working in jobs where human fallibility is a serious problem should lead us to seriously con¬sider that pair pressure might be the solution for us, too.
Mechanism 4: Sharing and Judging Expertise
The productivity differences between individuals are vast, measured to be at least a factor of 10. This often means that estimates of difficulty and time are inaccurate. This applies to both good and bad programmers - you can only determine someone’s programming capabilities by working closely with them.
Most programmers work on problems on their own, so no one knows how good (or bad) they really are. But with pair programming, people continually work together. Because they keep swapping pairs, everyone on the team learns who’s the most expert at particular things. From this comparison, they also realize their own level of expertise. We should therefore expect more accurate estimates of time and difficulty by a pair programming team than from a solo programming team. From my experience, this does appear to be the case.