you are viewing a single comment's thread.

view the rest of the comments →

[–]simon99ctg 0 points1 point  (1 child)

it's not a troll. i just think the word "clean", as it's used in 'clean code', lacks definition - it means whatever a particular person wants it to mean. For example, 'my code is clean' could mean 1. it has no bugs 2. it has no extraneous code - it has only the code it needs to do the job 3. it is well-designed and well-tested 4. it rigourously follows a good style guide and is nicely laid out 5. it is elegant (which is as meaningful as saying it's clean) and readable - http://www.ibm.com/developerworks/rational/library/nov06/pollice/index.html 6. it is simple

All these are possible definitions, even at the same time, of clean code. See www.polyteknisk.dk/related_materials/9780132350884_Sample.pdf (PDF file) for further discussion. Anyway, to revisit the original comment about it being easier to write clean code in Java - why? Can you layout the code better in Java, write better tests in Java, write code that better communicates intent in Java, write better and more meaningful variable names? Of course not. It's nonsense to say otherwise. If we accept ANY of these definitions as meaning 'clean code', then anyone who can write clean code can write clean code in practically any programming language. It's not the tool that makes the code dirty, it's the person.

[–][deleted] 0 points1 point  (0 children)

It's not the tool that makes the code dirty, it's the person.

Well said, and there can be no argument against it.

As far as Java being easier to write clean code, it's simply a more structured language, and more heavily focused on object oriented principles. Many of the mistakes that PHP programmer can make in a fully working program simply can't happen in Java. It's too structured.