4 ms·
I once worked with a true 10x programmer. The guy used C++ metaprogramming to avoid boiler-plate code. Any by "used" I mean he needed the best preprocessors a
by cm277 3y ago
I once worked with a true 10x programmer. The guy used C++ metaprogramming to avoid boiler-plate code. Any by "used" I mean he needed the best preprocessors and compilers at the time to just write his code. He once single-handedly porting our >1m LOC codebase to Java over a weekend (admittedly, a 3-day weekend, but still).
When new people asked him if he knew C++ his standard answer was "I know enough to know I don't know C++".
- ZephyrBlu 3y ago> He once single-handedly porting our >1m LOC codebase to Java over a weekend How do you even physically do that? Generous estimate: 1M LOC 18hr days * 3 = 54hrs 1,000,000 / 54 ~ 18,500 LOC/hr There must have been a lot of help from automation here or you had an enormous amount of boilerplate code, because otherwise I don't understand how this is even possible.
- flohofwoe 3y agoIME a lot of real-world 'enterprise quality' million-line code bases only have a few thousand lines of actual functionality in them - if at all (take a typical Java or Java-style C++ class which is mostly constructors, setters and getters, and maybe a single method that actually does something). Then replace some large modules with existing 3rd party libraries, and the whole feat sounds a lot more believable.
- cocochanel 3y agoFunny that a language sounds like a big company where only a small percentage of people do most of the work.
- yvdriess 3y agoThat's why it's an Enterprise programming language.
- aeternum 3y agoBack in the day that those codebases were written, the 3rd party libraries did not exist or they were GPL. Everyone actually had to reimplement a linked-list library or macros in C. Nowadays you should probably fire anyone attempting to do that inhouse.
- rtheunissen 3y agoA very consistent codebase makes it possible to do things like this, using automatic refactoring and very smart find/replace, but such codebases are few and far between.
- ricardobeat 3y agoWhen doing a major rewrite like that, you’ll often end up with significantly less lines of code, maybe 1/4 of the original. Even if rewriting in the same language. This is the result of both being able to cleanup & simplify, as well as completely ignoring edge cases and regressions :)
- rgbgraph 3y ago- Java is majorly boilerplate. - If you map out the entire system, and understand how all the pieces fit together, you can: make something simpler that fulfills reqs/does the same exact thing; use template metaprogramming to generate the source code for you, instead of writing it by hand The only issue is very few people will have the skills or the patience to sit down and try to understand metaprogramming. So you won't be able to take advantage of it in most business use-cases (i.e. won't easily be able to find another cog to work on it), despite how powerful it is. It's like why more people don't work with K (or functional langs, etc.): it's not a simple procedural or OO language, so it's harder to learn -- and harder to get started with.
- cm277 3y agoYeah, I asked him; the answer was emacs (and a lot of macros). He automated the translation (from pre-processed code) and then hand-crafted the rest.
- hedora 3y agoI've reduced codebases by more than 100x, and simultaneously closed out 90+% of bugs, and added many orders of magnitude in performance. It is far less impressive than it sounds, because it relies on having an unimaginably bad starting point. I guarantee you that the starting point for this story was a pile of copy-pasted classes, each of which had some minor tweak, and that the program exposed some combinatorially large number of similar flows. When a bug was fixed, it would need to be manually applied to dozens of classes, and this did not happen, so each of the copy-pasted classes diverged and replicated functionality. The output of the weekend was almost certainly a simple set of software layers, each with a clean mathematical abstraction, and the composition of the layers expressed all possible flows from the legacy system. The best example of this I've heard of was with inkjet printer drivers from HP. They used to fork their entire driver stack, including font rendering and dithering, for each printer they released. They produced dozens of models per year. Then they assigned 5-10 full time engineers to maintain each fork of the driver. After the open source people had already done it with reverse engineered stacks, someone at HP wrote a unified driver framework where the only model-specific stuff was parameterized inputs to the ditherer (DPI, etc) or the actual wire protocol over USB to send the list of dots to put on the paper. They ended up replacing something like 10,000 engineers with a dozen people or so, and printout quality increased dramatically (though I doubt it was as good as the open source stacks).
- hliyan 3y agoI once wrote a Perl translator to translate a codebase from a custom business rule language into C++. Not my proudest moment: rather than using a parser, I just tokenised and processed the code line-by-line. It worked.