views:

303

answers:

8

A bit of background: I am familiar with PHP and Java, did some C, C++ and Lisp (gasp!) back in programming classes but never used them too much.

So, I've been wanting to step out of PHP a bit for web development. I have a few reasons for this (in no particular order): there's a lot of amateurish code(rs) in PHP, which somehow makes me look bad; I am unhappy with a few quirks in the language; and I really want to try something new. Here are the options I've been looking at:

  • Python and Ruby (on Rails): They both seem nice, but it looks like I'll have some difficulty finding webhosts that run these. And it appears that Python scripts aren't as portable as PHP (correct me if I am wrong).

  • ASP.NET: I have an issue with Microsoft software kind of existing in their own realm. I mean, MS has some really good tools for developers and if you stay within those tools your life is easy. But if you deviate just a bit out of it, you are on your own. And oh, it's not opensource.

So what do you recommend? And if I go with Python (it's tempting), should I use a framework like Django or web2py or should I go down and dirty with the basics (same thing with ASP.NET and MVC)?

Thanks in advance.

EDIT: What I don't like about PHP:

  • No namespaces
  • Implicit type conversions can cause problems
  • Many silent errors
  • No unicode support
  • Slow
  • ....

Sometimes it feels like the whole language has been hastily thrown together.

+5  A: 

Why not try Python (and/or Java, and/or many other languages working on the JVM, including Ruby) on Google App Engine? Not only will Google happily host it for you (and for free, if your site's requirement are modest), but if you want to put it on Amazon (or wherever) later, you can use e.g. typhoonae or appscale for the purpose.

As for the framework choice, Django is very popular (and runs fine on App Engine) and can make you very productive, but I personally often prefer to user lighter, lower-level-of-abstraction frameworks such as tipfy (my personal favorite at the moment). You don't really lose much productivity, either, thanks to the wonders of WSGI and its middleware (Werkzeug in particular).

Alex Martelli
+3  A: 

If cutting code is your bread and butter, you may wish to consider the state of the industry and the state of your career, and where both are going. COBOL used to be big.

If one technology collapsed or its jobs dried up, is there enough overlap for you to segue into another technology or area?

If your spouse (if you have one) suddenly had to stay at home with children, would your job keep food on the table for you all?

Those are the factors that influenced me making a similar decision (to go Microsoft). Of course if you're just coding for fun, those factors may not matter.

SteveCav
I code for a living... That's another factor I've been weighing my decisions with.
NullUserException
+3  A: 

I strongly recommend learning Python. There's no real trouble finding webhosts which run Python, from small web hosts all the way up to Google App Engine.

And it appears that Python scripts aren't as portable as PHP

I have yet to write a single piece of Python code which didn't run on any Python interpreter, no matter what the platform, unless I was expecting it not to (e.g., code calling Windows DLLs). Portability just isn't a big issue.

And if I go with Python (it's tempting), should I use a framework like Django or web2py or should I go down and dirty with the basics

I was never really happy with Django; it's comprehensive, but if the way you think something should work conflicts with the way Django thinks it should work, Django wins. And it all felt kind of monolithic to me. If you're coming from a PHP background, you may feel that pretty acutely.

Running directly off WSGI is pretty easy. If you're looking for something just a little more structured, I've really been enjoying Bottle. It's small, easy to work with, and provides some very nice shortcuts. This, in its entirety, is your Hello World webapp, including the code to launch the server:

from bottle import route, run

@route('/')
def index():
    return 'Hello World!'

run(host='localhost', port=8080)
Chris B.
+6  A: 

So what do you recommend?

We don't know you. So our recommendations are random. Only you know what you want to learn. What you want to learn, you will actually put forth effort to learn.

If Ada were the best possible web language -- but not on your list -- would you start learning Ada? No. You're already thinking about Python because for some mysterious reason it appeals to you.

Just go with what appeals to you. Period.

should I use a framework like Django or web2py

Always.

or should I go down and dirty with the basics (same thing with ASP.NET and MVC)?

Never. Don't waste your time.

S.Lott
Amazingly, this answer isnt at the top.
Seamus
+1  A: 

re: Python

it looks like I'll have some difficulty finding webhosts

You won't have difficulty. While not as ubiquitous as PHP on shared web hosting (where PHP became prominent), there are tons of hosting providers that support Python and its popular web frameworks. There are also lots of other deployment options ranging from dedicated hardware to cloud hosting.

And it appears that Python scripts aren't as portable as PHP

I've never heard of PHP being more portable than Python. I do cross-platform development in Python and find my main OS/platforms are very well supported (windows, linux, mac, solaris, etc), not to mention the variety of interpreters/runtimes it works on (CPython, Jython/JVM, IronPython/CLR,etc). Do you have any examples of where PHP runs that Python doesn't?

Corey Goldberg
A: 

Your concerns regarding Microsft is valid. But recently Microsoft has been conciously moving into the open source community. ASP.NET MVC is an example of this. I have been a DotNet developer for past 8 years. i don't think there is any harm in trying to learn ASP.NET or ASp.NET MVC. You'll find lot of support in case you get stuck somewhere.

I haven't worked on other programming languages for web development like PHP, JSP, Ruby or Python so I can't comment much on them :(.

regards, Nilesh
http://nileshgule.blogspot.com

Nilesh Gule
How is .net MVC a move towards the open source community?
Seamus
@Seamus MS released its source code under the MS Public License
NullUserException
A: 

There's two aspects to be concerned with: client side tech and server side tech. If you want to earn a good living doing this stuff, learn Adobe Flex and Java (years ago the answer would be Java and JSP, but nobody uses JSP rubbish anymore). Flex is the leading "RIA" client-side SDK in terms of popularity and maturity, and Java's popularity speaks for itself.

Also, a nice thing about Flex as a front end technology is that it integrates with just about anything that matters:

- PHP (using AMFPHP, I believe it's called, you could get a quick start learning, and then switch to a better server-side technology after you've mastered Flex)

- Java (hugely popular and common for job postings of course, with more than one integration lib for Flex GraniteDS and BlazeDS)

- Coldfusion (also an Adobe product so of course that works out if you know CF well, but I'm not sure about it's corporate popularity)

- Ruby (over hyped by it's cult followers IMO, and it's not really "taking off" in popularity. You still can't really find Ruby jobs out there, and it's quite different from other languages making a jump to/from it more challenging.)

- .NET (especially via AMF.NET, impressive considering Microsoft stuff rarely plays nice, of course if you really want to do .NET Rich Internet Applications you're probably better off with Silverlight than Flex)

Whatever you do, stay away from the AJAX/DHTML frameworks which all rely essentially on legacy hacks and complex, slow, fragile, constantly maintained libraries to keep them running reasonably well in multiple browsers. HTML5, when it's finally "complete" in 2022 (!!!) won't even be caught up to Silverlight 2 in terms of features--never mind the huge amount of stuff Flex will have out there by then. Basically the AJAX stuff is a maintenance quagmire you can completely avoid by using a VM solution like Flex, Silverlight, or JavaFX.

There are a million of these AJAX frameworks and tools, a very competitive and disorganized landscape where it'll be hard to find jobs specific to each one: DOJO, GWT, jQuery, Yahoo's UI lib, Prototype, Ext, etc. They'll all tell you they're the best but at the end of the day, they all suffer from the same fundamental shortcomings. Use a VM client side tech so you don't need to worry and update your app libs every time a new browser comes out.

Python is a great language but I wouldn't recommend it for this purpose, unless it's for small scale or non-commercial stuff where productivity is key. For a server-side language, even more important than Flex: learn Java. It'll be some work but it's worth it.

Crusader
Railo and Open BlueDragon are a free, open-source alternative for ColdFusion application development.
Pragnesh Vaghela
The Web is a perfect example of Worse is Better. Yes, it is technically inferior to solutions like Silverlight. But it got there first, it is an open platform that anyone can implement, and it continues to get much better industry attention and support than other technologies. Eventually it will, over many iterations, become something decent. The C language still hasn't caught up to LISP in terms of features either, but there's still a lot more C code in the world than there is LISP code.
Nate C-K
-1 For the apples to oranges comparison. Flex and Silverlight v Ajax/DHTML? Really?
quantumSoup
You are right Aircule: Flex etc are in a totally different league than AJAX/DHTML. I only make the comparison because many cult AJAX followers falsely believe that these JavaScript HACKS qualify as "Rich Internet Application" development. The only reason they are "popular" now is because of what Nate said--the hacks were there first.So the negative votes here only serve to demonstrate how defensive the cult AJAX followers get when they're told that their skill set is obsolete. Typical response from those who stand to lose a lot by admitting they went down the wrong path. (EJB2 anyone?)
Crusader
Nate - non-virtual machine solutions may never catch up with the VM solutions. The browser wars have once again started to heat up, and there's no end in sight to the lack of true standardization and consistency when you're not running your client code in a VM. If 2022 is a *goal* for HTML5 which doesn't even catch it up to Silverlight TODAY, exactly how long are we going to be stuck with this inferior maintenance nightmare? I create a Flex app, I have no worries when a new browser comes out!Good point about ColdFusion above that I should have mentioned, there's good OSS solutions there.
Crusader
And really Aircule - that's all you have to say? How about some concrete facts proving my statements above wrong? There are none! Everything I've said above is absolutely the truth, and sometimes the truth hurts. I'm sorry if you're a legacy "JavaScript" engineer but you'll understand after a few more years of experience dealing with the multitude of maintainability issues and other problems I point out about such technology.
Crusader
A: 

I would recommend you to start learning Python, becouse you can use it at both scripting and web developing. Python is strong at scripting, and using a web framework like Django will help you a lot in web developing, becouse Django has a lot of built in functions to help you working in complex projects and writing very few lines of code. Interesting features are the built in forms, database independent apps (you can use whatever database engine you want, so you won't bother with the database functions), reverse urls so you don't have to hardcode them, strong MVC structure and a strong documentation. What should i tell you more ?

Teodor Pripoae