Messy Code
I've been spending a lot of time since the new year doing a 'spring clean' of some of the code I've written. What always surprises me (although perhaps it shouldn't) is that within a relatively short time of writing a piece of code I can revisit it and think 'why the hell did I do it that way!!'.
PHP, at least for me, is a prime example of a language that allows you to go from an idea to workable code in very quick time - and this is generally a good thing - however, the downside is that the code I tend to write isn't always the most thought out. In contrast to a stricter language (e.g. Java), where some thought has to go into code structure, PHP allows you the freedom to write particularly ugly code (and I'm not referring to how it looks on the page) without it ever complaining.
I'm not for a moment saying that PHP is a 'bad' language for allowing this to happen - its my own fault for being a messy coder. This being the case I tend to think that the area PHP could be better served in is that of code tidying/refactoring tools. I need these tools - they are the 'one click solution' to my messy code. To take Java as an example - when I write code (using the Eclipse platform) I have many of these 'one click solutions' at my fingertips - built in code formatters and refactoring tools, the RefactorIT plugin (if I want to go that extra mile) and automatic documentation of code. All of which serve to actively promote the concept of tidy code.
I'm hopeful that now PHP development can be done on the Eclipse platform (using PDT) these tools (or their equivalents for PHP) will slowly become more widespead - and that in time my code will not only be functional - but also fully documented and nicer on the eye.
PHP, at least for me, is a prime example of a language that allows you to go from an idea to workable code in very quick time - and this is generally a good thing - however, the downside is that the code I tend to write isn't always the most thought out. In contrast to a stricter language (e.g. Java), where some thought has to go into code structure, PHP allows you the freedom to write particularly ugly code (and I'm not referring to how it looks on the page) without it ever complaining.
I'm not for a moment saying that PHP is a 'bad' language for allowing this to happen - its my own fault for being a messy coder. This being the case I tend to think that the area PHP could be better served in is that of code tidying/refactoring tools. I need these tools - they are the 'one click solution' to my messy code. To take Java as an example - when I write code (using the Eclipse platform) I have many of these 'one click solutions' at my fingertips - built in code formatters and refactoring tools, the RefactorIT plugin (if I want to go that extra mile) and automatic documentation of code. All of which serve to actively promote the concept of tidy code.
I'm hopeful that now PHP development can be done on the Eclipse platform (using PDT) these tools (or their equivalents for PHP) will slowly become more widespead - and that in time my code will not only be functional - but also fully documented and nicer on the eye.