Live data from Hacker News

Software development topics I've changed my mind on

chriskiehl.com

291–300 of 788 posts

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

#291
post #239

Earlier quoted context omitted.

Fortunately nowadays formatting issues can be delegated to autoformatting in any popular language. Some people still argue over autoformatter parameters, but then people will always find a bike shed to argue about.

Maybe a new paradigm for code formatting could be local-only. Your editor automatically formats files the way you like to see them, and then de-formats back to match the codebase when pushing, making your changes match the codebase style.

It's a decent idea, but it's weird reviewing code you wrote in saying GitHub, it looks totally different. Imo not a show stopper but a side effect you have to get used to.

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

#292
post #239

Earlier quoted context omitted.

Fortunately nowadays formatting issues can be delegated to autoformatting in any popular language. Some people still argue over autoformatter parameters, but then people will always find a bike shed to argue about.

Maybe a new paradigm for code formatting could be local-only. Your editor automatically formats files the way you like to see them, and then de-formats back to match the codebase when pushing, making your changes match the codebase style.

This is pretty common now. At least my Vim/git combo does this, where I always open source code with my preferred formatting but by the time it's pushed to the server it's changed to match the repo preferences.

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

#293
post #186

> Most programming should be done long before a single line of code is written This is the only point I strongly disagree with. I have been doing this for twenty years now and every time we've gone into something with a STRONG plan for how it's going to be built, it's ended up an inflexible nightmare when we inevitably end up having to work around things that were not considered in the design phase. The plan always e…

There needs to be a balance of course, but eventually you will have code/interfaces that are too painful to change because of all the users. The more core code is the more painful it will be to change and so the more a well thought out strong design is needed. The less core the code is, the less strong the design needs to be - but often the code code will force some design on you.

Of course there will always be something you didn't consider.

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

#294

Earlier quoted context omitted.

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

Because eventually someone will want to add another exception to a new leaf class and the proper place to handle it is 20 functions down the call tree and every single one of those 20 functions needs to now add that new exception to their signature even though only the handler function cares and you adjusted it. I haven't done java in decades, but I imagine this would get really nasty if you are passing a callback to…

The counter point here is that at least with Checked Exceptions you know only those 20 functions are part of the code path that can throw that exception. In the runtime exception case you are unaware about that 21'st function elsewhere that now throws it and it's not in the correct handling path anymore.

You have no way to assert that the error is always correctly handled in the codebase. You are basically crossing your fingers and hoping that over the life of the codebase you don't break the invariant.

What was missing was a good way to convert checked exceptions from code you don't own into your own error domain. So instead java devs just avoided them because it was more work to do the proper error domain modeling.

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

#295
post #288

Functional programming does not prevent you from using objects Stop listening to functional programming bros. Watch someone like Zoran Horvat. While I can't cosign all of his opinions, he tries to bridge the functional/OOP gap for OOP programmers. OOP programmers urgently need to distance themselves from this binary narrative. Everyone should understand functional programming and how they can utilize functional appro…

> Functional programming does not prevent you from using objects

It's a bit like how doing single-entry bookkeeping doesn't stop you from doing double-entry bookkeeping.

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

#296

> Objects are extremely good at what they're good at. Blind devotion to functional is dumb. Maybe "mutable objects"? Maybe these were intended to be isolated statements? Personally I believe functional programming is great with objects too... It is however true that many OOP-embracing languages tend to favor an imperative style. Scala is an example of a language that embraces both.

C# is becoming one as well. I recommend Zoran Horvat on youtube

And most of the well written react projects I've worked on tend to be overwhelmingly functional in style. Hooks just make sense when thinking about the lifecycle of a UI. Shared state and imperative code with react just feels wrong.

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

#297

Earlier quoted context omitted.

They do caching themselves so that some of your queries via ORM won’t hit the actual db.

So, given the main issue with ORM is the object/relational part... ( https://web.archive.org/web/20160301022121/http://www.revisi... ) Why is caching not a feature in DB connection pools? I mean, most databases have it on their side, why not have it as an option for the same query sets prior to hitting the db, with configurable invalidations? Or is it, and I've just never thought to look for it.

Integrating cache into connection pools brings little added value since connection pools don't have enough context/information to manage the cache intelligently. You'd have to do all the hard work (like invalidation) yourself anyway.

Example: if you execute "UPDATE orders SET x = 5 WHERE id = 10", the connection pool has no idea what entries to invalidate. ORM knows that since it tracks all managed entities, understands their structure, identity.

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

#298
post #151

Just personal opinions, I guess, I agree with most, but here are some I disagree with: - There is no pride in managing or understanding complexity Complexity exists, you can't make it go away, managing it and understanding it is the only thing you can do. Simple systems only displace complexity. - Java is a great language because it's boring That is if you write Java the boring way. A lot of Java code (looking at you…

> time++; // increment time This isn't too many comments, it's a poor quality comment. Try: time++; // advance 1 simulated second

What is wrong with

   time++;
That seem obvious enough to me without any comments.

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

#299
post #214

Earlier quoted context omitted.

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 somet…

More than one writer refuses to use a computer, preferring typewriters. Harlan Ellison learned how to repair typewriters after he could no longer find anyone to fix his. Stephen King wrote Dreamcatcher with a fountain pen. Authors totally obsess over details that seem irrelevant to people outside that craft.

Personally, I modified a Hollerith reader to accept Jacquard tapes that I cut by hand with a scalpel.

I’m so much more productive now.

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

#300
post #238

Earlier quoted context omitted.

Yeah, the other stuff seems sensible or at least "Ok, I can see that", but I definitely disagree with this one. You should spend time thinking about stuff beforehand, sure, but getting your hands dirty is also going to reveal things.

Very surprised at this attitude. Or am I. The typical engineering savant omniscient to all future past and present engineering roadblocks fixed by “Just”(TM) thinking about it beforehand. I expect this from bay area mid level not someone with credentials. Strange because I agree with so much more of the article

TBH, I think it's more of a 'manager' attitude. A lot of actual "hacker" type people are very much in the "rough consensus and working code" category where you see what works by doing it.
Post reply on HN