Hacker News new | ask | show | jobs
by yoklov 3648 days ago
This is likely accurate. If you look online you can find the original source to LCS[0], one of his older games.

It's basically a single 37kloc file.

Now, ... I'm not really one to say that you should keep all your to one function/class/whatever, i can appreciate the times when splitting things up does more harm than good, and I'm totally comfortable managing a 3-5kloc file.

But goddamn, 37kloc in one file is pushing it.

[0] http://www.bay12games.com/lcs/ (check 3.05, not sure if the later ones got cleaned up, i remember there was some effort by a couple devs to do so but... i don't know how far they got)

2 comments

I had to download this to see it.

The `game.cpp` file is 925kb(!) in size and momentarily choked up my NVim upon opening the file. Hilarious.

Edit: Reading the source code made me want to play the game. The premise is great:

> The Conservatives have taken the Executive, Legislative, and Judicial branches of government. Over time, the Liberal laws of this nation will erode and turn the country into a BACKWOODS YET CORPORATE NIGHTMARE. To prevent this from happening, the Liberal Crime Squad was established. The mood of the country is shifting, and we need to turn things around. Go out on the streets and indoctrinate Conservative automatons.

http://lcs.wikidot.com/JK

EDIT 2: looks like it's still being developed and no longer 1 giant file https://github.com/Kamal-Sadek/Liberal-Crime-Squad

Some roguelike developers and solo game developers in general are notorious for writing code like this. The developer of Ultima Ratio Regum (http://www.ultimaratioregum.co.uk/game/) bragged on Roguelike Radio podcast about how his code base is difficult to deal with because it's a 500K LOC single Python file... He claims it's because he doesn't have a CS background but in practice most developers learn these practices in the industry, academic code is also known for being bad. There's definitely a proud ignorance to this style of programming, he knows he should be doing something else but can't be bothered to take steps that might make him more productive. Not intangibles but basic things like keeping his text editor from locking up or running slow.
500k? You'd have to be scrolling for a week... /s