• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Tidying up code

AFB

Lifer
I have a PHP file that already has 8 functions and is already unreadable. Anyone have links to making your code better organized and easy to follow ?
 
What ever happened to the old rule of thumb that a function could cover no more than two pages?
 
Its not the amount, its that I saw some where where there was a certain way to document methods and functions. Anyway I stuck most of it in to a class and it works better logically. The documentation was like @propertyorsomething value. I could not find it on the PHP documentation but I have seen it in a lot of code. It looks much better than using regular comments.
 
You might be refferring to PHPDocumentor.
Also, if your code is "unreadable" make sure you are following "proper" programming formatting, indenting lines, commenting, spacing, etc - some IDE's let you make some sloppy code.
 
Originally posted by: BingBongWongFooey
Sounds like doxygen actually.

And Armitage, tisk tisk 😛

shrug ... I was referring to my C++ Vector and Array classes. I don't see them as "monolithic" or "overdesigned". There's just a ton of operators and functions for that stuff, many of them overloaded. My main astrodynamics class probably has close to that many also.
 
Just counted em out of curiosity
Vector: 91 methods
Array: 90 methods
Astro: 126 methods

And yea, doxygen is a great tool. Most of my projects use doxygen.
 
Back
Top