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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What is the worst code you have seen at work?

2 点作者 Flex247A将近 4 年前
I wrote a simple game for CS project last year, and it was pretty bad. All logic was opaque, and there were tonnes of global variables!

3 条评论

suramya_tomar将近 4 年前
There were 2 function&#x27;s called something like convert2Upper and Convert2lower (Don&#x27;t remember the exact names) in Java that took a string broke it into characters and for each char did the following:<p>If (InputStr[$i] == &#x27;a&#x27;) InputStr[$i] = &#x27;A&#x27;; If (InputStr[$i] == &#x27;b&#x27;) InputStr[$i] = &#x27;B&#x27;; .. .. If (InputStr[$i] == &#x27;z&#x27;) InputStr[$i] = &#x27;Z&#x27;;<p>Written by someone with over 5 years &#x27;experience&#x27;.<p>- Suramya
jimmyvalmer将近 4 年前
The code you wrote five years ago.
评论 #27247248 未加载
Flex247A将近 4 年前
Similar thread in 2018: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18442637" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18442637</a>