5 ms·
> My counter is that when it comes to language design, semantics—what the types mean—are easily 10 times more important than syntax Sometimes I long for the da
by breckinloggins 1y ago
> My counter is that when it comes to language design, semantics—what the types mean—are easily 10 times more important than syntax
Sometimes I long for the days before type theory took over programming language research.
- mvdtnz 1y agoYou don't need fancy boy theories to see value in types.
- dismalaf 1y agoThe value in types is telling the compiler to make certain assumptions so it can optimize the output. There's not a ton of value to be had in something like Typescript or Python types.
- dragonwriter 1y ago> The value in types is telling the compiler to make certain assumptions so it can optimize the output. Correctness is more important (in general and as a benefit of type checking) than optimization. Doing the wrong thing fast is easy, but not valuable.
- dllthomas 1y agoPerhaps Devil's advocate, but my rebuttal would be that we're not necessarily comparing similar gains to correctness as to optimisation, and that perhaps the correctness gains can be better attained another way where the optimisation gains cannot. (Personally I find a type checker tremendously valuable for communicating with myself - and my team, I suppose - about assumptions being made in other parts of the program, which can probably be accounted "correctness".)
- williamdclt 1y agoYet TS is massively popular. So maybe that’s not the only value?
- dismalaf 1y agoPopular != Good. Also what's good for enterprise isn't good for everyone. I get that orgs probably like TS so that newbie devs don't do crazy things in the code, and for more editor hand-holding. But it's not valuable for everyone, if it was actually better than everyone would be using it, not just some people.
- lolinder 1y agoI'm a professional developer with 20 years of experience and I wouldn't dream of starting a new side project—even with myself as the only developer—without types. I've learned by hard experience that past me was an idiot and future me is clueless. Types are executable documentation that I can leave behind for future me so that future me can get instantaneous feedback while refactoring the project that past me wrote.
- zhisme 1y agoAny reason you stick to ruby? Why not use any statically typed language which offers this feature out of the box? We don't argue against typing. We argue about typing like it is done in ruby rbs/sorbet.
- lolinder 1y agoI don't use Ruby. I would if it had types. My language of choice right now is TypeScript because it has the best balance of types and dynamism.
- dismalaf 1y agoSo you're forming an opinion without trying it? This is just a rehash of the discussions people were having about Smalltalk/Lisp 20 years ago... All the Java/C++ IDE people who were wondering how people survived without those tools, forgetting that Smalltalk/Lisp have live-coding, REPLs, and their own tools. Ruby is the same, the terseness + REPL/live-coding makes it easy to be productive and write bug-free code. I know I'm far, far more productive in Ruby versus, say, C++ or Odin (my newest hobby language).
- horsawlarway 1y agoI think this is a beginner take. If you only work in small teams, or small projects, I could see this opinion getting formed and maybe agree. But having worked on large projects... Types are fucking great. So much value exists in simply having a tool that highlights everywhere in the codebase my change impacts. It makes refactoring at scale possible and expedient in a way that is simply better. Period. I can be fearless changing things, because I don't have to wonder about all the places my change might have broken - it literally gives me the exact set of files and lines I need to go fix. I don't even have to rely on tests. It's... Better. It's better even for my personal projects, and it's unimaginably better for my 300 engineer org.
- dismalaf 1y agoAnd this is a corporate take... What I don't understand is why, with the myriad of Java-like languages out there (types and all), corporate types still want to Java-ify languages like Ruby... Like, just use Java, Go, Typescript, etc... It's nice that there's still a language and framework that optimizes for solo devs/small teams and startups. > It's better even for my personal projects Does your personal project make money and/or need to be launched quickly? I've also got personal projects in statically typed languages (been playing around a lot with Odin/Vulkan) but those have no due date or expectations. Also declaring types only prevents a very small amount of bugs. And it's not like Ruby doesn't have linters, tests and other tools. Direct feedback from the REPL also makes it easier to write correct code. Better is also a meaningless word when it comes to software. Does better mean you can ship faster? Or that it's more performant? Unfortunately no language has given us the productivity of a dynamic language with compiled language performance, so everything is a tradeoff...
- gyesxnuibh 1y agoCorporations don't just blip into existence overnight. Startups use a prototyping language fixing the problems and then suddenly you realize you need types and rewriting is a waste of time, money, and a risk to the business. > Does your personal project make money and/or need to be launched quickly? This makes it clear that you understand why the language would be chosen in the first place, so not sure why it's not clear that eventually requirements change and you need a way to iteratively improve things while still shipping things.
- breckinloggins 1y agoI… didn’t say I saw no value in types? I meant that there was a culture shift around program language research that had given advances in syntax a permanent back seat.
- deleted 1y ago[deleted]