I am more practiced in PHP than in Java, and when I use Java I find myself looking at it from a PHP perspective. This can cause trouble, so I'd like to know, what are the most common programming mistakes PHP programmers make in Java?
|
Perhaps slightly flippant, but after bingeing on PHP for many years (it pays the bills), I've often been happy to be able to use crazy things like enumerated types and native data types that aren't arrays/objects playing dress-up. Whilst a sweeping generalisation (the best ones always are), I guess what I'm getting at is that perhaps the most common mistake is to remain in the PHP mindset and not take advantage of the features that the language offers. |
||||
|
I'd say the biggest mistake I've seen is approaching Java, which is OOP, with a procedural mindset. Methods to a PHP person look like functions, and the main method (or constructor) looks like the procedural part of PHP. So you end up with entire programs existing in 2 giant classes with thousand line long methods. As a PHP dev who made the move to Java, I can say that it is difficult. But of course this is the case with any move from a procedural language to an OOP language |
||||
|
A few things I notice:
|
||||
|