Re: Code beautifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Heyes wrote:
Anyone know of an unintrusive code beautifier written specifically with in mind?

Thanks.

Hi,

I want to narrow down to why I looked into PHP_Beautifier from PEAR.

First, it's written in PHP (and uses the PHP tokenizer at it and not some regex wizardry) and so it's not part of some IDE and therefore you don't need to get used to a new environment.

Second, you can have all sorts of guidelines and call them however it suits you. You can even set up a guideline for each coworker and one main codestyle. You import the code, run your codestyle guideline on it, make your edits and right before the build, you run the main codestyle configuration. Voila, no harm done and everybody is happy.

Third, I wanted it to integrate it into phpUnderControl, so I can run a CodeSniffer and maybe the Beautifier at the end bit of a build cycle if needed, make the documentation, run some unit tests etc. Something you can't do with a IDE Beautifier.

The thing is, I can't read some of my coworkers code because they don't use enough white-space. I get a headache at the end of the day because I can't focus enough and have to read each line 3 times. I hate that. People saying white-space takes bytes in the filesize have a point, but the same people indent to much or awkward or use comments all over the place just for the sake of it.

If your code has enough white-space and clear indenting guidelines, you sometimes don't need to comment in your code at all. I hate comments. Not only writing them, but especially trying to 'read' around them. The code explains a lot and so has the code to be. Comments only get into my way. Put 'documentation' into a document, not in a script. You can even put PHP-doc in a separate file, run the PHPDocumentor at that file and leave your script alone.

I only use PHP_Beautifier to clear up the readability of the code, not to make it look nice (or beauty). If someone has problems with my code having to much white-space, so be it. They can't say it's unreadable, but I can say it about my coworkers code.

So, for now I use PHP_Beautifier and not some IDE tool wich meets only half way and misses the point.

Aschwin Wesselius

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux