frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

The Windows Subsystem for Linux is now open source

https://blogs.windows.com/windowsdeveloper/2025/05/19/the-windows-subsystem-for-linux-is-now-open-source/
808•pentagrama•5h ago•522 comments

Zod 4

https://zod.dev/v4
473•bpierre•5h ago•167 comments

Claude Code SDK

https://docs.anthropic.com/en/docs/claude-code/sdk
150•sync•3h ago•81 comments

GitHub Copilot Coding Agent

https://github.blog/changelog/2025-05-19-github-copilot-coding-agent-in-public-preview/
204•net01•5h ago•119 comments

Launch HN: Better Auth (YC X25) – Authentication Framework for TypeScript

144•bekacru•6h ago•52 comments

The forbidden railway: Vienna-Pyongyang (2008)

http://vienna-pyongyang.blogspot.com/2008/04/how-everything-began.html
55•1317•2h ago•13 comments

Dominion Energy's NEM 2.0 Proposal: What It Means for Solar in Virginia

https://www.virtuesolar.com/2025/05/16/dominion-nem-2/
23•Vsolar•3d ago•8 comments

Too Much Go Misdirection

https://flak.tedunangst.com/post/too-much-go-misdirection
117•todsacerdoti•5h ago•47 comments

Run your GitHub Actions locally

https://github.com/nektos/act
82•flashblaze•3d ago•27 comments

Game theory illustrated by an animated cartoon game

https://ncase.me/trust/
106•felineflock•4h ago•18 comments

Remarks on AI from NZ

https://nealstephenson.substack.com/p/remarks-on-ai-from-nz
87•zdw•3d ago•41 comments

Show HN: A MCP server to evaluate Python code in WASM VM using RustPython

https://github.com/tuananh/hyper-mcp/tree/main/examples/plugins/eval-py
6•tuananh•2d ago•0 comments

ClawPDF – Open-Source Virtual/Network PDF Printer with OCR and Image Support

https://github.com/clawsoftware/clawPDF
153•miles•8h ago•23 comments

Show HN: Windows 98 themed website in 1 HTML file for my post punk band

https://corp.band
129•jealousgelatin•3h ago•28 comments

Glasskube (YC S24) is hiring in Vienna to build Open Source deployment tools

https://www.ycombinator.com/companies/glasskube/jobs/wjB77iZ-founding-engineer-go-typescript-kubernetes-docker
1•pmig•4h ago

Wikipedia's Most Translated Articles

https://sohom.dev/most-translated-articles-on-wikipedia/pretty.html
74•sohom_datta•5h ago•45 comments

European Investment Bank to inject €70B in European tech

https://ioplus.nl/en/posts/european-investment-bank-to-inject-70-billion-in-european-tech
213•saubeidl•5h ago•220 comments

Microsoft's ICC blockade: digital dependence comes at a cost

https://www.techzine.eu/news/privacy-compliance/131536/microsofts-icc-blockade-digital-dependence-comes-at-a-cost/
154•bramhaag•3h ago•63 comments

InventWood is about to mass-produce wood that's stronger than steel

https://techcrunch.com/2025/05/12/inventwood-is-about-to-mass-produce-wood-thats-stronger-than-steel/
416•LorenDB•1d ago•392 comments

Rivers

https://www.futilitycloset.com/2025/05/15/rivers/
32•surprisetalk•3d ago•3 comments

Side projects I've built since 2009

https://naeemnur.com/side-projects/
221•naeemnur•12h ago•124 comments

Telum II at Hot Chips 2024: Mainframe with a Unique Caching Strategy

https://chipsandcheese.com/p/telum-ii-at-hot-chips-2024-mainframe-with-a-unique-caching-strategy
110•rbanffy•10h ago•49 comments

Dilbert creator Scott Adams says he will die soon from same cancer as Joe Biden

https://www.thewrap.com/dilbert-scott-adams-prostate-cancer-biden/
125•dale_huevo•4h ago•141 comments

Diffusion Models Explained Simply

https://www.seangoedecke.com/diffusion-models-explained/
92•onnnon•8h ago•13 comments

Kelp – simple replacement for homebrew on macOS

https://github.com/crhuber/kelp
66•amai•6h ago•46 comments

