I learned some java first, and now I'm learning PHP. I am not comfortable with how "free" it is, with things like loose typing. I really liked the way java forces you into good practice. Are there any open source web programming languages that are more restrictive than PHP, in the same way java is?
views:
57answers:
1How about... Java? :D
If normal Java-driven frameworks are (for some reason) unacceptable, then how about Google Web Toolkit - you write code in Java (with all the benefits of the language), but the application is compiled to JavaScript, which can be run on any modern browser. Additionally, it performs some optimization, etc - really worth looking into if you are familiar with Java and want to use that language to write "light" web applications.
If I didn't make it clear before: you write code in Java (you can use all the design patterns, object-oriented features, strict typing, etc., the compiler warns you if there are compilation-time errors, there's very mature Eclipse integration and so on), but the application is compiled to JavaScript - no need for Java plugin in the browser (no Java applets whatsoever). The compilation part additionally optimizes and obfuscates the output JS code so you'll get faster and smaller code, then if you wrote it by hand. The server side is up to you - while it is easiest to use Java there (especially with all the cool stuff coming in GWT 2.1), you easily use PHP, RoR or Django (via JSON or XML).