Profile cover photo
Profile photo
Jeff Grigg
Jeff Grigg's posts

Post has attachment
Jeff Grigg commented on a post on Blogger.
Hasn't this refactoring broken the existing code?

In ChangeProcessingHandler, I see this:
public CodeDelta triggerProcessingChangeOf(Code code, Change change)

But in ChangeProcessingHandlerRefactored, I see this:
public void triggerProcessingChangeOf(Code code, Change change)

The triggerProcessingChangeOf method no longer returns the CodeDelta type. I'd be inclined to think that there would probably have been some good reason for a "Change" on "Code" to return a "CodeDelta". But now it's gone.


Post has attachment
Jeff Grigg commented on a post on Blogger.
I agree 100% with the code smell. But I think you make the "fix" more complex than it needs to be.

Why not just add a "CodeDelta process(Code code);" method to the Change class?

Then the Growth, Improvement, and Refactoring must implement it. Move the contents of the three local "process<ClassName>" methods to the corresponding classes, and replace all the "instanceof" logic with just "return change.process(code);".

I would also consider moving refactoring the "verifyChangeOf(code, change);" method into the "Change" classes. So one probably needs to introduce an abstract base class between the Change interface and the subclasses, implement the "process" method in it (and make it final), add some new abstract method that this new method can call after it calls "verifyChangeOf(code, change);".

And then... Ask why the ChangeProcessingHandler class exists at all. At this point, it's probably useless. (Inline the "triggerProcessingChangeOf" method into its callers.)

Post has shared content
This could be inspiring.
It's my dream for the future of human race but in this time I don't belive in it.

Post has shared content
Honestly, the weather reports are often "off," often wrong. Sometimes way off. But still... "Off" about 30% of the time is one heck of a lot better than pretty much always wrong about every claim and prediction for over 2000 years.
Improved Christian Memes: 2000 years of not showing up, but somehow tomorrow is different?


Post has attachment
Jeff Grigg commented on a post on Blogger.
It bothers me that an "enable" operation takes a complex class/object parameter like that. I tend to think of "enable" as something that would set a boolean flag to true. So what's the rest of the object used for?

Maybe "register" would make more sense, particularly for something that receives callback notifications. And this opens up the possibility of there being more than one. And of a "deregister" operation.

Post has shared content
Now this is profound.    :-/
Linked lists, a data structure so simple that they're basically impossible to mess up, right?

Post has shared content
Interesting and educational.

(It shows what sunscreen can do for you!)

Post has shared content
Wow.  This is crazy.

Sure, there's a minor "trick" to it.  But doesn't anyone know how to do math these days?!?!?

Post has attachment

Post has attachment
Catchy tune.  ;->
Wait while more posts are being loaded