News for hackers. Stuff that matters.
Re:CivClicker by bshimmin on Sunday June 15, 2014 @02:02PM (#7895827)
The source [0] is kind of an incredible copy and paste achievement. Clearly the author doesn't suffer from the "Last Line effect". [1]

Still, it was sort of fun for a minute or two.

[0]: http://dhmholley.co.uk/civclicker.js [1]: https://news.ycombinator.com/item?id=7858612

Re:CivClicker by dhmholley on Sunday June 15, 2014 @05:59PM (#7896479)
I hope the source isn't too horrible. I was basically a complete javascript novice when I started coding the game. If I were to write it again I'd probably do it very differently, though I still have a lot to learn.
Re:CivClicker by reitzensteinm on Sunday June 15, 2014 @07:12PM (#7896664)
You finished it, which is by far the most important thing. Without that, it doesn't matter what the code looks like because you'd have achieved nothing.

My first Flash game that I wrote in two weeks had some god awful copy pasted code that made me embarrassed to show anyone. But it made six figures over the years and launched what turned out to be a viable career in game development (I've never had a real job).

Code quality is important to work on, but it's just there to help you with the primary goal: shipping something cool.

You got there, so fuck the code. Great job.

Re:CivClicker by makmanalp on Sunday June 15, 2014 @06:50PM (#7896610)
The trick is to reduce parts where you duplicate a lot of code by using generalized functions to abstract things out.
Re:CivClicker by Gigablah on Sunday June 15, 2014 @11:15PM (#7897230)
You got me stuck on your game for two days. I think I might just start coding an incremental game of my own. Cheers!
Re:CivClicker by espadrine on Sunday June 15, 2014 @03:09PM (#7895990)
> * Clearly the author doesn't suffer from the "Last Line effect".*

Actually, he failed to put a comma after the `gold = {…}` expression.

Re:CivClicker by jiggy2011 on Sunday June 15, 2014 @03:58PM (#7896116)
That is nearly 7k lines, what's the chance that it could be re-factored to < 1k with angular/ember?
Re:CivClicker by untog on Sunday June 15, 2014 @04:24PM (#7896199)
Not sure what Angular/Ember would have to do with it. There's just a lot of duplication in there that could be removed without adding the extra bloat of a framework.
Re:CivClicker by jiggy2011 on Sunday June 15, 2014 @04:27PM (#7896206)
Reducing the amount of UI code mostly.