Live data from Hacker News

Code doesn’t have to be a mess

danielsieger.com

51–60 of 190 posts

Re: Code doesn’t have to be a mess

#51
post #41
post #26

> Say No Getting junior devs to do this is like pulling teeth. Trying to get a feature stopped after they've built it is soul crushing for them. It's a problem. At this point I've all but given up beyond minimizing the blast radius in code review.

Being married to your code/output is just another flaw typical for juniors. Put them on features that aren't critical or ensure they are made aware up front that their work may be rejected if it doesn't meet design expectations.

I'm not a junior dev and I still get peeved when my time is wasted. I guess I would only not care if I didn't care about what I was working on, but that's a different kind of existential torment haha.

Beyond opportunity cost, you can think of it as deleterious to your performance. If 10% of your work never gets merged because of shifting priorities, compared with someone else who has miraculously dodged these problems, that's pretty unfair.

Re: Code doesn’t have to be a mess

#53
post #26

> Say No Getting junior devs to do this is like pulling teeth. Trying to get a feature stopped after they've built it is soul crushing for them. It's a problem. At this point I've all but given up beyond minimizing the blast radius in code review.

> Trying to get a feature stopped after they've built it is soul crushing for them.

That's why I suggest first filing an issue, discuss a design, and only then actually implement the feature. Will save you many hours.

Re: Code doesn’t have to be a mess

#55
post #8

Ah the Unix philosophy. `man ssh' gives `ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-J destination] [-L address] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] destina…

Wasn't the "Unix philosophy" explicitly formulated by Rob Kernighan in 1983 in opposition to this kind of growth? I mean, there's a whole website of Unix purists named after it: 'UNIX Style, or cat -v Considered Harmful' http://harmful.cat-v.org/cat-v/

> Rob Kernighan

Is this a typo or a proposed Bourbakism?

Re: Code doesn’t have to be a mess

#56
post #37

In my personal experience a lot of the mess stems from complex layer-to-layer interactions. Within my own modules I'm pretty good at keeping things clean but marshalling data from C# to C++ (or Python to C or this lib to that lib) is where I get sad. Or mapping return and error codes, or catching exceptions etc.... The cleanest code I write is for embedded systems without an OS, basically a sparkling gem of refactore…

Drawing the line for separation concerns is one of the hardest things to do well in CS.

Not only in CS, it is hard as organisation design as well. E.g. do you want an engineering team, or do you want a product team that has engineer so to eliminate silo. Should engineer care about hiring? Or that's HR's concern. What about security? What about how good the product is performing? What about customer feedback? Should engineer care for all that? Organisation of code is miniature version organisation of a company. Of you nail it, that's your secret sauce

Re: Code doesn’t have to be a mess

#57
post #51
post #41

Earlier quoted context omitted.

Being married to your code/output is just another flaw typical for juniors. Put them on features that aren't critical or ensure they are made aware up front that their work may be rejected if it doesn't meet design expectations.

I'm not a junior dev and I still get peeved when my time is wasted. I guess I would only not care if I didn't care about what I was working on, but that's a different kind of existential torment haha. Beyond opportunity cost, you can think of it as deleterious to your performance. If 10% of your work never gets merged because of shifting priorities, compared with someone else who has miraculously dodged these problem…

Try to direct your personal energy away from getting your code into the product and towards making the best product possible. Often after building a feature it is obvious that it makes the product worse. I've had many such features cut.

Re: Code doesn’t have to be a mess

#59

If you try to apply the "write code that is easy to delete, not easy to extend" principle, your code will be less messy.

Reminds me of this (Greg Young - The art of destroying software):

https://vimeo.com/108441214

I'm still trying to figure out how to apply this to my personal javascript codebases.

Re: Code doesn’t have to be a mess

#60
post #26

> Say No Getting junior devs to do this is like pulling teeth. Trying to get a feature stopped after they've built it is soul crushing for them. It's a problem. At this point I've all but given up beyond minimizing the blast radius in code review.

Why are people going directly to your junior devs for feature requests?

Because the senior dev always says no.
Post reply on HN