Show HN: A native Hacker News reader with integrated todo/done tracking

https://github.com/haojiang99/hacker_news_reader
10•coolwulf•3h ago•6 comments

23andMe Sells Gene-Testing Business to DNA Drug Maker Regeneron

https://www.bloomberg.com/news/articles/2025-05-19/23andme-sells-gene-testing-business-to-dna-drug-maker-regeneron
176•wslh•5h ago•100 comments

Edit is now open source

https://devblogs.microsoft.com/commandline/edit-is-now-open-source/
140•ingve•4h ago•54 comments

FCC Chair Brendan Carr is letting ISPs merge–as long as they end DEI programs

https://arstechnica.com/tech-policy/2025/05/fcc-chair-brendan-carr-is-letting-isps-merge-as-long-as-they-end-dei-programs/
13•rntn•49m ago•3 comments

Visualizing 100k Years of Earth in WebGL

https://technistuff.com/posts/visualizing-100000-years-of-earth-in-webgl/
47•agnosis•8h ago•14 comments
Open in hackernews

Static Types Are for Perfectionists

https://mmapped.blog/posts/38-static-types-perfectionism
37•PaulKeeble•2d ago

Comments

PaulKeeble•2d ago
Despite the somewhat clickbait title this is quite interesting on technology preferences and the path to what makes us happy and productive.

The idea that our preferences in technology are driven by our path of learning seems relatively self evident, those that started with C/C++ verses Smalltalk verses Java verses Python as their first language likely have a very different perspective on the various trade offs of these languages. Given we don't usually learn every language and certainly not to a deep extent few have deep experiences in all the possibilities to grok the differences in practice on similar projects.

  "I need the right project and the right team to function well"
I really resonate with this, in the right environment I seem vastly more productive. I have a significant preference for low levels of control and oversight and in those environments I can take actions quickly with less discussion and often get to better answers quicker, but I hate not being able to do that and it impacts my performance disproportionately. Its one of those preferences for culture that seems vital to how I want to work and impacts productivity a great deal. Asking permission or high rigour for potentially "extra" work just grinds my gears!
AnimalMuppet•3h ago
I don't think it's just "what our path of learning was", though that plays a role. I think that different personalities prefer different styles (functional vs procedural), different languages (static vs dynamic typing), and probably several other axes.

This explains, for example, why one person sees functional programming as a massive revelation, where suddenly everything "just fits", and assumes that anyone who doesn't have the same reaction hasn't "gotten it" yet. And others, despite diligent trying, never have that reaction.

parpfish•4h ago
i like static code because a codebase that applies types well gives you the same benefits of writing lots of tests for free.
cma•4h ago
Ironically they usually make unit tests and testing by hand in the repl harder
Spivak•4h ago
Yep, there is basically nothing else to be said. Using a static type checker isn't some moral imperative or whatever. I simply am able to write better, more correct code faster than without it. And my test suite doesn't have to do things like check the return type of the function because the type checker already knows.
igouy•4h ago
Ummm wouldn't that be check the return value which the type checker doesn't already know?
90s_dev•4h ago
Type systems make 93% of tests obsolete. The other 7% are implied by developing new features and making sure they work as you expect. If nothing broke, you're good to go. Incidentally, it scales with a team. The more people writing code, the more people who will run into some bugs one of you introduced. In my experience, automated tests (unit or e2e) never reduced that number, but only slowed us down. I wonder if TDD & BDD were just an excuse to bill clients for more time while giving them a false sense of security.
theLiminator•4h ago
Ironically the strongest advocates of dynamic languages tend to be places where a strong type system would solve a huge percentage of their bugs.

Web development is mostly the munging of data together and ensuring that you're glueing stuff together correctly. Static type systems, especially ML based ones would ensure that most of this is done correctly.

AnimalMuppet•3h ago
> Type systems make 93% of tests obsolete.

I don't suppose I could trouble you for a source for that number?

90s_dev•3h ago
Yeah I just made it up.
parpfish•3h ago
I made up a similar number, so it’s been replicated
igouy•4h ago
The benefits are not the same. Code can type check but not be correct.

There's no free lunch. Some languages require explicit type definitions others don't.

theLiminator•4h ago
> Code can type check but not be correct.

