在软件开发的历史长河中,总有一些代码库因其独特的设计和复杂性而成为程序员们的谈资。近日,一位资深软件开发者Jimmy Miller在博客上分享了他早年遇到的代码库,该代码库存在SQL Server设计缺陷、缺乏版本管理等问题,这些问题不仅暴露了代码库的“常识性”缺陷,也引发了一番关于软件开发中常见问题的热烈讨论。
据Jimmy Miller所述,他所遇到的代码库中,最令人头疼的问题之一是数据库设计。在该公司的大型遗留系统中,数据库不仅承载着存储数据的重任,更是公司文化和系统运行的基石。其中,最为人诟病的是对单个表列数的限制。SQL Server对于单个表中所能容纳的列数有一个上限,当时是1024列,而他们的“merchants”表早已耗尽了这一配额,不得不添加“merchants2”来解决。
此外,该代码库中的“SequenceKey”表也让人印象深刻。这是一个只有一行一列的表,其作用是生成ID。Jimmy Miller表示,当时他们听说SQL Server不支持自动递增ID,但实际情况是,SequenceKey表在存储过程中扮演着关键角色,负责获取键、递增并插入ID,成为实体表之间的隐性连接。
更让人哭笑不得的是,该公司的登录系统竟然依赖于一个名为“日历”的表,而该表的内容是手动填写的日历信息。几年前,日历用尽导致系统无法登录,公司因此让一名实习生续写了五年的日历。此外,员工表每天早上7:15会被删除,之后需要从adp的csv文件中上传数据,这期间系统无法登录。如果这个过程失败,还需要管理员手动复制数据。
尽管存在这些问题,公司也意识到需要清理数据库,因此保留了一套副本,但同步是单向的,且数据仅比实际应用版本旧10分钟。销售人员用于记录绩效目标的表格也非常复杂,需要专人手动同步,但后来有人发现可以手动更改这些记录,这引发了争议。
Jimmy Miller的故事在程序员社区中引起了共鸣,很多开发者都在评论区分享了他们遇到的奇葩问题。虽然这些代码库的问题让人头疼,但也从侧面反映了软件开发过程中的挑战和乐趣。对于那些正在开发或维护老旧系统的开发者来说,这些故事无疑是一个提醒,要不断学习和改进,以应对未来的挑战。
英语如下:
Title: “Exposed: The Worst Code Library in History – The Dev’s Deadly Revelation”
Keywords: Code Nightmare, Database Limit, System Crisis
Content: In the long history of software development, there have always been code libraries that have become subjects of discussion among programmers due to their unique design and complexity. Recently, a seasoned software developer, Jimmy Miller, shared on his blog the code library he encountered in his early days. This code library was plagued by SQL Server design flaws and lack of version management, among other issues, which not only exposed the “commonsensical” deficiencies of the code library but also sparked a heated discussion about common issues in software development.
As Jimmy Miller described, one of the most vexing issues in the code library he encountered was the database design. In the company’s large legacy system, the database was not only responsible for storing data but also served as the cornerstone of the company culture and system operation. Among the most criticized aspects was the limitation on the number of columns in a single table. SQL Server had an upper limit on the number of columns in a single table, which was 1024 at the time, but their “merchants” table had already exhausted this quota, necessitating the addition of “merchants2” to resolve the issue.
Additionally, the “SequenceKey” table in the code library was also notable. This was a table with only one row and one column, designed to generate IDs. Jimmy Miller stated that at the time, they had heard that SQL Server did not support auto-incrementing IDs, but in reality, the SequenceKey table played a critical role in stored procedures, responsible for retrieving keys, incrementing them, and inserting IDs, acting as an implicit connection between entity tables.
Even more amusing was the fact that the company’s login system relied on a table named “Calendar.” The content of this table was manually entered calendar information. Several years ago, the depletion of the calendar led to system login failures. The company then tasked an intern with writing five years’ worth of calendar entries. Moreover, employee records were deleted every morning at 7:15 AM, and then needed to be uploaded from ADP’s CSV files, during which the system was unable to handle logins. If this process failed, administrators had to manually copy data.
Despite these issues, the company recognized the need to clean up the database and thus retained a copy, but the synchronization was one-way and the data was only 10 minutes older than the actual application version. The forms used by salespeople to record performance targets were also extremely complex and required manual synchronization by a specialist. However, someone later discovered that these records could be manually changed, which sparked controversy.
Jimmy Miller’s story resonated with the programming community, and many developers shared their own bizarre experiences in the comments section. While the issues in these code libraries were a source of frustration, they also highlighted the challenges and joys of the software development process. For developers who are currently working on or maintaining legacy systems, these stories serve as a reminder to continue learning and improving to meet future challenges.
【来源】https://mp.weixin.qq.com/s/9LXcf6FMp45vmTOU5OurCg
Views: 1