C coding style

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: C coding style

Post by Love4Boobies »

I'm sure spaces will win with no trouble.
Solar wrote:
Love4Boobies wrote:Pointer declarations ( int * a ) vs. dereferencing "( *a ) is a bad idea. The declaration syntax mimics expressions on purpose, I thought we were running away from edge cases. Next thing you know, we're either going to have to do stuff like ! b or char a [MAX]; --- I say we revert this.
There is the age-long discussion on int* b (grouping the type, avoiding errors in multiple pointer declarations in a comma-separated declaration list) vs. int *b (declaraction mimics use). I always felt that int * b was deflating that particular argument nicely... are you sure about that revert? You'll get right back into the discussion with any int* b advocates around?!?
This is similar to the problem regarding braces, where you chose to invoke a different argument :P int * a; is a third possibility so it doesn't really help regarding said age-long discussion.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: C coding style

Post by Combuster »

Love4Boobies wrote:I don't know about you, but most of us here don't agree with copypasta.
I don't know about you, but I don't suffer from that disorder called NIH.

Seriously, you need to learn how to argue. There is a whole lot of grey area between the cargo cult and your type and you're just abusing an hasty generalisation to force your point. Moreover, I've seen more arguments based on fallacies, false information and subjective opinions from you than anything philosophy calls legal. Should I just call you a troll and exclude you from the discussion (and with that, further influence on the style guide)?
Last edited by Combuster on Fri Jul 01, 2011 8:34 am, edited 1 time in total.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: C coding style

Post by Solar »

\me bangs the hammer a bit louder... :twisted:
Every good solution is obvious once you've found it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: C coding style

Post by Love4Boobies »

Combuster wrote:
Love4Boobies wrote:I don't know about you, but most of us here don't agree with copypasta.
I don't know about you, but I don't suffer from that disorder called NIH.
Troll.
Seriously, you need to learn how to argue. There is a whole lot of grey area between the cargo cult and your type and you're just abusing an hasty generalisation to force your point. Moreover, I've seen more arguments based on fallacies, false information and subjective opinions from you than anything philosophy calls legal. Should I just call you a troll and exclude you from the discussion (and with that, further influence on the style guide)?
Troll.
Solar wrote:\me bangs the hammer a bit louder... :twisted:
We need a bigger hammer, hehe.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: C coding style

Post by Solar »

Just don't feed each other, and everything will be fine.

{bang} {bang} {BANG}

Session closed.
Every good solution is obvious once you've found it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: C coding style

Post by Solar »

Solar wrote:Session closed.
I added the appropriate astyle options to the Wiki for those who don't feel like reformatting stretches of source manually.

Is this ready to be pushed into the Wiki's global namespace, or do we have open issues (syntax style guide wise)?
Every good solution is obvious once you've found it.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: C coding style

Post by gravaera »

I am a vengeful supporter of tabs: I will never let it go :evil:

You will never escape my fury and I am never gonna give you the chance to rest up; I am personally never gonna cease this strife! Let it be known, I will hunt you down. I am never gonna let you all run around editing the Wiki with spaces and deserting the just way of the tab; I won't let you! I am never gonna permit the way of the tab coder to become a thing of the past. I will make it gloriously return, and see you all cry. I'm never gonna stop! Say goodbye to the accord you all think you have created, for I tell you, it is a lie and it will come back to hurt you!

We may have known each other in this community for years; a time so long, that your hearts may have bonded together and you have all been aching for peace, but you're all too naive to know the real extent of my tenacity. Shy away from the way of the spacebar to walk the path of the righteous tabber; Say it: You shall stand for the way of the tab. I probably seems like we should all settle down and agree on spaces, but both sides know that tabs are superior; what's to be done about it? I've been going on about what we should do! Know that the only true peace would be to end this game! And for as long as we're gonna play it, an agreement will never be reached.

I just wanna let you all know that the tell tale sign of a dictatorship is when the leaders of the fascist side make you think that you have a say. How? They may use a poll, or some other mechanism. Do you see what I'm saying? I have a feeling that poll was rigged! I wanna make sure we all at least have a fair vote. Understand, you tyrannical that I'm going to stand 'till the end. Again I say:

You will never escape my fury and I am never gonna give you the chance to rest up; I am personally never gonna cease this strife! Let it be known, I will hunt you down. I am never gonna let you all run around editing the Wiki with spaces and deserting the just way of the tab; I won't let you! I am never gonna permit the way of the tab coder to become a thing of the past. I will make it gloriously return, and see you all cry. I'm never gonna stop! Say goodbye to the accord you all think you have created, for I tell you, it is a lie and it will come back to hurt you! :twisted:
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: C coding style

Post by Love4Boobies »

Is there any phpBB option to perform a breathalyzer test before logging in? :)
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: C coding style

Post by Solar »

gravaera wrote:I am...
...ignored. :twisted:

Just as I would have bowed to the vote had there been a majority for tab indenting, so I expect you to bow under the yoke of the space-indenting style guide. Such is the tyranny of democracy. :twisted:

Nicely written rant, nevertheless. :lol:

Post Scriptum: I found a tiny little point-in-case for space indenting just now. You know "javac", the Java compiler? The one that prints compiler error messages including the offending source line and a little caret ('^') under the exact point where the error occurred?

Guess what: The caret isn't in the right position if your source is tab-indented. No matter what your tabs are set to. :twisted:
Every good solution is obvious once you've found it.
User avatar
Neolander
Member
Member
Posts: 228
Joined: Tue Mar 23, 2010 3:01 pm
Location: Uppsala, Sweden
Contact:

Re: C coding style

Post by Neolander »

Looks like gravaera is never gonna give you up :P
Post Reply