You know, we all considered "data class" to be a code smell (if not an antipattern) for a long time.
Generally, I still see it as being a flaw, but the world has changed a bit.
XML docs are essentially data classes.
JSON docs too.
Someone in the Java camp decided it's easier to have dumb data classes for Hibernate & the like to work well, so people have gotten used to having dumb data classes and separate methods - just like old "structured BASIC" code.
And, of course, non-OO languages tend to separate code and data anyway and sometimes that is helpful and good.
It still looks like a code smell in the Java case and in cases not covered here (XML/HTML/JSON, db queries, etc). Most of the time having one class with three variables and no methods, and another with methods and no variables ... it's def not OO.
But you know, at the interfaces (again, JSON, etc) it is useful to have documents instead of full-blown objects, and I'm not sure all us OO people ever said anything about it.
But then smells are heuristics, and not certainties of malfeasance. Having a code smell can be different than having a design problem.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
What does software development look like from the outside?
I request N things. A few of them come out months later.
Hence: these programmers need to work faster.
1/
however, each of the N things really only took about 4 days to complete on average. Working 2x as fast (a dubious prospect) would carve off only 2 days from delivery time.
2/
What you don't see is that the work was delayed, prioritized, queued up behind dozens or hundreds of other bits of work, rejected and reworked, queued up some more, approved, and then batched up with a bunch of other work while it waited for a few more things to finish.
3/
Test first - red.
Oh, I don't like the way that message reads.
Ah, better.
Code - not green?
Quick, most obvious solution.
Still not green.
Oh, why didn't that work?
Was it the test or the new code?
AH! It's the new code. Okay...
Green.
Refactor: I don't like how I structured that test.
Still Green.
The code has some funny names in it. Rename.
Still Green.
Oh, crud, there's a library function for that.
Revise.
Still Green.
Okay.
A: Why do you use a ticket tracker?
B: We have thousands of backlog entries.
A: wait... what? Why? How does that help?
B: If we don't store them, we may forget.
A: if you have a list of thousands, you'll remember them all?
B: No, but if we review it we can see that we stored them and might pull them into the sprint.
A: How often do you do that?
B: We don't, there's always too much new work.
A: Okay, so you store them in case you ever run out of new work to do and need to pull something old and forgotten into the sprint.
B: Well, yes, and so we can tell people it's in the backlog.
Sometimes you cannot plan. This is either because of the prevailing circumstances (chaos, complexity, extreme complication, dependency) or because you just don't know how.
In those cases, you set an intention and take advantage of opportunities.
At the end of the road, looking back, an excellent opportunist or an exquisite planner will not only have the same results, but their paths are indistinguishable.
Everyone thinks people reach their goals through exquisite planning and flawless execution, but (truth be told) it was largely intention & exploited opportunity.
“How long does a 2-point story usually take?”
“We peg story points to half-days so 2 points is one day.”
“Yes, how long does a 2-point story usually take?”
“One day.”
“Historically, or ideally?”
“One day.”
“Most of the features you released are over 40 days old.”
“But, um….”
“So 40 days is more than one day, right?”
“Yeah, but the coding part only takes one day.”
“Are you sure. Did you check the actuals on that?”
“No, but they are estimated for one day, so it’s got to be pretty close.”
“But is it?”
“Now that you mention it, no.”
“So how do you know?”
“Well, we always fail our sprints by coming in short. We need the developers to work faster.”
“Work faster so that the estimates become true?”