Live data from Hacker News

Software development topics I've changed my mind on

chriskiehl.com

211–220 of 788 posts

Re: Software development topics I've changed my mind on

#211
post #97
post #15

Earlier quoted context omitted.

> Alas, many caught it and wrapped it in a generic RuntimeException. Actually sounded great right up until this point. Deal with it, or explicitly acknowledge that you do not. It's honest. Apparently other developers are why we can't have nice things.

It's already very unlikely that you can 'recover-and-proceed' in the context of any business app exception (Security violation, customer not found, no such payment, etc.). So what's left in exception handling is logging and/or rethrowing. And the 'nasty hackish way' of doing it (RuntimeException) already passes a complete stack trace up to the caller.

"recover and proceed" generally means "log the error and then continue processing on other data, rather than exiting entirely"

Lots of different kinds of software tends to follow this pattern - web servers, data pipelines, compilers/build tools, etc.

Re: Software development topics I've changed my mind on

#212
post #85

Earlier quoted context omitted.

Yep. And the laptop excuse is not even valid, I used a 11" MacBook Air for 10 years and even back then 80 always felt extremely limiting for me. I just tested and: even when zooming +1 on VSCode and leaving the minimap open I can fit 140 chars without any horizontal scroll. People demanding 80 columns always have some crazy setups, like an IDE where the editor is just a minuscule square in the centre, like an Osbourn…

And 140 chars aren't enough for two files side by side with 80 chars. With a readable font size and a narrow font about 90 chars is a good limit on a 14" laptop screen. Coincidentally that same limit then allows for three files side by side on the average desktop screen - or a browser window at the side for reference. If you can live with a single file on screen that's great, but the utility of two is far greater tha…

If you need two files on the screen side by side, then it's time to use something bigger than the MacBook 11 with zoomed fonts from my example. :)

...unless you really want to prove grandparent's point.

Re: Software development topics I've changed my mind on

#213
post #10

> Good management is invaluable. (I went most of my career before seeing it done well) Yes, and: it's difficult to describe, must be led from the top, and extremely difficult to evaluate from above.

If the person at the top can come down for a coffee with people who endured some bad management, and ask honest, non-loaded three questions, it can be measured qualitatively but with very high accuracy. The three questions are: - What should we start doing? - What should we continue doing? - What should we stop doing? This is an immensely powerful tool. Thanks to the awesome person who introduced me this. Addenda: "T…

What insight does an IC have on what the person at the top even does? I can basically only comment on my interactions with direct management and I otherwise don't know how they spend their day.

Re: Software development topics I've changed my mind on

#214
post #22

> Most won't care about the craft. Cherish the ones that do, meet the rest where they are > (…) > People who stress over code style, linting rules, or other minutia remain insane weirdos to me. Focus on more important things. What you call “stressing over minutiae” others might call “caring for the craft”. Revered artisans are precisely the ones who care for the details. “Stressing” is your value judgement, not neces…

To reduce your argument to its essence, you're saying typesetting is part of the craft of writing. I've yet to meet an author who believes this (other than enjoying editing their own work as output from a typewriter), and I think the same broadly applies to code. It's not that everyone thinks these things are unimportant, it's that caring deeply about doing them a particular way is orthogonal to the craft. It's something that has long been lampooned (tabs vs. spaces, braces, etc.) as weird behavior.

Re: Software development topics I've changed my mind on

#215

> You literally cannot add too many comments to test code (I challenge anyone to try) I think it is possible, depending how you write them. If you write long comments interspersed with the code, you have a lot of scrolling to do follow the control-flow. Long block comments should go at the top to "set the stage", and then lightly interspersed comments throughout to remind of the specific steps, where necessary. > Ver…

> ORMs are the devil in all languages and all implementations. Just write the damn SQL

I'm re-evaluating this again. I used to be all-in on ORMs, eventually became annoyed with the shortcomings and the performance problems, but am realizing the disadvantages of foregoing them as well.

* ORMs Bad: ORMs often lead to deep object graphs and tight coupling if you don't know what you're doing / don't factor the model properly. This has serious performance implications.