Depends on your type system. It can prove the correctness of certain properties depending on your language.

Conversely, unit tests can pass but your code might not be correct.

igouy•3h ago
Depends on your type system. Depends on your tests. Depends.

Yet another under-specified commentary ;-)

kibwen•4h ago
Conversely, code can pass tests and not be correct, including in ways that would have been trivially caught by a type system.

If you care about correctness, use both. Codebases written in static languages still use tests.

igouy•3h ago
Yes, we care about run time behavior.
parpfish•3h ago
Well, yeah. Types don’t remove the need for ALL tests, but it removes the need for the most boring 90% so your test suite can just focus on the most important behaviors
edg5000•4h ago
I wrote a large enterprise JavaScript application that was behind Apple/Google update approval, was used daily by businesses whose entire operation depended on it.

I will never touch loosely typed stuff again. I want every keystroke checked for errors. I want autocomplete to select from possible members/fields/variables/functions/classes rather than doing constant global find/replace operations and having the customer be the beta tester

emoII•4h ago
You do write tests, don’t you?
fyrn_•4h ago
Yeah, that will really help with the auto complete and keystroke by keystroke checking?? What?
ninetyninenine•4h ago
Don't understand why people find tests important but not types.

There's two popular ways to verify your programs. Types and tests. Types are EASIER then tests and types COVER more then tests.

The ideal thing is to use both, but why spend so much time on unit tests over types is beyond me.

Note that integration tests are a different beast. Why? Because you need to test things that aren't covered by either unit tests or types. In unit tests you mock out things that are external like IO, databases, and the like. In integration tests you need to test all of those things.

Integration tests are THE most important thing to use to verify your program because it's an actual test to see if your code works. But unit tests vs. types? Types win.

When I code. I never write a single unit test. Just types, and integration or end 2 end tests. It doesn't hurt to write a unit test and it's actually better. But the fact that I'm confident my code works without it shows the level of importance.

gleenn•4h ago
If you do it right, your tests cover the thing you care about and are less work usually because you write the test for the part of code that has the interesting part you want to verify works correctly. Types, especially on fully typed languages, make only guarantees about the type of values and they make you do it in places you might not care about. Types also only catch certain classes of errors that I personally find less helpful that tests. So to me, tests are less work, focus on thebimportant parts, and give better error messages. Obviously you can also write bad tests and do things like effectively just check the types in pmaces and you are back to square one. Testing is more of an art but the effort/economics of time are far better to me.
the_af•4h ago
> types [...] make only guarantees about the type of values

What do you think "type of values" means and encodes, and why do you think it's different from your handwritten tests?

I assume you do know that type checking is more than simply validating you're passing a string to a function that expects a string argument?

> Types also only catch certain classes of errors

Which classes of errors? Why do you think manually written unit tests are more complete?

AnimalMuppet•3h ago
Depending on your language, some things may not be easy to encode in types. "Verify that the function handles gracefully the situation where the map it's passed doesn't contain that one magic entry." That won't be easy to encode in a type...
the_af•3h ago
Of course not everything can be encoded in types, and also YMMV regarding the specific language you're using.

But you now why I asked the question: people who make claims like "types make only guarantees about the type of values" usually don't understand what modern type-checking can do or what can be encoded in types. People making these claims often believe type-checking is limited to validating that you only pass strings to a function expecting a string argument, or some minor variation of that.

gleenn•2h ago
If I have a complicated set of business-logic functions that all return booleans, the type-checker can tell me I got a boolean back but not that in xyz scenario my result should be true and abc scenario it should be false. You must write a test for that, the types are only the most marginal at helping check correctness. There are many more examples like this. If I have to write the tests, why do I want to spend time writing all the types too if my tests cover the things I care about the the types only cover details like "you returned a number from a function marked boolean", that type of error is super easy to catch with a test, so I didn't need the types.
the_af•2h ago
> the types only cover details like "you returned a number from a function marked boolean", that type of error is super easy to catch with a test, so I didn't need the types

Thanks for your reply, this is why I asked: this kind of typechecking you describe only scratches the basics of what a robust type-checking system can do.

In practice, it can cover much more than "you returned a number from a function marked as boolean", and so it saves you from writing lots of unit tests, leaving you free to write only the few tests that make sense for your business logic.

