Posts

Naming is still hard.

Ideally, we would have excellent and obvious names for all variables, classes, packages, methods, etc. But it's hard to be excellent all the time. People building the java libraries struggled with names, I can tell, and though I don't always appreciate their choices I recognize that this is a multifaceted problem. Maybe a moment of agonizing over a bad name might help share a mental model, and some patterns or smells for naming methods. Let's give it a shot. A Tiny Example Here is a tiny, dull, dumb snippet:  Date now = new Date();  DateFormat df = DateFormat.getDateInstance(LONG, Locale.FRENCH);  System.out.println(df.format(now)); Java has a method called getDateInstance() . Does it return an instance of a date? No, it does not. If it lived in a package called Date then it would be a terribly wrong name, but it doesn't live there. It returns an instance of a date formatter, whose class is called DateFormat. DateFormat doesn't seem like such a...

Sarah and Joe Write Features

I wrote a question for the twitterverse: I assigned a story each to Sarah and Joe. Joe's feature made the company 4x as much as Sarah's, so Joe is the better programmer, right? — Tim Ottinger (@tottinge) February 10, 2016 Give that question a moment's thought and tell me what you think as a knee-jerk reaction. About Joe and Sarah Of course Joe and Sarah are fictional characters. No this isn't a gender question. I thought it would be wrong of me to pick two female names or two male names. I figured that there is really no way that I am going to get out of this without answering to questions (or charges) of gender bias no matter what I do, and so I decided to pick two names roughly at random. It didn't dawn on me that they're both European/American kinds of names until later -- so bias is probably real there. But what if one was an Indian name and the other Chinese? I can see that having all kinds of issues too. So I have two names, and please ...

Naming good is what Position?

I want to drop in a quick note about variable and class naming, one of my favorite hobby horses. I talked a little bit about choosing more completable names already. I think that is very important, and you would be well-served by paying attention to that bit. Today let's consider the serial position effect . In any programming namespace, we're going to come across some naming issues. Here is a non-comprehensive, non-exclusive list: Objects with a common base will want to include the base class name in the derived class, leaving us with MonoNUnitTestRunner derived from NUnitTestRunner derived from TestRunner , possibly breaking naming in its derivation from CodeEvaluationRunner and on and on. Objects in languages with declared interfaces have a tendency to want to declare the interfaces in their names. An iUserAction will have a UserActionImpl in many cases, whose children may follow the prior rule above.  People love naming the patterns they use in implementing an ...

The Productivity Formula

Productivity is clearly some kind of ratio; it is some kind of N:M relationship, but it's hard to know quite what the N and M are. Of all the poor ways one may define Productivity for software developers, there are some really horrible formulae including "lines of code per developer" and "story points per iteration", measures which really measure all the wrong things and which might send Charles Goodhart into a tizzy. Rather than rant more on those, let's cut to the chase and give the definition that most people really use: (what you did) ---------------------------- (what I wanted) You see, management is really not a data science. It is generally practiced as a semi-educated gut feel, because most managers in software organizations are really programmers risen through the ranks. Maybe 1/3 of them have studied computer science (judging by the popularly quoted folk-statistic that 30% of people work in the area of their college major).  M...

Plate-Emptying

Image
Over at Reddit  there is a discussion about my Stop Per-Person Swimlanes article at Industrial Logic . This surfaced what seems to be a common misunderstanding. Some people think that the board was designed to facilitate public shaming. It's to motivate members in a team to work harder. When your personal progress and responsibilities are put on a clearly visible chart somewhere it's a bit different than a sea of todo's some of which are labeled with your name.  There are a lot of answers, agreeing or disagreeing (mostly disagreeing).  This one stands out: It's different. Whether it's a good thing or a bad thing is EXTREMELY unclear.   My take is that in most corporate environments that is a BAD thing. Why? Because, rather than thinking about the overall health of the code, coder's main concern is getting that ticket closed [emphasis mine - tro] .   Which is a very straight path to the quick codebase degradation.   Meanwhile, your v...

What is "enterprise"

Gathered answers:  A for-profit concern. Involving strangers (you can't know and care about 5000 people individually) Using low-cost "resources" Involving huge budgets Pyramiding Multisite, with considerable offshore work Having a long-entrenched industrial-age culture Using fungible "resources" so staffing can be "re-balanced" easily Having strong central control (seeming necessary when working with strangers?) Having many teams contributing parts which share an architecture Having many interdependent projects, with independent teams Having a strong identity/culture ("unchangeable self" fallacy) Having promises outstanding in the form of multiyear "roadmaps"  Essentially waterfall view of software  Law of 2nd floor -- nobody 2 levels above or below you knows what you really do for a living. Essentially addicted to using brute force (large numbers) to solve problems. Having complicated budgeting processes with...

Dot-Programming your Object Oriented Code

Image
I was once told to "exalt the obvious." There is a power in it, because sometimes we overlook obvious things that are blessings to us and can reshape our world. This, I think, is one such. 'Way back in the 80s and 90s we were trying to get people to practice Object-Oriented Design and Object-Oriented Languages were gaining a bit of ground. Heck, in '86 or so C++ started to be a big deal, because it mixed some OO with our beloved C. Soon we saw semi-OO BASIC and even a version of Object-Oriented COBOL. Wow. We tried to codify principles and practices that helped people to do good design. You probably followed all the great stuff we did at Object Mentor, led by Uncle Bob Martin (who I still appreciate and respect, though we don't see each other very often). We expounded on coupling and cohesion, as well we should, but we lacked the mechanism in our programming environments to help us really seat the idea of OO in the minds of our fellows. Serendipity We...