* ORMs Good: you get a unified, consistent view of all of your data on which you can enforce invariants in a holistic way.

* Only SQL Good: you can easily return and operate on only "slices" of the data, which is great for performance and rapidly iterating on features.

* Only SQL Bad: because you're only operating on "slices", you don't get a unified view of the data on which you can declare invariants. You can declare invariants on the slices and then stitch all of the properties together in your head to make sure you covered everything important (and write what tests you can to validate this), but this is error-prone and less necessary with ORMs.

So yeah, there's no single, clear winner here yet.

Re: Software development topics I've changed my mind on

#216
post #22

> Most won't care about the craft. Cherish the ones that do, meet the rest where they are > (…) > People who stress over code style, linting rules, or other minutia remain insane weirdos to me. Focus on more important things. What you call “stressing over minutiae” others might call “caring for the craft”. Revered artisans are precisely the ones who care for the details. “Stressing” is your value judgement, not neces…

The solution is to have computers enforce the code style. Pick a linter, pick a set of rules, and then forget about them. Things I beleive: - If you're picking up on code-style in PRs then your toolchain is backward. - If you're changing linting rules every month then you're focussed on the wrong things - It's better to have a consistent style than a perfect style

Agreed.

A healthy toolchain lets a developer separate the Craft from the minutiae.

Re: Software development topics I've changed my mind on

#217

Earlier quoted context omitted.

Really? You think most functional programmers are arrogant? Have you considered that your position is lazy, and that actually you have the problem?

How my position is lazy? By not learning Functional Programming? I openly said that I was driven away by these very people, because I don't want to be part of a community who belittles the outsiders the moment they talked. I mean, most (not all) functional programmers I met (for the last 20 years, no less!) started to praise functional programming by bashing imperative programming languages and never asked me about w…

> How my position is lazy? By not learning Functional Programming?

No, your position is lazy by asserting that most people who do functional programming are arrogant. This is a nonsensical value judgement. You don't know most functional programmers.

I don't know whether or not you're skilled FP. I don't know you. But as is appropriate, I assumed that you do actually know what you're talking about.

Re: Software development topics I've changed my mind on

#218
post #40
post #22

> Most won't care about the craft. Cherish the ones that do, meet the rest where they are > (…) > People who stress over code style, linting rules, or other minutia remain insane weirdos to me. Focus on more important things. What you call “stressing over minutiae” others might call “caring for the craft”. Revered artisans are precisely the ones who care for the details. “Stressing” is your value judgement, not neces…

There's a correlation-is-not-causation issue here. Yes, most very good developers pay a lot of attention to details, as well as to the bigger picture. But there are a lot of mediocre to downright bad developers who think that paying a lot of attention to code style, linting rules and other minutia will make them better developers.

My experience has been the opposite. Most mediocre to bad developers are so happy that their code works AT ALL that they pay little to no attention to things like sensible variable names and whitespace conventions. We sometimes call these things, "code smell."

Re: Software development topics I've changed my mind on

#219

No, objects aren't generally 'good', unless you think keeping multiple state machines in sync is 'good'. OO is not evil, but it also shouldn't be your default solution to everything. Also, who is this person? I immediately distrust someone who calls themselves 'a pretty cool guy'. That's for the rest of us to decide.

> No, objects aren't generally 'good', unless you think keeping multiple state machines in sync is 'good'.

Sure, if you disregard good object design, like the single responsibility principle and using mutability only when really needed.

Re: Software development topics I've changed my mind on

#220
post #181

Earlier quoted context omitted.

remind me why they don’t work? because “throws Exception” propagates virally to every method in the codebase?

Because you can't capture the evaluation of a function as a value, or write the type of it. E.g. try to write a generic function that takes a list and a callback, and applies the callback to every element of the list. Now what happens if your callback throws a checked exception? It doesn't work and there's no way to make it work, you just have to write another overload of your function and copy/paste your code. Now w…

Make the signature of your generic callback "throws Throwable". It's generic; it should never care about the specific types that the callback can throw.

(Except that then you have to decide what your generic function is going to do if the callback throws an exception...)

Post reply on HN