Once you have a proper type system in place, you can do much more than:

> [...] a complicated set of business-logic functions that all return booleans [...]

You can encode more useful things in the type of the functions than just "it returns a boolean". Of course if every function you write only returns a boolean you won't get much from the type system! But that's circular reasoning...

MoreQARespect•2h ago
Like tests, types can be more hassle than theyre worth if you dont use them correctly.

Before mypy came along I was pretty disciplined at A) testing and B) ruthlessly clamping down on primitive obsession.

I use types a lot now but I didnt see enormous quality or productivity gains when I started using them. I suspect people who let compilers catch their bugs were always A) pretty lax testers and B) probably often let primitive obsession get the better of them.

There are only a few types of tests where I think that types actually serve as an appropriate substitute.

theLiminator•1h ago
> When I code. I never write a single unit test. Just types, and integration or end 2 end tests. It doesn't hurt to write a unit test and it's actually better. But the fact that I'm confident my code works without it shows the level of importance.

Imo this might be true if you're writing a lot of glue code. But I think unit tests are extremely valuable for testing pure functions that are pure logic/computation. For glue code/ensuring everything is hooked up correctly, types easily beat tests, but for pure logic tests (ideally property based testing if you can swing it) works great.

90s_dev•4h ago
TDD and BDD are security blankets for enterprises and clients. They add disproportionately little value, and significantly increase the cost of evolving an app in any direction.
jamil7•4h ago
The person you're responding to only mentioned tests, not TDD or BDD.
90s_dev•4h ago
People who think like that commenter implied, are almost always indoctrinated into "if you don't write tests and use TDD or at least BDD, you're literally Satan."
MoreQARespect•4h ago
TDD and BDD teaching and tutorials are almost universally terrible so people inevitably do them badly and then moan about the results, which can be worse than not using them at all.

Usually the primary mistake is either using cucumber (which is awful) or surrounding the wrong interfaces with tests (usually at too low a level).

Done well they are like a mini superpower.

90s_dev•4h ago
I've learned from the so-called experts for years. I studied directly under them. I spent so many years trying to find the perfect way to do TDD and BDD. I saw their own code and their own solutions up close. They're frauds. It was all a sham.
MoreQARespect•3h ago
I'd be shocked if it wasnt because they also led you to make the two primary mistakes i refered to above.
90s_dev•3h ago
Ah so you're the guru I should have studied under all those years. If only.
MoreQARespect•2h ago
Perhaps. More than a famous guru I find most companies badly need a testing framework that can simulate 90% of possible scenarios hermetically and lack somebody who can build that.

Once you have that and somebody has taken you around the block 3 or 4 times pairing with TDD on your app it usually starts to make more sense.

On my team after I inculcated the TDD habit properly, BDD came naturally. I didnt even encourage them to have conversations with the PO while screensharing the tests. They dont even know that's called BDD.

NeutralForest•4h ago
TDD/BDD are just tools, in some cases they're useful and some other cases they're not.

If your work is deeply exploratory and you don't even know what the final interface/API will look like, you shouldn't start with TDD. You should probably test as you go though, once you find some behavior you'd like to keep and pin down variations and edge cases you met during dev.

If/Once you know what the expected behavior is, you can encapsulate that knowledge in tests, that's TDD to me. Then, I can write more code that meets the need of the expected API.

toolslive•4h ago
"unit tests are a poor man's compiler" (NN)
rrauenza•4h ago
I adopted Python type annotations on a new project I was writing. Requirements shifted a lot as well as the implementation.

It was amazing. I could refactor quickly after changing a dataclass, field name, function arguments, type, etc. I just ran mypy and it immediately told me everywhere I needed to update code to reference the new refactored type or data structure.

Then only after it was mypy clean, I ran the unit tests.

bpshaver•4h ago
Even better, run `mypy` as part of your LSP setup and you don't even need to wait to run `mypy` to see type errors! If I make a mistake I want to be notified immediately.
NeutralForest•4h ago
My style has changed over time and part of it is thanks to static type checking in Python. I rarely use dictionaries anymore when what I actually want is a different type that functions will handle down the line. So to transfer data, I usually make frozen dataclasses where I used to use dictionaries. It's more work when you want to add fields on the fly ofc but it pays dividend anytime the logic becomes more complex.
rrauenza•2h ago
Agreed -- dataclasses over dicts. And for legacy code I try to move them to typed dictionaries.

