Live data from Hacker News

“The days of using untyped languages on non-trivial projects are over.”

github.com

61–70 of 117 posts

Re: “The days of using untyped languages on non-trivial projects are over.”

#61
post #8
post #4

It’s disappointing that a lot of arguments for typing fail to explore why untyped languages became popular to begin with and how those benefits can be maintained throughout the migration process through partial typing To complete typing. When typing is applied gradually throughout a codebase it can sometimes manifest as the worst of both world and a complete argument should at least acknowledge that as well as the im…

What are the downsides of gradual typing on a codebase? I've never worked with it, but watched some talks on it and it really sounds promising. I understand the downsides for compiler complexity and for performance, but not on the codebase itself.

For one thing: because as soon as some piece of data leaves the typed world, all of your guarantees about its integrity go away. This is, in some sense, even worse than a situation with no types at all - in that case, you have no guarantees, which is better than having misleading ones!

If types are to data flow what structured programming is to control flow, it's a bit like being able to call into unsafe functions that can corrupt your stack. You could waste hours trying to trace the flow of execution and being completely stumped by your code's behaviour, looking at stack traces that make no sense...

Furthering that analogy, like how a structured programming language restricts control flow to specific structures as compared to free-form branches and jumps, certain interfaces and patterns that you can get away with in a dynamic context can't be expressed (or expressed cleanly) in a statically typed language. Just as your average Java programmer doesn't usually feel constricted by the inability to write Duff's Device in their language of choice, once you get good at TypeScript you rarely feel inclined to construct dynamic interfaces, but JS developers...a world where static typing isn't universally enforced, especially if you're working with a bunch of JS devs who don't fully embrace static typing, encourages the construction of difficult-to-type APIs. This then feeds back into the first issue: reasoning about type integrity when using these APIs becomes painfully difficult.

Re: “The days of using untyped languages on non-trivial projects are over.”

#62
post #10

this would be nice, but no, not going to happen. JavaScript, Python, PHP, Ruby etc fill a niche. Personally I love strongly typed languages, but I get why people don't want to deal with it. I am old school and do not use an IDE, so for me strong typing is a must.

Honest questions: What do you consider an IDE? Do you use syntax highlighting?

I only ask because I use Sublime Text but the most I use is the file browser sidebar and syntax highlighting. I don't use any linters.

I started with Ruby on Rails and Textmate and I've never needed anything fancy, even for 500k line Rails apps.

Re: “The days of using untyped languages on non-trivial projects are over.”

#63
post #56
post #17

Earlier quoted context omitted.

Yep. Everything comes in cycles, old becomes new again, etc. This is particularly true in the software industry. We're very fad-driven.

Is this the case here too though? My impression was that dynamic languages grew popular because of deficiencies in static type systems, making it hard to express things while requiring a lot of boilerplate and not providing enough runtime safety (e.g. NullPointerException), and a faster feedback cycle, as you need a compile step and need the entire program to be free of type errors. For the first point, type systems…

> Is this the case here too though?

I have no working crystal ball, so I don't know. But I don't see any obvious reason to think it isn't.

If history is any guide, then this is just the latest cycle, and the new hotness will become dynamic again.

Your list of improvements is correct, but I'll just point out that with every cycle, a similar list of improvements is cited as the reason why whatever the fashion of the day is will become The One True Way. So far, such expectations have never been fulfilled.

Re: “The days of using untyped languages on non-trivial projects are over.”

#65
post #8
post #4

It’s disappointing that a lot of arguments for typing fail to explore why untyped languages became popular to begin with and how those benefits can be maintained throughout the migration process through partial typing To complete typing. When typing is applied gradually throughout a codebase it can sometimes manifest as the worst of both world and a complete argument should at least acknowledge that as well as the im…

What are the downsides of gradual typing on a codebase? I've never worked with it, but watched some talks on it and it really sounds promising. I understand the downsides for compiler complexity and for performance, but not on the codebase itself.

Types are ultimately a contract. If your code was not originally designed with these contracts in mind and then you introduce a system that actually promotes ad hoc interfaces (TypeScript or any structurally typed system) then what you get is a mess. You're constantly Pick or Omit-ting everywhere. But worse, you absolutely have to use "any" or "ts-ignore" during the process. You can't avoid it. But one single "any" has the effect of stripping all code of type annotations, making the entire process a giant waste of time.

To compound matters, none of the TypeScript devs I've worked with have any experience with type systems. They don't think in terms of interfaces. They are still ball-of-mud developers. They did not come from Java or C/C++ or even Haskell. They came from Python or Ruby.

I'd also caution people about using third party types (i.e. DefinitelyTyped). These are often not correct because the underlying library is not in TS and does not have type information. You will pull your hair out when the library does not match the type definitions. These third party definitions can introduce bugs into your code. They can falsely claim that some field exists on an object which, in fact, does not. Your IDE will happily autocomplete to the invalid field, TS will happily compile it, and your JS run-time will unhappily crash.

Re: “The days of using untyped languages on non-trivial projects are over.”

#66
post #30

Programming seems to be settling down in this area. Parameters to functions and fields in data structures are usually explicitly typed, while local variable types are inferred when possible. C++, Go, and Rust have all converged on this. C++ used to suffer from "for" loops with insanely long type declarations for iterator variables. "auto" fixed that. Inter-function type inference, while technically possible, is just…

[deleted]

Re: “The days of using untyped languages on non-trivial projects are over.”

#68
post #17

The days of sweeping declarations regarding obviously periodic trends have never arrived. I've been around long enough that "safe" gave way to "productivity" and back to "safe". There's kind of a nascent ethos of being "better" in each new generation that just results in these pendulum effects. The overall effect seems to be enormously positive. I can now bounce between several completely valid build environments, ec…

Yep. Everything comes in cycles, old becomes new again, etc. This is particularly true in the software industry. We're very fad-driven.

Counterexamples: structured programming, version control, null safety, unicode. I don't think we're going backwards on those.

Re: “The days of using untyped languages on non-trivial projects are over.”

#69

Earlier quoted context omitted.

Much simpler explanation - php and js are both terrible languages.

You're talking like it's still 2010. Modern incarnations of both of those languages are pretty great.

I think "great" might be overstating things. "Better", perhaps.

But there certainly are use cases where php or javascript are the best tools.

Re: “The days of using untyped languages on non-trivial projects are over.”

#70
post #10

this would be nice, but no, not going to happen. JavaScript, Python, PHP, Ruby etc fill a niche. Personally I love strongly typed languages, but I get why people don't want to deal with it. I am old school and do not use an IDE, so for me strong typing is a must.

> I am old school and do not use an IDE, so for me strong typing is a must.

I, too, prefer to avoid using an IDE. I appreciate strong typing, but I certainly don't feel that loosely or untyped languages are made more difficult to use by not using an IDE.

Post reply on HN