News for hackers. Stuff that matters.
Re:What makes a great developer? A story of an extraordinary... by zimpenfish on Wednesday November 28, 2018 @10:19AM (#18552194)
> piece of work [...] two weeks to implement, throw it all out and solve the same problem with only a few lines of code

I've been in similar situations and, invariably, the "few lines of code" is inscrutable nonsense that no-one else will be able to maintain (and often even understand.) I can write obtuse one line "clever" hacks to solve problems but I'm keenly aware that a) I'll have forgotten how it works in an hour and b) some poor bastard (which might well be me) will have to maintain it for N years after I'm gone.

Re:What makes a great developer? A story of an extraordinary... by GuB-42 on Wednesday November 28, 2018 @12:57PM (#18553826)
Short code is greatly underrated. It doesn't have to be an "obtuse and clever hack", usually it just amounts to using the right tool for the job.

For example, it is impressive how much code can be simplified by just using the correct API calls. Also, some language features are explicitly designed to address a specific problem, and yet they stay unused, even when the problem arises.

As for your two points.

- If you forget about how it works in an hour, you never knew how it worked in the first place. It can happen when you write code at random and tweak it until it passes the test. IMHO, that's the opposite of a clever hack.

- I love to see clever hacks in code I maintain. Like everyone else I start going "WTF?!" but a few minutes later, it usually turns into "oh nice, I learned something today".

To illustrate, this is the kind of code I like to read https://www.youtube.com/user/Bisqwit . This guy's code is short, clever, takes advantage of everything the language has to offer, and still manages not to be too cryptic. Note that these are educational videos and the author spends a lot of time to get to that level. I don't expect to see that in a typical project, but that's kind of an ideal for me.

Re:What makes a great developer? A story of an extraordinary... by zimpenfish on Wednesday November 28, 2018 @02:21PM (#18554716)
> If you forget about how it works in an hour, you never knew how it worked in the first place.

Obviously I disagree. I'll have forgotten through a combination of being old, not being interested in that code any more, having spent an hour doing something else, and work not being important enough to take up rent-free space in my brain.

Re:What makes a great developer? A story of an extraordinary... by ludston on Wednesday November 28, 2018 @05:03PM (#18556108)
In this case I can assure you that these "few lines of code" were much easier to understand, and more correct than the code that was being replaced. Basically, someone was trying to fix an IO error that they did not understand by writing a complex retry mechanism, even though the system already had a better and more correct retry system that wasn't being used for this.

It wasn't a hack, so much as removing someone elses (unnecessary) hack that fixed the problem.

Re:What makes a great developer? A story of an extraordinary... by techopoly on Wednesday November 28, 2018 @10:45AM (#18552399)
Right, and the product owner will expect all future maintenance to be done as quickly as the one-line clever hack that took 15 minutes but didn't encompass the edge cases.
Re:What makes a great developer? A story of an extraordinary... by alexandercrohde on Wednesday November 28, 2018 @11:05AM (#18552563)
Some 10x engineers just say "No" to product owners. If you let a product owner to convince you that you need an .xls export rather than .csv for internal use (this is a real-life example!) you may add a week+ of work/maintenance versus the time it takes me to explain "no."
Re:What makes a great developer? A story of an extraordinary... by zimpenfish on Wednesday November 28, 2018 @02:18PM (#18554691)
> an .xls export rather than .csv for internal use

Presumably this was a trivial data dump and not something like a report that could have benefited from, e.g., embedded formulas, multiple sheets, etc.? (I've produced exports with the latter and the enhancements were greatly appreciated over the plain old CSV export.)

Re:What makes a great developer? A story of an extraordinary... by dsego on Wednesday November 28, 2018 @12:02PM (#18553212)
From my experience it's the opposite, a mediocre programmer will create way more code than needed because they don't try to understand, but just blindly copy conditions and cases they see in the surrounding code (cargo cult). This leads to more convoluted code that looks clever and covers edge cases that wouldn't exist if it was coded properly or if they pushed back. Then the experienced programmer comes in and rewrites it to solve the actual problem with as few lines as possible.
Re:What makes a great developer? A story of an extraordinary... by thr0awaz on Wednesday November 28, 2018 @11:49AM (#18553082)
or somebody rewrote object.sort() from scratch instead of looking at the documentation, which isn't necessarily a 10x engineering problem, it's more of a 1/10th engineering problem.
Re:What makes a great developer? A story of an extraordinary... by zimpenfish on Wednesday November 28, 2018 @02:23PM (#18554736)
Fixing that would definitely be one of the "good" cases of rewriting code into fewer lines. But it doesn't involve a "clever" solution (which is normally the problem), just a "smarter" one.