Pydantic is also helpful to enforce types on json.

I've also stopped passing around argparse namespaces. I immediately push the argparse namespace into a pydantic class (although a dataclass could also be used.)

constantcrying•4h ago
I think it is important to understand why you are doing what you are doing. Sure, enjoyment and "authenticity" can be part of it, but it clear that e.g. static vs. dynamic typing is an engineering tradeoff. Making a decision in either direction should be based on those tradeoffs.

One important consideration is the importance of the project, hobby projects are for enjoyment mostly, so there "authenticity" is really important. At the same time you shouldn't make decisions on how to develop aerospace software based on how "authentic" the development process feels.

gejose•4h ago
Ragebait title
constantcrying•4h ago
And a thread where people respond to the title of an article and not the article itself.
chrisweekly•4h ago
It's not a title that suggests much subtlety or wisdom will be found in the article.

EDIT: ... which is unfortunate, bc it's actually a decent read w/ interesting points about the relationship between (programming preferences) and (emotions / psychology).

Jtsummers•4h ago
https://news.ycombinator.com/item?id=43966948

I'll make the same remark I did last time this was posted here (it's been submitted 3 times in one week):

The author starts with this:

> I conclude with two implications of this idea: the necessity to accept other people’s preferences without judgment and the importance of finding an environment rewarding your style.

And follows it with these two things:

> Type theory maximalists should give up their aura of moral and intellectual superiority and accept that they need therapy just as badly as everyone else in the industry (if not more).

>> Haskell will still be used in 20 years, because there will always be people looking for a productive way to weaponize their autism.

So much for "without judgement".

90s_dev•4h ago
"If I haven't seen it, it's new to me."

I'm very happy to see the case being made for static typing. Dynamic types should be niche, and eventually they will be. Rails and Python only made them popular out of a reactionary minimalism thanks to types done wrong in C++ and Java ecosystems. New developers should read articles like this very early on. The more often they're written and posted, the sooner we can all move on from unnecessary type errors.

sshine•3h ago
After writing a lot of Nix in the last year, it has opened me to possibly switch to Scheme.

I’ve always been a strong static type guy since 1st year of university, and yes, it ties to perfectionism and even a sense of OCD: if I model the world around me, I can relax.

But here’s a take that I’ve been trying to articulate about Nix: it’s not about the static types. Nix is loosely typed, and if there is a functional language that doubles as coping strategy for recreating a quasi-perfect model of the world, it’s Nix.

So I believe any strong modelling combined with declarative syntax can be argued is a coping strategy for autism. It’s not strictly the types.

It also happens that software made this way is more reliable, breaks less.

Maybe the opposition to its use in businesses is that business needs often change rapidly, and tying yourself to any correct understanding of the world means you’re late to the party.

(I’ll then argue: there are companies that succeed at strong modelling, and companies that succeed at pivoting, and all companies need a bit of both at different times. That’s why huge companies with scaling problems and infinite runway pick Rust, and startups pick JavaScript.)

wiseowise•52m ago
> So much for "without judgement".

Previously author felt enlightened by sneering on stupid normies for not understanding beautiful, clean™, statically typed code.

What’s better way to show how better you’re now, that you’ve reached new nirvana, by sneering on ivory tower wizards with their arcane languages that are obviously a sign of autism (because whoever is different from, and possibly smarter than, you is obviously autistic)?

90s_dev•4h ago
> Give them time and relevant experience, and they will arrive at the same conclusions:

What does this say about DHH then? He's got decades of experience yet ripped TypeScript out of his codebase angrily, preferring the foggy mystery that is dynamic types. Is he a legitimate outlier? If not, then wouldn't you have to conclude he's just a really bad programmer?

goda90•4h ago
I work in software where bugs can be very disruptive for the end user's very important job. Typescript was a godsend over JavaScript. I've blamed issues on changes where the developer clearly didn't grok the area they were changing. And I've witnessed dependency hell slowing down the development process. I've come to the conclusions OP did from professional experience that provides negative feedback, not some past psychology from my personal life.

