billroper: (Default)
2020-08-19 10:30 pm

Don't Write Inefficient Code

Don't Write Inefficient Code.

This suggests, perhaps, that I have watched too many episodes of "Don't" during the pandemic. However, I spent the afternoon cleaning up some really inefficient code in one of our modules this afternoon. I'm not sure exactly how much impact it will have -- we'll know more about that when it gets into testing.

But it will help. I had explained much earlier how to make at least some of these fixes. They were never made.

Until now.

Don't. Write. Inefficient. Code.

*sigh*
billroper: (Default)
2020-05-26 10:05 pm

And Back To Work

Three day weekend over, so it's time to be back at work.

I made some progress today (and cleaned up a few lines of questionable code in my own area, just so you understand that I make mistakes). Unfortunately, a lot of the other stuff that I was looking at needs some refactoring, which turns it from "fix a bug" into "this is a project".

I do not need another project right now, especially in code that I'm not that conversant with.

We'll see how it goes.
billroper: (Default)
2020-05-21 09:53 pm

Refactoring

This afternoon was spent refactoring someone else's code. I think it's helped, but I need to find out where the other bottlenecks are hiding. Maybe they'll turn up tomorrow.
billroper: (Default)
2020-05-20 10:57 pm

Waiting For Godot

I am jammed up waiting for things on my various projects, so I went to fix SpotBugs errors today in between meetings. I fixed about 10% of the outstanding warnings, although half of that total was in a single file and fixed with a global search and replace.

Even so, it's progress.
billroper: (Default)
2020-04-08 11:50 pm

Code Reviewing

It's hard to code review a merge between two branches that changes as many files as this one does.

It *looks* ok.
billroper: (Default)
2020-03-24 05:21 pm

The Hurrieder I Go

At work today, I set out to fix a bug on my bug list. While I was working on it, I found a small bug that was preventing me from testing the fix, so I fixed that. I also found two other annoying bugs that I wrote up as new bugs for the appropriate people to fix.

Net bug score: one bug removed from the list, one other bug fixed without ever hitting the list, two bugs added to the list. bugCount = +1, although xBugCount (which is a more accurate version of the statistic) is 0.

No wonder we never catch up. :)
billroper: (Default)
2020-03-10 10:27 pm

Push That Code!

I checked in a new set of APIs at work that substantially clean things up in the project that I'm working on.

Sadly, they are -- unsurprisingly! -- not at all compatible with the old APIs that someone else on the team wrote. This will mean a certain amount of retrofitting is required.

But when it is done, it will be better.
billroper: (Default)
2020-01-07 10:05 pm

C# Dressed Man

For someone who doesn't actually know C#, the port of this chunk of my code from Java to C# is going quite well. I think that I'm likely to finish the whole thing up tomorrow unless something goes horribly wrong.

The biggest chunk of time was spent sorting out the differences between a Java iterator and a C# IEnumerable interface. Other than that and a few scoping issues, things are going pretty well.

We'll see what happens next. :)
billroper: (Default)
2019-08-21 10:11 pm

Warning! Warning!

I decided to take some time this afternoon and take a look at the warnings that the static analysis tool in Visual Studio is throwing for one of our C# modules. Most of them are harmless, although some of the (mostly) harmless ones are worth fixing. Some worry me and they are *definitely* getting fixed.

And then I'll test this thing and make sure that it is behaving. :)
billroper: (Default)
2019-08-13 10:42 pm

Localize Me!

I have patched the Polish language into the C++ code (as patching localized languages into the C++ code is complex), while I have patched all of the new languages into the C# code. The rest of the work on the C++ side is being left as an exercise for another programmer. I was, however, kind enough to write documentation telling how to do it. :)
billroper: (Default)
2019-04-15 10:54 pm

Back to Work

I am back to work and -- in and around a lot of meetings -- am continuing my spelunking expedition through some code that I am fixing up. After sufficient inspection of a routine, I can usually remember what it is *supposed* to do. Then I need to see if it's actually *doing* that. And then I need to make it work with the changes that I'm making. All this is very entertaining. And just a bit exhausting.

Today, I stared at three complicated if statements and the code within and rearranged them so that there was slightly more code and fewer if statements. It is remarkable how much more clear the code became. It's still not quite *right*, but I have written comments to indicate what the code is *supposed* to do and -- after I get done with it tomorrow -- that is what it will be *doing*.

This is *way* more work than it should be.
billroper: (Default)
2019-03-26 10:23 pm

Refactoring

So I'm working on a project at work where I'm porting some more C++ code to Java. I looked at the original code and said, "Well, let's see if we can streamline that." And I wrote a set of classes to support the behaviors that I wanted and which would generate the XML that I needed that C++ had been handling by writing exquisitely hand-crafted XML.

And I looked at the classes and said, "That could be simpler." And so I refactored the class structure I had written.

And I looked at the classes and said, "That could really be simpler." And I refactored the class structure into a set of Java enums.

It's a lot simpler now. :)
billroper: (Default)
2019-01-27 12:12 am

Problem Solved

Oh, it *does* look like I solved the problem at work yesterday.

Today, I took a few minutes and deleted the fossil code from the old version of the project that I'm working on. The file went from 2900 lines to 900 lines. So the new code is less than half the length of the old code. Of course, I *did* push a couple of things out to other classes, but even so, it's substantially cleaned up.
billroper: (Default)
2019-01-25 10:59 pm

Number Crunching

I have almost solved the various problems at work that are keeping my new code from working properly. I *think* that one of the failed attempts managed to leave some flags set that prevent the calcs from executing, so I am now *clearing* those flags to see if that fixes the last problem.

I hope it does, because otherwise, I am running short on ideas.

Mind you, I *saw* that one of those flags was set while watching in the debugger, so I am reasonably optimistic that I have found a problem.

The question is: Have I found *the* problem?

We'll see.
billroper: (Default)
2019-01-09 10:26 pm

Up the Lazy River

The problem when you have long-lived branches in Git (or, I presume, pretty much any version control system) is that you need to keep them updated so that the source code there vaguely resembles what's on the main line. When there's any substantial velocity on the main line, it's worse.

It's worse.

I have two different branches that I've had to do major projects on that I haven't been allowed to merge back to the main line. One of them I hadn't done any work on since early November, which was the last time that I updated it from the main line.

Today's merge took well over an hour as I tried to reconcile the changes and it *still* won't compile correctly.

And now I have an email that says that the *other* branch needs to be updated.

Which is why I keep saying that we need to merge these things.

(We have one branch that is over a year old, because the work I did there hasn't been merged yet. Eek!)
billroper: (Default)
2016-07-26 05:44 pm
Entry tags:

Refactoring Blues

A while back, in order to improve the general behavior of my code in the Java environment, I changed a place where I was storing hot pointers to store IDs that could be used to look up the hot pointers instead. And the behavior became much better and cleaner.

Today, I realized that the behavior might be cleaner, but any "rename" operation on the objects that were referred to by the IDs was going to fail. See, when you're storing hot pointers, you can just rename the IDs that are internal to the objects that are being pointed to. When you are storing IDs, you have to find all of the objects that are storing the IDs and update them.

Phooey.

The C++ code is now updated; the Java code will follow shortly.

At least I found this myself...