Live data from Hacker News

Software development topics I've changed my mind on

chriskiehl.com

371–380 of 788 posts

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

#371
> Gradual, dependently typed languages are the future

What's that?

Idris is dependently typed.

> Gradual typing is a type system that lies inbetween static typing and in dynamic typing. Some variables and expressions may be given types and the correctness of the typing is checked at compile time and some expressions may be left untyped and eventual type errors are reported at runtime.

That sounds miserable. I can't see how one would guarantee anything when types of other things aren't known. And I can't see how to connect that to dependent types either.

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

#372
post #322

Earlier quoted context omitted.

Yep, don’t change the function signature of depended on code. That’s the problem :) It would be equally problematic to change the method name, or the argument arity or types (ignoring overloading for the moment). It would be even more problematic if I kept the same function signature, but changed the meaning of the parameters. Then your breakage is silent.

yes exactly, hence unchecked exceptions are the sane option.

Doesn’t that just introduce a silent breaking change to your downstream consumers? That sounds worse.

It sounds ok from a library authors perspective but definitely not from a library consumer perspective.

A sane thing to do would be to do a version bump.

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

#373
> The trouble with functional programming is functional programmers

This hilariously works for a lot of things. Biggest trouble with legalization of drugs is the drug use of the ones that love to talk about why it should be legal. Biggest trouble of prohibition policies are the people that love going on about why they are better for not drinking.

I assert that this is, essentially, "The trouble with THING is the group of people that think THING is a panacea at what it does."

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

#374

> Never go full monad in Java. what? why?

because no matter how much java wants to be like scala, it's very painful to work with (verbose). There is no good Option type either. But I believe there are third party libraries out there that do a better job, if you really can't use scala for some reason

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

#375
For the most part, I agree with a lot of this, but there were a couple points I raised an eyebrow on.

> There is no pride in managing or understanding complexity

To the point that intentionally creating complexity or allowing it to continue to exist where it can be simplified, I agree - but some systems are necessarily complex and having pride in understanding and managing them is a good thing. If no one had pride in this, why would anyone care about the things that aren't simple - or bother to train the ability to simplify the complex in the first place!

> Micro-services require justification

I used to believe this, but have changed my mind on it. Micro-services are great in the current CS ecosystem (at least in the US) because they allow smaller parts of the whole to be more easily refactored when you find your development team with none of the people that were present when design decisions were made and a major feature needs to change.

It's an unpleasant situation to be in, and one that you ideally want to avoid happening, but is common enough that preparing for it in your application landscape is reasonable.

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

#376
post #371

> Gradual, dependently typed languages are the future What's that? Idris is dependently typed. > Gradual typing is a type system that lies inbetween static typing and in dynamic typing. Some variables and expressions may be given types and the correctness of the typing is checked at compile time and some expressions may be left untyped and eventual type errors are reported at runtime. That sounds miserable. I can't s…

Maybe the author meant gradual static typing?

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

#377
post #244

Earlier quoted context omitted.

what is "it doesn't work" ? The exception is part of the type, so it doesn't typecheck unless all callbacks are of type "... throws Exception"? What's the problem with that? It's not generic enough, i.e. the problem is Java generics are too weak to write something like "throws "? (Forgive me, it's been 13 years since I wrote java and only briefly, the questions are earnest) edit, so like `@throws[T <: Exception] def…

You can't be polymorphic between not throwing and throwing, or between throwing different numbers of exceptions. You have to write something like: List map(Function mapper) { ... } List map(FunctionThrows1 mapper) throws E1 { ... } List map(FunctionThrows2 mapper) throws E1, E2 { ... } and so on until you get bored.

ah!

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

#378
post #347

Earlier quoted context omitted.

In my experience: Too large is any team larger than 10 people or any code base with more than 10,000 lines of code. Both of those would be considered tiny by most in the industry.

Oh, you are definitely correct about 10 people being too many. For me I think the magic number was 4 or 5. About 10k lines, I really never stopped to think but I'm gonna guess you're correct on that too.

The numbers I gave are not exact. Depending on details that I don't think anyone entirely knows. Sometime 1 person is too many (generally implying a bad programmer), while other times you can get a bit over 10 if you have strong discipline. Likewise strong discipline can get you to 100k lines. Really what this is about is how much pain you are willing to put up with. 10 people and 10k lines of code are good round numbers to work with.

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

#379

Earlier quoted context omitted.

> However at a minimum formatting changes shouldn’t regularly complicate doing a diff. If the code needs to be reformatted, this should be done in a separate commit. Fortunately, there are now structural/semantic diff tools available for some languages that can help if someone hasn't properly split their formatting and logic changes.

Reformatting comitts still leaves the issue that you deprive yourself of any possibility to reliably diff across such commits (what changes from there to there?) Or attribute a line of code to a specific change (why did we introduce this code?). What we should have instead is syntax-aware diffs that can ignore meaningless changes like curly braces moving into another line or lines getting wrapped for reasons.

> What we should have instead is syntax-aware diffs that can ignore meaningless changes like curly braces moving into another line or lines getting wrapped for reasons.

These diffs already exist (at least for some languages) but aren't yet integrated into the standard tools. For example, if you want a command line tool, you can use https://github.com/Wilfred/difftastic or if you are interested in a VS Code extension / GitHub App instead, you can give https://semanticdiff.com a try.

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

#380
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…

I think the "most programming" thing has to be determined according to project type. You should have your architecture and data relationships all figured out long before coding when it comes to safety-critical systems.
Post reply on HN