There are certainly cases where you wouldn't get that negative feedback for your software, so you would never feel the need for those things. And maybe in that case you can move faster without them, but you should be careful taking those beliefs into other domains.

keithasaurus•4h ago
static types: here's what this piece of data is

dynamic types: go look through code, tests, comments and project history to try figure out what this data is supposed to be

dynamic types are exhausting

dleeftink•4h ago
Exhausting, yes, why would we need to prep our own meal if it can be served to order?

Types are needed for sure, but don't make up for the fact we have to prep our own meals from time to time, even the best recipes don't cover all variations.

theLiminator•4h ago
In general though, a strong statically typed language will allow the user to locally reason to a much greater extent.
keithasaurus•4h ago
For me the variation is one of the places where dynamic typing gets really dangerous, because as variations increase, the requirement for code archaeology does as well. At some point there is enough variation that nobody could reasonably be expected to do enough code exploration to understand the full breadth of that variation.

With types, the scope of the variation is clearly stated, and if you want to expand the variation, it should be clear how to do so, depending on the flavor (e.g. union types, sum types, generics, sub types).

dleeftink•1h ago
It's definitely easier to extend existing recipes than having to start from none. What I tried to get at, is that even with in-depth recipes, there's a bigger codebase picture behind the type, that GP found exhausting navigating without.

I think if we start to lean on types for our all recipes, we may forget how to prepare them without instruction.

williamdclt•3h ago
If there’s a lot of variations that’s exactly when you need help from typing to not mess things up.

If the modelling is trivial, the ROI is much lower (although the devx benefits still make it worth it to me)

igouy•4h ago
static types: write types into the code to make the compiler happy, when trying to think about more important stuff

dynamic types: method parameter name gives the type and comment gives the method return type — conventions show what data is supposed to be

static types are disruptive and exhausting :-)

declan_roberts•4h ago
The author is 100% right when he says that personality has a big affect on programming preferences.

I see this play out in language preferences every day, INTJ (haskell, rust) and ENTJ (Golang, Java, Python).

Giving a list of the "best 3" programming languages can probably map you very accurately to a Meyers-Briggs personality.

throw4847285•4h ago
Unfortunately, MBTI is bunk so we'll have to discover a new personality schema that explains people's programming preferences. One may exist, but it won't be a series of binary divisions of normally distributed traits.
RetroTechie•1h ago
640B parameters should be enough to classify everyone's personality.
igouy•32m ago
2018 "Scientists determine four personality types based on new data"

https://news.northwestern.edu/stories/2018/september/are-you...

bpshaver•4h ago
I would love to read the steel man case for dynamic typing, but "static typing is for people who need therapy" isn't doing it for me. Anyone have something to recommend so I can understand the intended benefits of dynamic typing?
bryanlarsen•3h ago
My attempt: "These dynamic languages are so much more pleasant and productive than Java 1.X."
lisper•3h ago
> I would love to read the steel man case for dynamic typing

It's very simple: sometimes lower development effort matters more than correctness. Not all software has to run in a hostile production environment to be useful.

bpshaver•2h ago
That would seem to be begging the question to an extent. Why does dynamic typing lead to lower development effort? I mostly write Python and make heavy use of type hints. With LSP set up, mypy informs me immediately of any potential type errors which makes development way easier for me.

Just saying "dynamic typing is easier" doesn't do it for me without further qualification since that statement doesn't conform to my own experience.

doug_durham•1h ago
How much is maintaining your type system really helping you out? I find I spend more time tracking down irrelevant type warnings than fixing type issues. For example if you declare a type hint on a function parameter as `foo: int = None` you will get a type error. It says that a parameter of type int can't have a None value. This is false. So now I have to update my declaration to be `foo: Optional[int] = None`. This yields no value because when you say `= None` you are saying that this is an optional argument. The more you tighten your type declarations the more you will be chasing non-existent issues.
bpshaver•1h ago
No offense, but this sounds like user error. I rarely have irrelevant type warnings. If I do, it suggests something is wrong with my design.

