News for hackers. Stuff that matters.
Re:I was a 10x engineer and I’m sorry by freehunter on Thursday July 18, 2019 @11:23AM (#20470770)
There is also a very thin difference between “technical debt” and “genius programmer”. If I invented half the programming concepts Carmack did and wrote it at the company I work for, it would be considered technical debt immediately. No one else would be able to understand it and no one would be able to fix it when it broke. But for various reasons (mostly since Carmack is actually a programming genius), people stopped what they were doing to learn from him and adopt some of his techniques. Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him.

No one would take the time to learn from my way-too-clever code. They’d throw it away for more obvious code in a heartbeat. Because I’m not famous, I don’t work with other geniuses, and of course I’m not a genius so my way-too-clever code would just be annoying and uncharacteristic.

Re:I was a 10x engineer and I’m sorry by jerf on Thursday July 18, 2019 @12:20PM (#20471367)
"Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him."

I think the difference here is that Carmack was working in a space where fast inverse square root was the difference between the program working and it not working. At that point, it doesn't really how matter "clever" in any bad sense of the term the code is.

Carmack works in 3D engines, which even today is a space where people are trying to wring every last cycle out of them. It's perfectly appropriate when programming in a space where every last cycle counts to program as if you're in a space where every last cycle counts.

I don't work in such a space, so I don't program that way. But while I haven't got anything as "clever" as FISR, I have got some things like non-obvious database schemas for certain performance reasons that if my successors don't find and read the comments I've left about why the schemas are that way, they could well get themselves into some trouble if they try to "fix" it.

Re:I was a 10x engineer and I’m sorry by Const-me on Thursday July 18, 2019 @04:19PM (#20473564)
> was working in a space where fast inverse square root was the difference between the program working and it not working

Pentium 3 released in January 1999. That CPU, along with all newer ones, support SSE which has RSQRTPS instruction, faster, also much more precise approximation.

AMD had it before, PFRSQIT1 / PFRCPIT2 in 3DNow from 1998.

Quake 3 Arena released in December 1999. The point of using that approximation is running on older hardware, like Pentium and Pentium 2.

Re:I was a 10x engineer and I’m sorry by seba_dos1 on Friday July 19, 2019 @06:49PM (#20483093)
So, basically a difference between the program working and not working for most users.
Re:I was a 10x engineer and I’m sorry by zild3d on Thursday July 18, 2019 @03:08PM (#20472990)
agreed, you still see clever c hacks today in the embedded world, because resources are still constrained for many devices
Re:I was a 10x engineer and I’m sorry by gioele on Thursday July 18, 2019 @12:59PM (#20471754)
> Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him.

FISR is a beautiful hack, but it hardly technical debt. This is the original code. Note how the trick has been hidden behind a normal API such as `Q_rsqrt`:

   float Q_rsqrt( float number ) {
        long i;
        float x2, y;
        const float threehalfs = 1.5F;

        x2 = number * 0.5F;
        y  = number;
        i  = * ( long * ) &y;                       // evil floating point bit level hacking
        i  = 0x5f3759df - ( i >> 1 );               // what the fuck? 
        y  = * ( float * ) &i;
        y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration


        return y;
  }
This is how you walk the fine line between technical debt and useful hack.
Re:I was a 10x engineer and I’m sorry by dragontamer on Thursday July 18, 2019 @01:29PM (#20472070)
Not really.

If the comment "what the fuck" were instead "estimate floating-point exponent with bit-wise arithmetic" and "SingleStep forward with Newton's Method", then the code would be better documented

The comment "what the fuck" and "evil floating point bit level hacking" don't help anybody. And "1st iteration" is only helpful if you knew it was an iteration of Newton's method.

Re:I was a 10x engineer and I’m sorry by remram on Thursday July 18, 2019 @06:56PM (#20474757)
Agreed, this is really far from technical debt. It's self-contained, the purpose of the function is clear. Add a comment or two, a unit test, and this is perfect.

What I would call technical debt is if he had inlined those tricks all over his code, making it very hard to debug a wrong result or move away from this technique.

Re:I was a 10x engineer and I’m sorry by lorenzhs on Thursday July 18, 2019 @11:28AM (#20470829)
"Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him."

Carmack didn't come up with that: https://en.wikipedia.org/wiki/Fast_inverse_square_root#Histo...

Re:I was a 10x engineer and I’m sorry by klipt on Thursday July 18, 2019 @12:17PM (#20471341)
Maybe the real secret to being a 10x programmer is being so charismatic that people attribute the work of 10 other programmers to you!
Re:I was a 10x engineer and I’m sorry by tomlagier on Thursday July 18, 2019 @02:05PM (#20472415)
I think there's a real truth there - the most lauded 10x programmers are typically the "face" of a group of talented and productive people. As their legend grows, more and more work of the group gets attributed to them.

I think Elon Musk is another good example of this phenomenon.

Certainly, there are programmers vastly more productive than the average, but I think when you think of any legendary programmer (Linus, Carmack, Knuth), you're also likely impressed by their significant supporting cast.

Re:I was a 10x engineer and I’m sorry by beat on Thursday July 18, 2019 @02:36PM (#20472733)
I'd exempt Knuth from that, as he's practically a monk in his loner ways, but I also think of him as "genius", rather than "10x".
Re:I was a 10x engineer and I’m sorry by dragontamer on Thursday July 18, 2019 @05:19PM (#20474017)
Knuth is famously a slow worker, but he "gets to the bottom" of any problem. He's basically a turtle (from the Tortoise vs Hare story). A giant "juggernaut" turtle. You can't stop his analysis, but it takes a long time to get anywhere.

Its been over 40 years and he's still writing "Art of Computer Programming" books, and fixing errors in the text. Its an exceptionally well-crafted piece of writing. His solutions to various programming problems are excellent too, great analysis and deep thought applied to them.

Definitely not the "10x programmer" of today's lore. Knuth is an older, gentler kind of genius that I have a huge amount of respect for.

---------

For those who haven't read Knuth's works yet, I suggest starting with Knuth's analysis into Alpha Beta pruning: https://pdfs.semanticscholar.org/dce2/6118156e5bc287bca2465a...

Knuth's writing style is just so much deeper and thorough than pretty much everything else. You have to give the guy mad respect.

Of course, I also recommend reading "The Art of Computer Programming", but that's far more material to read through. The ~34 pages on Alpha-Beta pruning are a quicker introduction to Knuth's writing style. Even if you think you know how Alpha-Beta pruning works, Knuth goes far deeper into the subject than you might imagine.

EDIT: In particular, the F -> F1 -> F2 algorithm (F being Minimax, F2 being Alpha-Beta, and F1 being an in-between algorithm to help describe F2) is brilliant writing. Only Knuth would spend so much effort describing F1. But all that effort into F1 helps both his analysis, as well as better describes what is going on in Alpha-Beta pruning (aka F2).

Re:I was a 10x engineer and I’m sorry by whatshisface on Thursday July 18, 2019 @11:29AM (#20470844)
Fast inverse square root delivered business value that couldn't be obtained any other way, which means that it wasn't technical debt. It was a technical price. What's bad is when programmers make the system complicated purely to entertain themselves.
Re:I was a 10x engineer and I’m sorry by Bartweiss on Thursday July 18, 2019 @12:40PM (#20471552)
I'll bet that sort of 10x programming has gotten rarer simply because hardware constraints have relaxed so much. Tricks that once would have made a program possible now just make it a headache to read.

An awful lot of game-development history was spent actively looking for 'clever' hacks that would verge on fireable offenses today. Pokemon Red was made barely-possible via the sorts of magic-number tricks most of us don't even like to think about, but at this point that sort hand-optimization is basically just code golf for its own sake.

Re:I was a 10x engineer and I’m sorry by nostrademons on Thursday July 18, 2019 @01:03PM (#20471791)
It moves generationally, as new platforms are invented and people seek to capitalize on the platform before the performance is really all there. When you're doing anything at the bleeding edge, you really need to know the details of the platform and squeeze every ounce of performance out of it, because there's probably not enough performance to go around. When the edge moves to the center, stops bleeding, and the platform gets optimized, those sorts of hacks become silly anachronisms.

I remember doing Javascript games in 2007 (before V8 introduced a JIT to JS) and very carefully optimizing loops, avoiding DOM calls, eschewing JQuery, etc. to get acceptable performance. As late as 2009 we were counting bytes on the Google search results page (like literally; we'd do things like "for(var i=0,e; e=c[i++];)" to save a byte in a foreach loop). Solidity programmers on the Ethereum VM today use tricks like switching out opcodes and moving functionality into library contracts, sometimes at the expense of locking tens of millions of dollars worth of ETH forever.

Nobody counts bytes or manually moves common subexpressions out of loops in JS today; you just use Babel. But as computing matures, the bottleneck moves, and people seek out new domains that are just becoming possible, and then have to develop a new bag of tricks.

Re:I was a 10x engineer and I’m sorry by nazka on Thursday July 18, 2019 @11:32AM (#20470867)
Agree, I will also add that technical debt != complexity.

As an example everybody uses an OS to code. An OS is incredibly complex. Maybe one of the most complex piece of software. But it doesn't mean that you should care about it. With the proper and clean interface it will have an abstraction of this complexity to its user (in your company or not) and they will be able to continue to code and never have to care about it.

So of course an OS - or like OP said anything creating value - doesn't mean that it creates technical debt only because it's complex.

Re:I was a 10x engineer and I’m sorry by magduf on Thursday July 18, 2019 @12:23PM (#20471400)
Exactly: you may not be able to fully understand the OS you're working with, but you can abstract it away and use it anyway. This isn't "technical debt", it's something you need to actually get your job done: without the OS, you simply would not be able to actually create the thing you're making.

Similarly, whatever you're building likely uses a microprocessor somewhere. You probably don't really understand how that works, and would not be able to build one from scratch. But without that CPU, you wouldn't be doing your job at all.

The phrase "standing on the shoulders of giants" comes to mind here.

Re:I was a 10x engineer and I’m sorry by dsego on Thursday July 18, 2019 @12:58PM (#20471737)
"The Thirty Million Line Problem" by Casey Muratori might change your mind.
Re:I was a 10x engineer and I’m sorry by raiflip on Thursday July 18, 2019 @11:43AM (#20471002)
Thank you! Most people I've worked with end up so afraid of complexity that they create tech debt through crazy simplifications that require constant work arounds.
Re:I was a 10x engineer and I’m sorry by dnautics on Thursday July 18, 2019 @11:41AM (#20470965)
It's not even that complex. Arguably it is simpler than the way that you would otherwise do inverse square root, you could write a 5-line comment that anyone who's understood high school calculus could decipher, it's drop-in/drop-out, and doesn't need to be maintained.
Re:I was a 10x engineer and I’m sorry by icxa on Thursday July 18, 2019 @11:40AM (#20470952)
Highlight this and pin it to the top of this comment thread.
Re:I was a 10x engineer and I’m sorry by petermcneeley on Thursday July 18, 2019 @11:28AM (#20470834)
"The algorithm was originally attributed to John Carmack, but an investigation showed that the code had deeper roots in both the hardware and software side of computer graphics.". I would suggest this mis attribution help us further understand the 10x programmer conundrum.
Re:I was a 10x engineer and I’m sorry by nostrademons on Thursday July 18, 2019 @11:33AM (#20470870)
The difference is largely money. Doom was revolutionary when it came out; id software made a whole lot of money from it. The rest of the industry took note, and, wanting to make a lot of money too, decided to emulate what they saw.

If you want people to accept and learn from your clever programming techniques, try to find ways to turn them into products that only you can make that lots of people will pay money for. Even if you don't succeed in convincing the rest of the industry, at least you'll have lots of money.

Re:I was a 10x engineer and I’m sorry by pmoriarty on Thursday July 18, 2019 @11:43AM (#20470992)
It's not about the money.

Doom would have been revolutionary even if it and all of the other games it inspired were free.

Re:I was a 10x engineer and I’m sorry by gaogao on Thursday July 18, 2019 @12:07PM (#20471221)
The first part of Doom was shareware and free btw
Re:I was a 10x engineer and I’m sorry by cushychicken on Thursday July 18, 2019 @11:34AM (#20470890)
There was a point in Carmack's career where he was not famous, and he (and his work output) wasn't given the benefit of the doubt of being a genius.
Re:I was a 10x engineer and I’m sorry by bdamm on Thursday July 18, 2019 @11:47AM (#20471043)
There was no point in Carmack's career where he wasn't the focus of the company.
Re:I was a 10x engineer and I’m sorry by cushychicken on Thursday July 18, 2019 @12:14PM (#20471304)
Similarly, there was no point in Carmack's career where his work and his views were accepted totally uncritically.
Re:I was a 10x engineer and I’m sorry by selimthegrim on Thursday July 18, 2019 @03:04PM (#20472953)
When he wrote Keen for those guys in Shreveport I doubt he was the straw that stirred the drink
Re:I was a 10x engineer and I’m sorry by untog on Thursday July 18, 2019 @11:34AM (#20470886)
I think that has a lot more to do with Carmack being at a small company where there was no-one to say no to him. If you were the CTO of a three-person startup you most definitely could do whatever weird, esoteric programming you liked.
Re:I was a 10x engineer and I’m sorry by wtetzner on Thursday July 18, 2019 @11:34AM (#20470891)
Coming up with good abstractions can be very difficult, but those abstractions aren't necessarily difficult to understand.

Similar to idea that it's hard to write simple, clear code, but easy to understand it.

Re:I was a 10x engineer and I’m sorry by GGfpc on Thursday July 18, 2019 @11:29AM (#20470838)
But it was that genius coding ability that made him famous in the first place. You could do it if you worked at a company that needed those types of "hacks" like he did.
Re:I was a 10x engineer and I’m sorry by rasz on Thursday July 18, 2019 @08:48PM (#20475361)
>Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him.

Carmack didnt write it, 0x5f3759df constant landed at iD from 3Dfx/Silicon Graphics

https://medium.com/hard-mode/the-legendary-fast-inverse-squa...

Re:I was a 10x engineer and I’m sorry by frequentnapper on Friday July 19, 2019 @07:39AM (#20477748)
"The algorithm was originally attributed to John Carmack, but an investigation showed that the code had deeper roots in both the hardware and software side of computer graphics."