5 ms·
The OP wasn't re-writing them. Instead the OP fed the old version into a tool (Disassembler) which spat out terrible source code, worse than the original with
by gridspy 5y ago
The OP wasn't re-writing them.
Instead the OP fed the old version into a tool (Disassembler) which spat out terrible source code, worse than the original with no comments and bad variable names.
This was the only way to get source at all.
Then they made the disassembled source compile in a really nice way.
Finally the boss asked them to make huge changes to this horrible source with time pressure.
- AmericanChopper 5y agoPretty much this. A lot of the work would have been roughly equivalent to trying to de-minify some JS. With a modern IDE the task would have been a lot easier. I don’t know if Eclipse had refactoring assistance built into back then, but if it did, I’d never even heard of the idea. I was sitting on not much more than a year of programming experience at the time.
- Someone 5y agoTextually comparing disassembled code variants can be complicated because the disassembler might/will generate different names for locals. Because of that, a better approach might be to compare the byte codes of the variants first to find out in what classes the variants differ. Then treat the different class files as source code until you need to change any of them (so, variant 1 has foo1.class, bar.class, and baz.class, variant 2 has foo.class, bar2.class and baz.class, etc). Don’t immediately try to clean up their code, but ‘just’ try to figure out what they are doing (for many of them, that, hopefully, can be done from function names)