If you declare a function parameter as `foo: int = None`... that is just an incorrect declaration. Of course a variable annotated as `int` can take a `None` value, but that is because any variable can take any type in Python. Within the Python type (annotation) system it is simply the case that an `int` and an `int | None` are two different things, as they are in other languages (eg Rust's `T` vs `Option<T>` types).

Mypy used to support the "implicit optional" feature you describe but now you must make nullable arguments explicitly optional. This is in line with Python's "explicit is better than implicit" design philosophy. In any case, how long does it take you to just type `foo: int | None = None`? Or you could re-enable the old behavior to allow implicit optionals with `--implicit-optional` or the corresponding config file option. It seems like you just need to configure mypy to match your preferences rather than fighting with its defaults.

To return to the broader point, I'm unsure what an "irrelevant type warning" is, but I suspect that has something to do with my lack of appreciation for dynamic typing. Can you give an example that isn't just a complaint about typing an extra 6 characters or about mypy being misconfigured for your preferences?

doug_durham•1h ago
No offense taken. I've had a long career with many different phases. I had a phase where I built palaces of types bordering on DSLs. I ended up building myself a straight jacket. I wasn't solving the customer problem, and I was only slowing myself down. Software is an engineering discipline. Every situation needs to be critically evaluated. Building a life-critical single point of failure component is much different than building a road over a culvert. In early languages you needed to specify types so the compiler knew how much space to allocate for storage. In languages like Python, type hints are more like documentation. It helps the reader understand how to use your code. It can be used for correctness. However if correctness is a primary criteria driven by engineering requirements I'd probably consider another language and accept that it is going to cost more and be slower to develop.
dragonwriter•1h ago
> For example if you declare a type hint on a function parameter as `foo: int = None` you will get a type error. It says that a parameter of type int can't have a None value. This is false.

No, it is correct. The value None is not with the domain of type int, a parameter that can take the value None does not in fact have type int.

> This yields no value because when you say `= None` you are saying that this is an optional argument.

When you provide any default value, you are making the argument optional, but that's an orthogonal concern to the Optional[T] type, which doesn't mean “optional argument", it is simply a more convenient way of expressing Union[T, None], though with the modern type syntax, T | U is generally more convenient than either Union[T, U] or Optional[T] for U=None.

lisper•1h ago
> Why does dynamic typing lead to lower development effort?

Because you can run your program to see what it does without having to appease the type checker first.

There is nothing wrong with presenting type hints or type errors as warnings. The problems arise when the compiler just flat-out refuses to run your code until you have finished handling every possible branch path.

bpshaver•1h ago
What is an example of a compiler that flat out refuses to run (compile) your code? Obviously Python is not an example. The other language I know best is Rust, where as I understand the compiler doesn't refuse to compile your code, it cannot compile your code. Is there a language where the compiler could compile your code but refuses to do so unless the types are all correct?
Jtsummers•1h ago
Not that you should ever write this in any language, but as an illustration:

  fn main() {
    let x: i32 = if true {1} else {"3"};
    println!("{}", x);
  }
This will not compile even though if it were allowed to execute it would, correctly, assign an integer to x. Python will happily interpret its equivalent:

  x = 1 if True else "3"
  print(x)
Even giving the if-expression an explicit `true` constant for the condition, Rust won't accept that as a valid program even though we can prove that the result of the expression is always 1.
lisper•1h ago
> the compiler doesn't refuse to compile your code, it cannot compile your code

"Can not" and "will not" are kind of the same thing in this context. It's not like compilers have free will and just decide to give you a hard time. It's the language design that makes it (im)possible to run code that won't type-check.

steveklabnik•1h ago
Haskell has -fdefer-type-errors, which makes any type error fail at runtime.

This means you can only really rely on the parts of your program which are type correct, so...

igouy•1h ago
>That would seem to be begging the question …

Please excuse my pedantry: That would seem to lead to the question …

AnimalMuppet•3h ago
1. Dynamic typing says "anything I can do these operations on, I accept as input". This lets you accept input from code that doesn't have something that fits the strict definition of what input you were expecting.

2. Dynamic typing lets you change what shape your data is without having to change type annotations everywhere.

Problem is, I think both of these are deeply flawed:

1. If you're writing something nontrivial, you probably have several layers of nested function calls, some of which may be calls to libraries that are not yours. If you're saying "anything I can do these operations on, I accept", it becomes very difficult to say what the full extent of "these operations" are. Thus it becomes hard to say whether the caller is passing in valid input. You can "just try it", but that becomes hard if you care about it working in all cases.

2. Refactoring IDEs are a thing these days. You want to change the type signature? Press the button. Even better, it will tell you everything you broke by making the change - everywhere where you're doing something that the new type can't do. Without types, sure, you can just change it without pressing the button. Now try to find all the places that you broke.

It may be possible to construct a better steelman than I have done. For myself, even trying to steelman the position, I find it incredibly unconvincing.

igouy•2h ago
"Static typing is a powerful tool to help programmers express their assumptions about the problem they are trying to solve and allows them to write more concise and correct code. Dealing with uncertain assumptions, dynamism and (unexpected) change is becoming increasingly important in a loosely couple distributed world. Instead of hammering on the differences between dynamically and statically typed languages, we should instead strive for a peaceful integration of static and dynamic aspect in the same language. Static typing where possible, dynamic typing when needed!"

https://ics.uci.edu/~lopes/teaching/inf212W12/readings/rdl04...

igouy•2h ago
> Without types … Now try to find all the places that you broke.

Do failing tests show what we broke?

bpshaver•2h ago
Sometimes, but maybe you haven't written any tests! Type hints and immediate feedback from mypy are a lot easier than writing unit tests.
igouy•43m ago
> haven't written any

Any!

Then maybe the immediate feedback of consistent types conveys a false impression.

bpshaver•2h ago
But you can achieve #1 with typing.Protocol in type-annotated Python and traits in Rust. Fitting the "strict definition" sounds like nominal typing but you can opt in to explicit duck typing or structural typing while still being typed. (Someone correct me if I'm using these terms incorrectly.) In short you can still encode a lot of flexibility with types without just abandoning them alltogether.

And with #2, you can get that with static typing too... Let's say a method accepts an instance of an object `Foobar`. I can change the definition of `Foobar` ("change what shape [my] data is") without having to change type annotations everywhere.

I agree with you, I guess, that I find the steel man position unconvincing.

igouy•59m ago
Refactoring IDEs were a thing back in the day.

"Less than 35 bugs were found in the 17,100 changes."

https://news.ycombinator.com/item?id=42473314

Jtsummers•1h ago
The way I see it:

Your type system is sound or complete (cannot be both, if it's a Turing-complete language). If it's dynamically typed, then it's probably complete but not sound (many, but not all, dynamically typed language implementations have some basic static type checking). If it's statically typed, it can be either sound or complete. The difference between sound and complete is: Sound type systems will reject valid programs that they cannot prove are valid; Complete type systems will reject only those invalid programs they can prove are invalid.

In practice, the choice is more one of default these days:

Do you default to static typing and allow some dynamic (runtime) type checking? C++, C#, Java, etc.

Do you default to dynamic typing and allow some static (compile-ish time) type checking? Python, JS, Common Lisp, etc.

This lets both sides have what they really want. They want to be able to express all valid programs (a complete type system) but they want to reject all invalid programs (a sound type system). They can't have it. So you end up choosing a direction to approach it from. Either start conservatively and relax constraints, or start liberally and add constraints.

If you accept that, then the case for dynamic typing is that it's a choice to move from the too permissive extreme towards a stricter position. For me this works better (in general, though I also happily use statically typed languages like Ada) because I find it easier to add constraints to a relaxed system than to remove constraints from a restrictive system.

adamnemecek•3h ago
Types give you speed, correctness and better tooling. Dynamic typing supposedly gives you "authentic self". I think I'll pick the former.
dkarl•3h ago
The author seems obsessed with what their code says about them personally, and only mentions other people to discuss other points of view on this question. At no point do they say anything about how working with other people influenced their thinking about programming or their technical preferences. In fact they only mention peers a single time:

> I met many people whose programming approach was my polar opposite.... I don’t have any issues with their way, as long as we don’t work on the same system

Being obsessed with what your code says about you is a concern that competes with and inevitably detracts from other desirable outcomes. This is true even when working by yourself, but it is especially true and especially obvious when working with other people.

alabhyajindal•2h ago
So many comments about static vs dynamic typing whereas the article barely discusses that. I loved reading this - very well written!