Trivia: Irrlicht source's coding style
Trivia: Irrlicht source's coding style
I recently read through Irrlicht source code, and I really like the coding style used, especially the comment style. I wonder if there are guidelines to those coding styles for me (Honestly, I would love to adopt it, because my coding pattern is somewhat radical and chaotic).
Thanks
Thanks
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Trivia: Irrlicht source's coding style
The coding style irrlicht uses is pretty much the recommended way to program in an object-oriented environment, separating the interface of a class from its implementation (with some exceptions to make the devs' lives somewhat easier, like in the ISceneNode class)biloon wrote:I recently read through Irrlicht source code, and I really like the coding style used, especially the comment style. I wonder if there are guidelines to those coding styles for me (Honestly, I would love to adopt it, because my coding pattern is somewhat radical and chaotic).
Thanks
Having good knowledge of object-oriented programming and the concepts behind it should give you enough information to maintain this coding style, and I would really suggest picking up some reading material if you want to study it in somewhat more in depth (I can recommend Object-Oriented Software Construction by Bertrand Meyer)
The commenting format used is determined by doxygen, which is the documentation application used to generate the API reference for the engine
Re: Trivia: Irrlicht source's coding style
I found it ugly, mainly in the placement of {} () [] and the extra spacing inside those. I much prefer the linux kernel style with regard to those parts.
The interface/class separation is not a coding style question, IMHO.
The interface/class separation is not a coding style question, IMHO.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Trivia: Irrlicht source's coding style
You'd be amazed at how many people don't know about thishendu wrote:The interface/class separation is not a coding style question, IMHO.

Re: Trivia: Irrlicht source's coding style
Unfortunately it's impossible to please everyone with the bracket style - you either love it or hate it :-) But the Allman style used in Irrlicht is the prevalent bracket style used in c++ coding while the one true bracket style of the Linux kernel is probably more common in c.hendu wrote:I found it ugly, mainly in the placement of {} () [] and the extra spacing inside those. I much prefer the linux kernel style with regard to those parts.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Trivia: Irrlicht source's coding style
Was almost about to say that linux kernel style wouldnt help you much with c++. Looks like someone beat me too it though.
And yeah the Allman style is prob the best.
But these are just styles anyway, so go invent a new one!
Well one that works and doesn't just look funky...

But these are just styles anyway, so go invent a new one!

Re: Trivia: Irrlicht source's coding style
@ACE247
I'm missing the point in how bracket placing can help in c++
I'm missing the point in how bracket placing can help in c++

Re: Trivia: Irrlicht source's coding style
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Re: Trivia: Irrlicht source's coding style
@Hendu It keeps your mind from drifting when reading code, particularly code you wrote a long time ago... 

-
- Posts: 1
- Joined: Tue Oct 29, 2013 11:05 am
Re: Trivia: Irrlicht source's coding style
Make sure that you start by contributing something which is comparatively small like fixing a bug. The next fact is that don’t use the STL, use the Irrlicht built in containers instead.Make sure that you don’t use special compiler extensions.