My frustration with programming is most probably derived from the multitudes of ways to do things that are out there. It’s choice that’s stifling me. I know how to do "something" in Java, but it’s inefficient and takes too long. Converting a .NET generated binary data file from hex to float, for example: Big-endian or little-endian? How about making a UI for testing purposes? The same issue with Ruby is one line, but there’s no Ruby in my paid-work; only Java. Spin. Or, really, maybe I don’t know how to do things in Java. Again, spin.
Java’s Integer object has a MAX_VALUE on it that’s smaller than what the primitive int can hold. Also, long is 64 bits, and float’s 128, so, for my purposes of converting an unsigned int from hex to float, I can’t really use Long, either, but I will. Sorry extra Microsoft data. Or, in Java, does the data lose you?
The answer, of course, is that I should choose to just *know* the restrictions of each language and not be frustrated when the API documentation says "do this and things'll happen (caveat: read the design guidelines)." And that's the problem with software. No, I really, really shouldn't have to know the useless jank of languages.
make little-endian .NET bytes into big-endian ones, convert to hex string...
int i = new Long(Long.parseLong(hexString.toUpperCase(), 16)).intValue(); // yes, two Longs make an int
Ruby did it in one line, .NET has methods in their BinaryReader to generate primitives from source bytes with one call, and, sadly, Java's ByteArrayInputStream is inadequate.
But really, who cares, anyway?
"Writing" code is crap. Especially the way I've been doing it for the last few years, which is predominatly fixing other people's poorly written and even more poorly documented stuff. It's classic janitorial scut. In addition, there's this whole open source trend to use the latest shiny thing. This means I have to know wtf about the shiny thing to fix it. It's never one or two new things to learn and learning about those things is never in isolation. It's dreary work to learn the combinations of new things knowing that people will continue to splatter random bits together and think they're the new hottness. It's not software "progress" that's got me irritated - I'm all for software progress, I actually enjoy learning the new spit-shined pieces of crap open source idiots think up so that they don't have to actually do any work - it's that the inanity is considered professional. Who's going to use this stuff and who's going to make it better? This is an expensive, throw away, one-off business, no matter how excited the guy telling you about it is.
Here's the manifesto for Prototype Designs, an Athena-from-my-hed company: The only product is one-off easily modifiable projects for corporations to show proof-of-concept so that they can then spend the big bucks on trying to implement a "real version." In my experience, the world lives, breathes, and commerces on prototypes anyway, this company would just be honest about it.
Spent the better part of a day looking into how to include Eclipse's .classpath file into an Ant build.xml classpath w/o having to retype, copy it, or whatever; in other words, trying to keep Eclipse's build in synch with Ant's build. Ends up, the easiest way is to simply define properties to the paths, then include those in the path definition. Silly, really. There appear to be ant task add-ins [
1,
2] for Eclipse, but for what I was doing, they were overkill. I'll have to look into them later.
In order to get Eclipse's Ant build to work, I did have to do two things:
- <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
- Have Eclipse's Run->Ant Build..., JRE run the same JRE as the workspace