Discussion in 'Programming & Software Development' started by maskslash, Jul 6, 2006.
Screw em both. If given the option I will take JSP and EJB's any day of the week.
Roll on PHP6...
Sure, stick with what you know.
But good luck finding a cheap Java host...
This article made for an interesting read, since we're kind of on the topic :
I know that’s the problem which is why I end up developing in PHP most of the time because clients are tight and want the cheapest option possible as apposed to the best option possible.
Well JSP is obviously the best option to you. The best option to your clients should (and would most likely be):
- system works
- ease of finding developers for alterations
- cost of development
- cost of maintenance
- cost of hosting
PHP not delivering on any of these? I doubt it, and if so I'd be interested to hear of the problems.
- system works
- ease of finding developers for alterations - less so
- cost of development
- cost of maintenance - due to point 4, less so
- cost of hosting - less so
I used to work for a multinational mobile phone company who redeveloped their content management in JSP. The project was very ambitious, and aimed to replace the currently operational PHP-based CMS in two years.
A year and half into the project it was canned due to the reduced productivity of developers caused by the extra complexity required by using 'enterprise' products such as J2EE, Cocoon and Hibernate compared to a customised CMS engine.
Only one of the 'modules' required to run the CMS was ported to Java in that time. Bearing in mind that the team porting the app were proficient in both Java and PHP (and some of the smartest people I've had the pleasure of working with), it's clear that in the context of that project PHP was the far better option.
My point is that using 'enterprise' products won't necessarily make things 'better' - faster, more maintainable, cheaper to run.
After having a good play with web frameworks like Django (Python based) and Ruby on Rails, it's very hard to take both ASP and PHP seriously as web languages. Sure they're reasonably easy to learn, but after working in the web industry for many years the killer was keeping the code up to date or handing it over to somone else to manage.
I'd suggest looking at Rails or Django for serious web work, they certainly live up to the hype.
You're comparing frameworks (Rails, Django) to programming languages (PHP, ASP). Apples v.s Oranges. It might make sense if you were comparing Rails and Zend Framework, or Django and ezComponents + ezFramework, for example.
Nothing to do with the language.
Yawn, apples to oranges. CakePHP and other frameworks (such as those suggested by GreenBeret) do the same job.
I realise this, but the guy is looking for a language to learn and (IMHO) both PHP and ASP aren't as suited to web development as Django / Rails. Yes I know they're frameworks not specific languages but it's a valid comparison for ease of learning. You don't even need to understand a huge amount of Ruby or Python to get either of them working, nor do you have to understand any SQL.
It has everything to do with the language. Ever tried to do large amounts of maintenance on Fortran? What about Ada? The language makes a big difference, I've been employed as a programmer for nearly 10 years now and maintain software with over 100,000 lines of code in multiple languages. Python code is far, far easier to read and comprehend compared to PHP and ASP, and that's not even taking into account the fact that most PHP code is very badly written.
Yawn more describes CakePHP They've tried to copy a lot of Rails, but it isn't anywhere near as neat as using Rails or Django. CakePHP was what I first looked at when I was still using PHP, but thankfully pointed me towards Rails and then Django
It's certainly apples vs oranges if you compare Rails / Django to CakePHP, they're miles apart in terms of features and usability.
They may have been good at java and php but they obivously weren't good at porting php to JSP whilst using J2EE,Cocoon and Hibernate.
Rather than port a module over they should've developed a list of requirements from the existing modules , then created it using the appropiate technologies. If one was trying to port an existing design over that didn't work well the technologies chosen then obviously its harder than creating a list of requirements and then implementing them with a clean slate.
Of course one has to choose the appropiate tool for the job.
I've just had a look at ruby on rails (it's been about 4 years since i've written a web app in JSP), so i haven't really kept up with web stuff.
Whilst it looks very nice, i wonder how much advantage it shall be once one starts getting fancy.
Poorly written code is a problem in any language , as a language gets more popular so does the amount of poorly written code as the bad programmers , or programmers whose mindset doesn't suit the language start using it.
well being an amateur, i might just rip out the sql statements and re-write in vb, taking the bits i want and throwing out the rest
In the mean time i will read up on .net
Make sure you have a look at Django then, because you still get all the power of Python when you need to use it too.
While I agree with you on the popularity, I still feel that the language plays a fair part in it too. There are a lot of badly written PHP / VB apps that I've seen but not too many in languages like Perl and Python. Sure they're not as popular but Python especially forces you to structure your code properly which I think really helps. Some languages suit small, simple applications but scale badly from a programming point of view to write / maintain.
Two things come to mind immediately:
- A little knowledge is dangerous.
- The law of leaky abstraction.
I don't see what's hard to understand about PHP and ASP code. I've worked with Python as well and I can't see how it is "far far easier to read and comprehend". Maybe it's just you. "Easier to understand" is often very subjective. Personally, as long as the code follows recognisable design patterns, I will find it easy to read, no matter what language.
I've seen some shocking Python code coming out of one of the biggest and richest organisations in the world. Come to think of it, I've seen similarly bad Java code from them too. Bad code is the result of bad programmers, not the language itself.
Most PHP code is badly written because of the same things I mentioned earlier: "a little knowledge is dangerous" and "the law of leaky abstraction". People only need to know a little bit of programming to start writing PHP scripts and that is why there are so many bad PHP apps. When RoR or Python get popular enough, when those frameworks make it so easy to write web apps, they will have the same problems that PHP has.
If you were to compare VB and C#, you can't say one is easier to read than the other since it comes down to personal perference. Both languages on the .net framework have about 99% the funtionality of each other, but the syntax is completely different.
To say one language is easier than another is wrong, since it comes back to what you've learnt and how well and easily you pick programming up.
It's certainly not just myself, but many of my peers are of the same opinion. Have a look at how popular Rails and Django have become already in such a short length of time, there's a good reason for that. True object oriented languages (which asp and php are not) allow for much high levels of code abstraction, and hence less code is required. It's much easier to read 10 lines of code that are clear and consise rather than 50 that have workarounds for OO programming.
Assembly code is very logical too, but it certainly isn't easy to follow. Languages that are better designed with better syntax are far easier to follow, Python is simply a better language than PHP because of this.
Bad programmers are a big cause of the problem yes, but the tool they use has a very big part of it. The difference is that you need a good system to start with that good programmers can take advantage of. Michael Schumacher simply wouldn't be one of the world's best drivers without also having the best vehicle to drive in either.
I don't believe they will. Sure there will be some bad examples here and there but it'd be hard to write bad code using Rails or Django simply because they're a better system to start with. PHP wasn't well designed to start with (PHP5 still isn't there), and hence has promoted a lot of bad code.
That's my view (and rant) on it all anway. I have worked on ASP, PHP and now Python over nearly 7 years (in that order) and really wish I had looked at Python much earlier. It's far easier to be productive when you start with a better system in the first place.
I had a look at it, i'll have a look again when i've got more time but i wasn't too impressed. It seems to me you've found that python fits your way of thinking and thats why you are so happy with it.
Whilst language plays a small part its only when it gets in the way and forces a particular pattern. I dunno where you've been but Perl is famous for bad code. It's the poster child for code that is hard to maintain.
I'd have to agree with GreenBeret on this , so i'll myself the typing and won't repeat what he's said too much.
I would have to disagree there are plenty of people who don't understand object oriented programming and abuse it immensely.
One can write object oriented code in c if they wish , they just have to discipline and impose rules on themselves on how they name functions and call them. Correspondingly one can write procedural code in python , ruby , java or any of the other object oriented languages if they wish.
There are many reasons for languages to become popular and most of them aren't related to how easy they are to use. I personally don't find the django syntax and structure very attractive at all , i prefer Rails, (although from the tutorials i saw that aren't the latest version of Rails the auto generated displays for django were prettier).
It all depends one how one abstracts the code , one has to choose the right manner of abstraction in any language to be effective.
When assembly is written by a good programmer it isn't that hard to follow.