News for hackers. Stuff that matters.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by Taylorious on Tuesday December 10, 2013 @12:40AM (#6879168)
This looks awesome. The code is very clean and well laid out. I am disappointed that there are literally no comments in the source code though. Hopefully he will add comments, because a lot of what he is doing is not super obvious, at least not to me.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by sown on Tuesday December 10, 2013 @02:05AM (#6879386)
I think everything up until main.c:909 is setup. The while look at 909 is an event loop of sorts. Between that and line 1024 is receiving the network code, IIRC. There is some GL code after that to render GL, it looks like.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by frik on Tuesday December 10, 2013 @03:17PM (#6883391)
A similar Minecraft "clone" in C++. The author writes blog articles about the development, very interesting read!

http://sea-of-memes.com/LetsCode4/LetsCode4.html

Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by mistermumble on Tuesday December 10, 2013 @11:02PM (#6885840)
Minetest is a C++ based Minecraft-style simulation with a clean API for modding -- with a nice little ecosystem of mods.

(I am not affiliated with them. I just downloaded it a few months ago and have been tinkering with it.)

http://minetest.net/

Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by fleitz on Tuesday December 10, 2013 @02:19AM (#6879429)
Learn to read code instead of comments. It's super straight forward C.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by eru on Tuesday December 10, 2013 @02:49AM (#6879494)
What the code is doing is clear. The why (and especially the `why not') could benefit from some commentary.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by DigitalJack on Tuesday December 10, 2013 @02:54AM (#6879508)
I wish more programmers understood this concept. Yes, we can read the code for the what, which is why we don't need you to tell us you are adding 2 to X. Why is a different matter altogether, and that is where a comment can shine light on the scenario.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by eru on Tuesday December 10, 2013 @03:00AM (#6879527)
Thanks for elaborating on my thought. The `why not' is often as important (or even more important!) then the `why'.

By `why not' I mean, briefly explain what other alternative approaches there were, and why you chose the trade-offs you went for, instead of some other set.

Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by raverbashing on Tuesday December 10, 2013 @07:09AM (#6880232)
Exactly that

Coders: don't give me any BS like x = x + 1 /* Increment x */

Rather, tell me, if it's not obvious, WHY are you doing that

Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by cobrausn on Tuesday December 10, 2013 @11:55AM (#6881790)
There should rarely be any comments on why x is being incremented unless there is something particularly clever about why. Commentary should be reserved for program blocks where something non-obvious is happening or where something obvious is happening for non-obvious reasons, IMHO.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by kunil on Tuesday December 10, 2013 @08:39AM (#6880602)
To increment x
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by pmelendez on Tuesday December 10, 2013 @09:58AM (#6881023)
Why do you need to increment?
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by bluetshirt on Tuesday December 10, 2013 @10:41AM (#6881302)
Because it needs to be bigger.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by raverbashing on Tuesday December 10, 2013 @12:46PM (#6882222)
Then make it times 2. Or add 5.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by fleitz on Tuesday December 10, 2013 @03:49AM (#6879651)
To me it ruins the surprise, uncommented code is like an uncommented novel, once you've grok'd it the whole thing starts to make sense.

Comments are like coles notes.

It's good as professional courtesy but for personal projects... seems like a waste of time.

Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by zura on Tuesday December 10, 2013 @04:15AM (#6879723)
>it ruins the surprise

Huh? In the first place, I do NOT want any surprise at all.

Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by hobbes300 on Tuesday December 10, 2013 @04:17AM (#6879729)
Until you go back to it in a year's time and can't remember any of the reasons for your design decisions.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by Ntrails on Tuesday December 10, 2013 @08:49AM (#6880646)
Besides, I genuinely find myself hilarious so the attempts at pithy commentary tend to make the whole "christ what was I thinking" part of looking at my old work less painful.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by saraid216 on Tuesday December 10, 2013 @01:21PM (#6882513)
A novel is nothing but comments. The code was already executed in the author's brain.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by forgottenpaswrd on Tuesday December 10, 2013 @03:05AM (#6879535)
I read c or assembler code like I read a newspaper, but comments are needed even in my own code to understand the higher lever design.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by norswap on Wednesday December 11, 2013 @03:51AM (#6886632)
I shouldn't have to do a linear scan of the code to find what I'm searching. Like a book has headlines, code should have comments to indicate what's what.
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by fyolnish on Tuesday December 10, 2013 @01:24AM (#6879301)
Are you a C programmer?
Re:Show HN: Minecraft clone in 2500 lines of C - even suppor... by adamman on Tuesday December 10, 2013 @10:56AM (#6881385)
Maybe her or she should come to your house and explain the code to you one on one.

Install the code and play around with it to see what it does. This person was very generous to make this code public and you are disappointed that it didn't meet your standards.