Coding Guidelines

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Evilus
Posts: 387
Joined: Mon Jun 09, 2008 6:08 pm

Re: Coding Guidelines

Post by Evilus »

I must say that most of these guidelines are pretty good. I have seen on svn people remove { }from if statements that just had 1 line, but that is wrong they should be there, there are many more examples. Very nice initiate to post this
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Coding Guidelines

Post by jurchiks »

well, since i have only c5 source atm, i checked that one and it's really tidy imo
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Coding Guidelines

Post by janiii »

the l2j code is really messy, i agree. but it is not that easy. if i change a code, i better do not format it too, because then mostly noone could see the real changes i made. probably only a full format of the code, without any fixes or changes should be done, but sometimes also the code format messes up the code. a proper format setting is needed.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Vapulabe
Posts: 271
Joined: Wed Mar 19, 2008 10:16 am

Re: Coding Guidelines

Post by Vapulabe »

I don't know if it works under Java... But under C, we have the "indent" tool which helps doing massive reformat...

There are few people with SVN Write access, if they agree, they may suspend the changes at some points, have some massive reformatting of the code committed (automatically reformatted + if/for/while braces added) then start again doing changes, based on the new (cleaner) source.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Coding Guidelines

Post by janiii »

Vapulabe wrote:I don't know if it works under Java... But under C, we have the "indent" tool which helps doing massive reformat...

There are few people with SVN Write access, if they agree, they may suspend the changes at some points, have some massive reformatting of the code committed (automatically reformatted + if/for/while braces added) then start again doing changes, based on the new (cleaner) source.
yep, i would agree :) let's do some mess more :P

the most problems make arrays. we have own way to format them and every code format just f*cks that up :(
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Vapulabe
Posts: 271
Joined: Wed Mar 19, 2008 10:16 am

Re: Coding Guidelines

Post by Vapulabe »

Well, code cleaning is done in huge projects like Linux... tell me why it shouldn't be possible with L2J ?
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Coding Guidelines

Post by janiii »

Vapulabe wrote:Well, code cleaning is done in huge projects like Linux... tell me why it shouldn't be possible with L2J ?
when comparing l2j to other projects.. what about sun java source code? check it.. really messy..

but as i already wrote, i am for cleaning up the code (+1), because i still get mad when i see spaces and tabs mixed up, no spaces in if statements or assignments, etc..
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Post Reply