TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The reasons why Golang is a bad language, according to my friend

6 点作者 avestura超过 1 年前

1 comment

PaulHoule超过 1 年前
It has been fashionable since 1992 to complain about OO programming and around that time hate for exceptions started to grow. Half of it was that exceptions had a broken implementation in C++, half of it was a reflexive rejection of anything having to do with Java. (Is it a lost opportunity that they didn’t fill Java up with really bad ideas to get them rejected by the community.)<p>In the 1980s I remember looking at good C code and thinking, gee, correct error handling bloats code by 2x or 3x and it is not the ceremony and superfluous agreement of Java which the compiler helps you maintain but instead it is devilishly complex and any mistake in it is likely to go untested. (e.g. and if you did actually write automated tests again you’d probably have to 2x or 3x the code again to get in mocks.)<p>I had an engineering manager who thought error handling in Scala was great with monads and also boasted that his team did rigorous code reviews but when I got my hands in the code I found it was like bad C code from the 1980s, the facilities to do error handling were there but people weren’t using them. Errors just got ignored, so our data analytics system would just give wrong answers.<p>Exceptions, in the other hand, do something sane automatically and don’t make your code unmaintainable by building an elaborate error handling machine that is closely interspersed with your code. It is such a terrible step backwards to give up on exceptions.
评论 #39030117 未加载
评论 #39029318 未加载