On Fri, Nov 22, 2013 at 11:58 AM, Markus Teich <markus.te...@stusta.mhn.de> wrote: > Andrew Gwozdziewycz wrote: >> On Fri, Nov 22, 2013 at 5:29 AM, FRIGN <d...@frign.de> wrote: >>> I honestly had to smile when I read the code :). >>> However, I don't consider this good coding-style and there are quite a >>> few areas which could be improved. >>> So Markus, if you want a serious response from us, you maybe should >>> start writing more "serious code" ;). > > So, do you have any hints for me? Sure, i can rename „NYAN“ to „COLOR“, but > this > „joke“ put aside the remaining code still is a serious try. > >> There's so much *constructive* criticism on this list! Can't someone share an >> idea without getting pissed on? >> >> I get that the suckless community is a bunch of elitist blowhards, but >> seriously, come out of your basements, get some sun and love each other once >> in a while. >> >> P.S. - Yes, the code is horrible, but code can be fixed if the idea is good > > I agree. Often i read things like „This is cruel“ or „bad style“, but I can > remember just a few times reading actual improvement propositions. If you > think > it is bad, please tell me why, or what should be done differently in your > oppinion. Just complaining is rude. Well, I can ignore the rude stuff, but we > all waste time with this rudeness and nobody learns anything.
My guess is the biggest objection (certainly mine) is that everything happens in `main` instead of breaking the work down into smaller functions that do one thing. > Is there any GCD of coding style, that we all can agree on? Is there a > styleguide you personally use can recommend? It is quite hard to get better at > coding without some real feedback. And if you don't have time to teach > padawans, > then you should also consider saving yourself some time by not responding at > all. I don't know of a "suckless" approved style guide[0], but I'd guess most people here would tell you to read the C section here at least: http://doc.cat-v.org/programming/ In general, good code is modular, has consistent formatting, and attempts to make complicated processes simple and easy to understand. There's lots of examples of good code out there, but I like to refer people to this one[1]: http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html [0] In fact, I'd bet most people here would be like, "What? Style guide? Suckless is a way of life. We don't need 'guides.' You get it or you don't, man." Then, for good measure, they'd find other people's style guides, and troll them with comments that just repeat "Rob Pike is a god" a million times. [1] Yes, I do recognize the irony.