11
dbman
Re: Coding Standards
  • 2009/3/8 22:32

  • dbman

  • Friend of XOOPS

  • Posts: 172

  • Since: 2005/4/28


yes zend studio and eclipse both have configurable code formatters built in.

12
Catzwolf
Re: Coding Standards
  • 2009/3/9 2:25

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


With all due respect, but it will take a lot more than a code beautifier to actually to give the code some decent standard. The problem is not just that the code doesn't follow standards but its just a complete and utter mess in some area's.

For example: If you ever take a venture into the blocks admin area, you will soon understand that the readability of this is terrible. Plus add to that the confusion of having two classes just to deal with it, and rather than using the kernel class mechanism to deal with deletes, saves and updates, it uses the other version in the class folder. Not good.

Xoops is the only framework that I know that doesn't have a class or method dedicated to input filtering, instead we leave it to the developers discretion and that doesn't always yield the best result.

But, anyway, this discussion will almost seem defunct since DJ is writing version 3 and there should be a class to deal with this. Well, I hope so anyway.

13
Catzwolf
Re: Coding Standards
  • 2009/3/9 2:26

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


So does phpedit.

14
Mamba
Re: Coding Standards
  • 2009/3/9 3:22

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Quote:
With all due respect, but it will take a lot more than a code beautifier to actually to give the code some decent standard. The problem is not just that the code doesn't follow standards but its just a complete and utter mess in some area's.

Agree. But the first step would to have consistency of formatting. Then the next step would be to address the mess, which probably would be even more visible, once we have consistent formatting. Just a thought...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

15
Catzwolf
Re: Coding Standards
  • 2009/3/9 6:04

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


I would suggest that this could be done at the same time, it would be easier for readability and format if the code were address correctly. Basically, you would be giving yourself two jobs to do. Dealing with the messy code would sort out the code formatting.

16
phppp
Re: Coding Standards
  • 2009/3/9 10:13

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Quote:

trabis wrote:
http://xoops.svn.sourceforge.net/viewvc/xoops/XOOPS_Coding_Standards.html?revision=2554&pathrev=2909

It is not clear to me in the "Functions example"(maybe because the example is a class method).

Someone can tell me what it is the correct way to declare a function?

function publisher_getConfig($key) {
    
$configs publisher_getModuleConfig();
    return 
$configs[$key];
}


or

function publisher_getConfig($key
{
    
$configs publisher_getModuleConfig();
    return 
$configs[$key];
}


Thanks.






The second one is the one suggested in "XOOPS Coding Standards".

17
Catzwolf
Re: Coding Standards
  • 2009/3/9 10:17

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


I already told him that

18
phppp
Re: Coding Standards
  • 2009/3/9 10:31

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


:)

BTW: using single quote or double quote, performance difference, which is not significant enough, is not the concern, but eadability and coding style consistency.

19
Catzwolf
Re: Coding Standards
  • 2009/3/9 10:40

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


When dealing with a script as large as Xoops, every little bit you can squeeze out of it to gain better performance is always welcome.

40 ways to speed up your code

And I agree coding consistency is important and is something that developers here should discuss at some degree.

20
zyspec
Re: Coding Standards
  • 2009/3/9 15:30

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


I agree w/ catz... each coding standard should be evaluated for consistency and speed - not just one or the other. I'd be willing to develop my XOOPS modules using a coding standard even if the standard isn't my 'preference' provided it makes sense at some level and were consistent.

Theoretically it would help me be more efficient at read the core and make other developers more efficient when trying to understand my spaghetti code

I wouldn't mind seeing the core coding standard but I can't see it since I'm not a core developer, and it's only available to core developers. Is there an updated, equivalent for modules somewhere?

Login

Who's Online

248 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 248


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits