TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The case against static typing in PHP (2023)

9 pointsby surprisetalk5 months ago

4 comments

exceptione5 months ago
Tony has helped me to become a better programmer in an unexpected way.<p>Years back, as a beginning programmer I got really confused by his other articles. As I was looking for guidance on application design I took him seriously but also noticed that his examples of &quot;good design&quot; were in fact the opposite.<p>Later it dawned upon me that the was doing COBOL in PHP. Those lengthy articles are mostly bad takes, but it is interesting nonetheless to see how strict the last believer sticks to the Old Belief. I would take none of his advice, but still have big respect for his stamina.
scotty795 months ago
I think TypeScript shown that you can have dynamic language with as much or as little static typing as you like.<p>Old common static typing languages felt bad and restrictive and contorting just because typing is hard that when people created them made a relatively simple, underpowered thing which was as complex as they could make. Understanding of types advanced much since then so now you can conveniently and partially add types even to a dynamic language with rich semantics and there&#x27;s very little reason not to as (unitentionally) demonstrated by this article.
评论 #42415860 未加载
qprofyeh5 months ago
Is this still a discussion in 2023? I remember writing phpdoc @type hints in 2013, as that was the de facto way to have intelligent autocompletion in editors back then.
评论 #42416139 未加载
评论 #42415993 未加载
jacketjorge5 months ago
I will never understand how people can say that dynamic typing makes them more productive:<p>&quot;Have you ever changed the type of a function argument and then had to find all usages and change them? Have you ever changed a class and then had to recompile, and redeploy, all the classes that used that class? These are just three of the issues that don&#x27;t occur nearly as often in dynamically typed languages.&quot;<p>If you change the <i>type</i> of an argument you OF COURSE want&#x2F;need to change all usages of that function in <i>both</i> static and dynamic languages - how in the world did you expect sqrt(struct Person) to behave? - but static typing helps you quickly find all those instances so you&#x27;re more productive in making that refactor.
评论 #42416194 未加载
评论 #42416239 未加载