Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Ask Slashdot: Which Web Platform Would You Use?

timothy posted more than 2 years ago | from the support-babies-pie-and-goodness dept.

PHP 519

New submitter datavirtue writes "I'm about to embark on developing active content (database driven, and web services) for the first time for my website and I have grown to love PHP. Knowing that there are other web development platforms available, and noticing some disdain for PHP in some circles, I'm curious to know which platforms slashdotters prefer along with the reasons why. Before I get started into heavy development I would like to get some opinions and more facts. Why shouldn't I use PHP?"

cancel ×

519 comments

Sorry! There are no comments related to the filter you selected.

ASP.NET and C# (4, Informative)

SharkLaser (2495316) | more than 2 years ago | (#38571774)

PHP is fine, but if you want to learn about a better, enterprise-ready languages I would suggest using ASP.NET. It integrates perfectly with .NET apps and libraries and comes with a comprehensive library (as it uses .NET). The great thing about ASP.NET is that you can use C# to develop for it. ASP.NET also comes with various functions to make state management easier - an important feature that is completely missing in other languages. It also has built-in cache management.

ASP.NET originally lacked templating engine, but Microsoft introduced it in 2.0 version. You can have master templates that have placeholders for the dynamic content, as well as all the HTML and JavaScript that is shared between all pages.

It is basically more than your off-the-shelf PHP/Python/Ruby. ASP.NET provides much larger library to use, has templating engine, error handling, controls and events (and hence is more familiar to Windows developers), caching, object-oriented design and session control which can even be saved in SQL Server. It's not just a language, it's the complete package.

One of the great things about ASP.NET is also that you can use your favorite language to develop for it, as long as it supports .NET. This means you can use VB.NET, C#, J#, Delphi.NET etc. And because you compile the code to bytecode, it runs significantly faster. On top of that Visual Studio is a great free (and commercial) development environment.

Oh, and if you want to run ASP.NET under Linux servers, it's easy too. Apache has mod_mono module [mono-project.com] or you can use it via FastCGI.

Re:ASP.NET and C# (-1, Troll)

Anonymous Coward | more than 2 years ago | (#38571860)

Fuck you sopssa, InterestingFella, etc.

Someone fucking ban this guy.

Re:ASP.NET and C# (0, Offtopic)

SharkLaser (2495316) | more than 2 years ago | (#38571928)

So I provide a valid opinion and reasons why it's good to do web development with and it gets modded to -1? WTF Slashdot?

Re:ASP.NET and C# (2, Interesting)

lthorne (2265946) | more than 2 years ago | (#38572052)

Sorry man. I deal with ruby, php, perl, .net, asp.net and bar none, .net and asp.net are not even close to being as reliable as php or ruby. I would never recommend .net to a client, ever.

Re:ASP.NET and C# (5, Insightful)

Curunir_wolf (588405) | more than 2 years ago | (#38572076)

Because people are looking for actual opinions from developers, not market-speak from commercial marketers. I mean, mod_mono?? Really???? LOL!

Re:ASP.NET and C# (0)

Anonymous Coward | more than 2 years ago | (#38572246)

I don't know, maybe it has something to do with your long history of blatant astroturfing? Did you even get modded down to -1 (your at +4 right now) or do you just start there now?

Re:ASP.NET and C# (3, Insightful)

xaxa (988988) | more than 2 years ago | (#38572248)

So I provide a valid opinion and reasons why it's good to do web development with and it gets modded to -1? WTF Slashdot?

You aren't a subscriber, and your five-paragraph comment was submitted within a minute -- and I'm being generous -- of the article being published.

You are clearly being paid to post here, so "your" "opinions" are worth less than nothing.

("Redundant" would be a better moderation than "Troll".)

Re:ASP.NET and C# (-1, Offtopic)

SharkLaser (2495316) | more than 2 years ago | (#38572288)

Who says I'm not a subscriber? Because I am.

Re:ASP.NET and C# (1)

kanguro (1237830) | more than 2 years ago | (#38571984)

This is the reason PHP will never be a well considered language and linux will not pass 1% on the desktop. Dickheads like you giva the bad name to FOSS in general. So Fuck you, asshole.

Re:ASP.NET and C# (0)

Anonymous Coward | more than 2 years ago | (#38572192)

This is the reason PHP will never be a well considered language and linux will not pass 1% on the desktop. Dickheads like you giva the bad name to FOSS in general. So Fuck you, asshole.

Oh yeah? Well you're the reason no one listens to anyone on the internet. Assholes like you are are always lobbing obscenity laden bullshit whenever someone tries to make a point.. Fuck you!

Re:ASP.NET and C# (1)

Nursie (632944) | more than 2 years ago | (#38572170)

It's the same guy, microsoft shilling all day every day.

I've been coming here over a decade now, that's probably not going to last.

Re:ASP.NET and C# (5, Insightful)

Anonymous Coward | more than 2 years ago | (#38571868)

Idiots like this guy here are exactly why there is so much hate for PHP. Here is a classic example of someone comparing PHP - a language - to a full blown web development framework. Ruby on Rails people do exactly the same.

You can argue about the differences and benefits of ASP.NET vs RoR vs Zend Framework vs Yii vs [insert another web framework here] - but comparing a language to a framework is outright idiotic.

Re:ASP.NET and C# (0, Insightful)

Anonymous Coward | more than 2 years ago | (#38572002)

Except PHP is explicitly designed as a "web language" - and then goes on to have all sorts of basic web-related functionality missing.

Re:ASP.NET and C# (2, Interesting)

JAlexoi (1085785) | more than 2 years ago | (#38572148)

Comparing PHP to a web dev framework is very much appropriate. It is essentially a framework. Just look at it's history... It's Perl with some web oriented tooling, it has changed it's backend but hasn't really evolved much.
And I'm not saying it's bad or something. It's very appropriate for a lot of projects. Just look at Facebook. And it's one of the most easily scalable platforms out there.
All of the other frameworks are building on top of PHP and look what they have to do to overcome it's legacy of being a framework language.

PS: PHP and ASP.NET can be compared, while RoR and PHP can't be. web.py and node.js can be compared to PHP, Django can't. Notice what PHP is missing to be comparable.

Re:ASP.NET and C# (4, Interesting)

Anonymous Coward | more than 2 years ago | (#38572322)

PHP is nowhere near being a framework. It is a scripting language, similar to Python and the like, but with a few things added in to make it better for web development. However, those things were added in in a time when the web was a lot simpler. Nowadays developers require more - MVC by default, a decent ORM perhaps, that kind of thing. When you need those, you turn to a PHP framework.

I think that one of the reasons that PHP is criticised so much is that anyone can shove up a .php file and it'll run straight away - it's a lot easier to get into developing with PHP than with other frameworks where you have to learn about MVC, etc. As a result, there's a hell of a lot more dodgy code out there. With languages like Python, however, even using CGI it's a bit more in-depth (and really, you need a framework with Python).

Re:ASP.NET and C# (4, Informative)

Canazza (1428553) | more than 2 years ago | (#38572158)

Frankly the submitter should be likewise ridiculed. If he's heard disdain for a language with no qualifiers or reasons, they should know it's likely the same kind of person as the GPP.

PHP is a fine language, with the right framework. Although most people think "PHP" and "Zend Framework" are synonymous, and don't know there are others (like Yii or Cake).

A quick google brought up this wikipedia page: Comparison of Web Application Frameworks [wikipedia.org]

In the case of Zend, it has tended towards bloat for the sake of backwards compatibility (atleast the last time I went back to use it after a few years hiatus I found half of the functions I normally used flagged as depricated, yet not removed) and I think that's where alot of the ire is raised.

If the submitter does decide to dump PHP, then Python has a fast growing userbase, and the Parent post mentioned Ruby. I can't really comment on either since I've only brushed over Python and never touched Ruby.

Re:ASP.NET and C# (4, Insightful)

vlm (69642) | more than 2 years ago | (#38572206)

Let me help with the standard /. car analogy of why people are pissed off with that answer.

Question:

I need to buy a nice set of metric socket sets to work on my car (my car was built in TN by a domestic company last century, yet is almost totally metric), and I'm not buying Chinese chrome plated plastic from walmart, can /. advise me on a nice place to get socket sets or general advice on procurement (note, I'm in market for 6-sides not those "bolt rounder" 12-sides and also I wanna get high grade impact sockets)?

Answer:

Well Saturn of Chattanooga never steered me wrong when I needed the plastic thermostat replaced with the brass one back in '98 due to the recall and I'm sure nothing has changed in the last 14 years so I'd go there.

Re:ASP.NET and C# (2)

bhcompy (1877290) | more than 2 years ago | (#38571944)

Depending on the enterprise, ASP and C# can definitely be useful. It really depends on the shop. One Fortune 500 I was with worked primarily with ASP, the current one I work with uses ASP, PHP, and Java equally. The small webdev houses I've been with have used ASP more than PHP(that Microsoft Certified Solutions Provider logo seems to impress the businesses you're making stuff for, I guess). Most of my friends that do solo freelance work do PHP.

Re:ASP.NET and C# (1)

Canazza (1428553) | more than 2 years ago | (#38572346)

that Microsoft Certified Solutions Provider logo seems to impress the businesses you're making stuff for, I guess

I can attest to that!
They give you lots of free stuff too.

*not an MS Shill honest

-1 True (-1)

Anonymous Coward | more than 2 years ago | (#38571952)

LOL, you answered the question perfectly but got the slashbots all in a tizzy for not choosing their preferred platform.

If you'd suggested a half broken, totally unsupported open source framework which triples development time in exchange for little or no benefit you would have gotten +5 informative instead.

Re:ASP.NET and C# (4, Informative)

Anonymous Coward | more than 2 years ago | (#38571958)

Heh. Great advertisement. :)
Asp.net sucks.
Not everything that works on windows, works on linux - so it's "almost" platform independent the fact that MS does not develop mono guarantees that linux version will not support the latest stuff. Only recently has Microsoft developed semi serious ORM and it still has bugs.
Windows hosting is much more expensive than linux hosting.

PHP with one of the popular frameworks, and bytecode interpreter (like facebook's hiphop vm) can match the speed of C#, and language is not always the bottleneck. SOmetimes the architecture of the software is the problem.

As a person who develops in both Asp.net (Webforms and MVC) and PHP (with various frameworks) i would recommend anything BUT ASP.NET. Ruby on Rails is great. Pythong has some great frameworks too ... ASP.NET is the worst choice OP could make.

Re:ASP.NET and C# (1)

cshark (673578) | more than 2 years ago | (#38572304)

I wish I had mod points for this one.

Re:ASP.NET and C# (5, Insightful)

ByOhTek (1181381) | more than 2 years ago | (#38572024)

I... would not use ASP, I'd use PHP before ASP, and Python before that.

One of the advantages of python, is that, with mod_wsgi, it's very fast.

Actually, what I'm working on is, a mod_wsgi handler in apache, that sends the request to a back-end server, originally written in python, but now I'm switching to C# (still no ASP). Although there are ASP Modules for Apache/mono, I belive mod_wsgi has much more thorough testing, and will therefore be a better-cross-platform solution.

In the end, answer these three questions:

1) What platforms are you most comfortable with? Rank them.
2) What platforms have the best modules/libraries for what you want to do? Rank them.
3) What platforms have the best performance? Rank them.

Now, given the rankings on 1-3, which platform is best for you? Nobody can answer this but you. Without knowing the details of what you want, we really can provide advice on #2 and #3.

Re:ASP.NET and C# (3, Informative)

ByOhTek (1181381) | more than 2 years ago | (#38572200)

I should add - PHP is *NOT* a bad solution, depending on what you are doing, the very large library of available functionality built into it, is EXTREMELY nice. It simply is not my first choice, as much of that functionality can be obtained from Python or C# with only a little more effort (finding the correct library to download), and it is easier to call C libraries from Python or C#.

Re:ASP.NET and C# (0)

Anonymous Coward | more than 2 years ago | (#38572100)

This is the same guy pointed out in another article as railing against google/android/open-source.

Re:ASP.NET and C# (5, Interesting)

Anonymous Coward | more than 2 years ago | (#38572116)

A while back now I had to do a project in ASP.Net, after being a long time PHP developer and I have to say I found it incredibly unpleasant. PHP's problem is that you have to write everything from scratch, however ASP provides you with a tonne of controls that allow you to get up and going really quickly. The problem though, is as soon as you try to do something a bit more complex with ASP.Net controls, it all falls in a heap.

I remember having to print a list of products, and there would be sub headings mixed in amongst the rows to divide product families....

Product Family 1
Product 1 - $Price
Product 2 - $Price
Product 3 - $Price
Product Family 2
Product 4 - $Price

Now I was pulling these products from a database as one giant table, and then binding the data set to the Repeater control. The problem is that ASP.Net only has templates for a Row and alternating rows, so I couldn't easily insert the separators for the different Product Familys. All of the sudden I'm having to create my own custom controls that inherited from repeaters and needed to have a detailed understanding of how ASP.Net worked and all sorts of scary things. Needless to say, it was incredibly frustrating.

On the other hand, the same solution in PHP is solved with,
if($PreviousProduct.Family != $CurrentProduct.Family))
{ //New Family row code goes here.
}

1 Line vs alot + stress. To me, that kinda summed up ASP.Net, great if you don't really know how to program, but for professionals, not so great.

That said I love C#, and I definitely wish that PHP was more like it, PHP is a terrible mess, but its fast, simple and you can build things fairly rapidly. Combine it with a framework, and you're in pretty good hands. Although I'd really love for them to make it harder for noobs to create security issues. :\

Re:ASP.NET and C# (1)

Anonymous Coward | more than 2 years ago | (#38572254)

If you are proficient with PHP - stick with it. You are good at it - don't experiment if you want to get the job done. You can experiment for some small tasks with some other technology and introduce it when you are briefly familiar with it.

That said - ASP.NET is basically language + half framework. What you get in .NET you can get elsewhere in PHP - most of the stuff at least - by introducing 3rd pary libraries and other stuff.
On the other hand with ASP.NET you are pracitcally stuck with IIS and Windows. And IIS is rather annoying HTTP server. That's major drawback IMHO.

PHP is great (4, Informative)

InformativePost (2544774) | more than 2 years ago | (#38571780)

Most hate towards PHP comes from elitist snobs who don't know how to use the language. PHP is perfectly fine language to use, and it is extremely powerful and flexible. If you are going to develop for web, I suggest using some framework, as it makes the process much more straightforward, faster and better. I personally use CodeIgniter [codeigniter.com] , which is fast and has a good library of helpers and other essential framework stuff. CakePHP is often suggested for persons new to frameworks, but I would stay away from it. It's slower and it's more pain in the ass to learn.

There's also other good things about PHP. First of all, it works with practically every web host out there, and doesn't require you to play around with it to get it work. It has an extremely comprehensive library, amazing documentation and almost all API's have client libraries for it, if they just have some. PHP, being the #1 platform on the web, gives you that advantage.

Re:PHP is great (0)

Anonymous Coward | more than 2 years ago | (#38571808)

No, most hate for PHP comes from enterprise software developers who have had to maintain the spaghetti code that is an "enterprise" PHP app. PHP is a hack language best suited for small projects - scaling to support an enterprise is nearly impossible. Even Facebook admits this on their blog.

Re:PHP is great (2)

Sneeka2 (782894) | more than 2 years ago | (#38571828)

Out of genuine interest, what makes a well written (emphasis on WELL WRITTEN) PHP app so much harder to maintain than an equally well written *.NET app?

Re:PHP is great (1)

d4fseeker (1896770) | more than 2 years ago | (#38571910)

Nothing. But it's a pain in the ass to get people to write well if they can just be lazy...

Re:PHP is great (2)

datavirtue (1104259) | more than 2 years ago | (#38572230)

In a way PHP is like a collection of macros that let anyone just start turning out things that will work. You don't have to be a programmer, know web standards, or understand much of anything to start coding in PHP. Therein lies the danger. Judging from this I can only assume there is a vast swath of "spaghetti code" in production. A lot of companies manage to turn incompetent people loose on "real" languages in more complicated environments so you can imagine the state of some PHP apps floating around. Usually, what starts out being a simple project often morphs into a ZOMG ultra important application, so if you do not plan for this when coding with PHP you will get in trouble fast. Right away I noticed I was going to need some advice when I started playing around with PHP. It was appearant that just barfing up code wasn't going to cut it (as usual), at the least you have to make use of PHP object oriented features.

Re:PHP is great (1)

ErGalvao (843384) | more than 2 years ago | (#38572264)

So, you're basically admitting that the language has nothing to do with your complain. There are lazy people in every programming language and it's possible to write spaghetti code in every programming language as well.

Re:PHP is great (5, Funny)

Rhaban (987410) | more than 2 years ago | (#38571912)

Out of genuine interest, what makes a well written (emphasis on WELL WRITTEN) PHP app so much harder to maintain than an equally well written *.NET app?

You have to actually read and write code, you can't just click checkboxes until it works.
It is really hard.

Re:PHP is great (1)

binarylarry (1338699) | more than 2 years ago | (#38571938)

Nice, you sound like you have a lot of experience with enterprise webdev.

LOL

Re:PHP is great (1)

lthorne (2265946) | more than 2 years ago | (#38572146)

You have to actually read and write code, you can't just click checkboxes until it works. It is really hard.

ROTFLMAO! that is every Microsoft developer I've ever met. Microsoft is making developers dumber.

Re:PHP is great (1)

cshark (673578) | more than 2 years ago | (#38572376)

They complain a lot when something forces them into a real ide, which they resent instinctively. After all, as any of them will tell you... visual studio is the best ide ever developed.

Re:PHP is great (1)

Anonymous Coward | more than 2 years ago | (#38572214)

Out of genuine interest, what makes a well written (emphasis on WELL WRITTEN) PHP app so much harder to maintain than an equally well written *.NET app?

Nothing - similarly, bacon is just as healthy as lettuce, provided that the bacon is from a unicorn.

Re:PHP is great (0)

Anonymous Coward | more than 2 years ago | (#38571926)

Youll have to explain how PHP is more prone to spaghetti code than other platforms, and in my experience it scales just fine. Web servers are infinitely scalable horizontally, so the scaling issues are mostly with DB backends ( if that's what you meant by scaling ). Scaling something to facebooks size and traffic is going to be hard on any platform, but I'll concede that PHP might not be the best choice for them, simply because I have no experience with a web app of that size.

People used to cite lack of OOP, but as of 5.2 it has most ( if not all ) the OOP features you'd want
The main reason many people hate PHP is because its so easy to learn and use, and so lot of bad php-code is written. Us PHP-devs get a bad rep because of this.

Re:PHP is great (2)

ByOhTek (1181381) | more than 2 years ago | (#38572154)

Given all the shitty Perl, Python, C#/VB.NET, Ruby and Java code I've seen out there... I'd have to say, hate the developers that made that crap code, and not the language. Any developer can make crap code in any language. Some languages make it easier (Perl, Ruby and Python come to mind VERY quickly), but that certainly doesn't make them bad languages.

Re:PHP is great (0)

JAlexoi (1085785) | more than 2 years ago | (#38572176)

You have seen beautiful Perl code? Really!?!?!?!?!

Re:PHP is great (1)

oneandoneis2 (777721) | more than 2 years ago | (#38572298)

Modern Perl is a beautiful language

Re:PHP is great (1)

Tim4444 (1122173) | more than 2 years ago | (#38572342)

I think he's saying those languages make it easier to write bad code, "but that certainly doesn't make them bad languages."

Re:PHP is great (0)

Anonymous Coward | more than 2 years ago | (#38571844)

PHP has no built-in support for multithreading.

Re:PHP is great (4, Insightful)

danbeck (5706) | more than 2 years ago | (#38571972)

This is completely true, but very unimportant. PHP under Apache (And really what serious professional would use anything else?) as a module and needs no threads; that's the job of the httpd daemon itself.

If you need threads; if your Java indoctrination only allows you to solve problems by creating huge monolithic applications, ignoring excellent work by engineers who are much, much smarter than you, then yeah... PHP won't cut it for you. You'll need a language that will be better suited to reinventing the wheel. That is definitely not PHP's strength.

(Ah, I love it when a good straw man argument comes together.)

Re:PHP is great (1)

InformativePost (2544774) | more than 2 years ago | (#38572112)

PHP under Apache (And really what serious professional would use anything else?)

Just as a side note, nginx is much faster, more lightweight and better web server. Point still stands tho, you don't need threads for web serving. I have also wanted threads in PHP for scripting, as it is the only thing missing in PHP.

Re:PHP is great (1)

JAlexoi (1085785) | more than 2 years ago | (#38572292)

Monolithic? Ignoring excellent engineering? Are you comparing it to the same PHP that I know?
PS: Reinventing the wheel is exactly what most, if not all, of PHP developers that I know of are excellent at. And I know a crapload of them...

Re:PHP is great (0)

Anonymous Coward | more than 2 years ago | (#38571932)

First of all, it works with practically every web host out there, and doesn't require you to play around with it to get it work.

I don't think this is really true. I experienced quite a few situations where a web application written in PHP required me to install third-party tools (eg. imagemagick), tinkering with my php.ini, and/or use different compilation flags for the PHP module itself -- a luxury you don't always have when merely having signed up to a PHP hoster where this cannot always be achieved without haggling with the hosting company.

Re:PHP is great (1)

CastrTroy (595695) | more than 2 years ago | (#38572038)

I would say that for the most part, while just about every hosting company out there supports PHP, they don't all support the same PHP. Firstly, there's a question of which version they are running, and then, there are tons of components available, some host support a lot, others support only a few. The API (if you can call it that) is pretty much all encompassing, but is so inconsistent that it makes my head hurt. Half is Object Oriented, half isn't. 3 different choices of APIs for connecting to databases. Documentation is lacking, and is only sufficient with the user comments, many times I don't want to have to read through pages of user comments to find something that should have been in the docs in the first place. Also, it's interpreted at runtime, which means that it's about 10x slower than other options like .Net and Java. This doesn't matter for small sites. But for large sites, it ends up becoming a huge problem. Twitter had to switch to a new platform (Java I think). Facebook compiles all their PHP to C to get the needed performance out of it. In the end, it doesn't really matter, as you can create a good project in any modern language. However, If I had a choice, I wouldn't use it.

Re:PHP is great (1)

orasio (188021) | more than 2 years ago | (#38572302)

Most hate towards PHP comes from elitist snobs who don't know how to use the language. PHP is perfectly fine language to use, and it is extremely powerful and flexible. If you are going to develop for web, I suggest using some framework, as it makes the process much more straightforward, faster and better. I personally use CodeIgniter [codeigniter.com] , which is fast and has a good library of helpers and other essential framework stuff. CakePHP is often suggested for persons new to frameworks, but I would stay away from it. It's slower and it's more pain in the ass to learn.

That's right. Most people who hate PHP don't know enough of it. That's why I hate it. I could never learn how a well built application should look like in PHP.
That's why _I_ wouldn't buy anything made in PHP, it's too hard to tell good from bad, for non experts.
If you are an expert in PHP , it's OK to use it, I wouldn't pay you to do it, because it's too hard to tell if you are really an expert, and it's too hard to get another expert if you change projects.

Voting to close (4, Insightful)

Sneeka2 (782894) | more than 2 years ago | (#38571796)

...as Subjective and Argumentative.

Oh, wrong site.

Django (5, Informative)

troon (724114) | more than 2 years ago | (#38571814)

I've been using Django [djangoproject.com] for a while now on my web app, having moved away from home-brewed PHP. Very easy to use, and encourages well-written and elegant code.

Re:Django (-1, Flamebait)

InformativePost (2544774) | more than 2 years ago | (#38571850)

Python is a bad choice. Using whitespace to denote code blocks is ridiculous at best. Countless amount of problems with copy-pasting code and beginners always miss it. I've been using Python myself, but I always hate when I have to.

Re:Django (1)

Anonymous Coward | more than 2 years ago | (#38571900)

If copying and pasting code otherwise perfect code is your primary source of errors, consider yourself blessed (and the coders who have to deal with your mess cursed).

Re:Django (3, Informative)

DarwinSurvivor (1752106) | more than 2 years ago | (#38571950)

Whitespace is something the human eye is VERY good at seeing, a missing curly-brace on the other hand is NOT. Every language has it's pitfalls, but honestly, code indenting in python is usually not a problem after a couple weeks at the most.

I personally use django for a number of my projects and my only problem with it is the templating language. It's fine for most stuff, but I'm going to look into more powerful templating languages for my next project (preferably something DOM-oriented).

Re:Django (0)

rnturn (11092) | more than 2 years ago | (#38572392)

``Whitespace is something the human eye is VERY good at seeing, a missing curly-brace on the other hand is NOT.''

Isn't that why most programming editors include a feature like Emacs' "Paren Highlighting"? Turn it on and all those cryptic messages about runaway statements go away. Or, when you are beginning a block enclosed by "( )", "[ ]", or "{ }", add the closing parenthesis, bracket, or brace immediately so you don't forget it. Python's a fine language but switching languages because the coder in unable to remember to close blocks seems, to me, just silly.

Re:Django (1)

mhh91 (1784516) | more than 2 years ago | (#38571954)

I personally think of it as a feature, it prevents you from blindly copy pasting code.

Sure, I had my problems with indentation when I first started learning it, but now I'm used to it, I think of it like curly braces in the C family of languages.

Re:Django (0)

Anonymous Coward | more than 2 years ago | (#38571988)

Copy/paste with python? Come on, leave that crap to PERL sysadmins 15 years ago.

Re:Django (1)

Anonymous Coward | more than 2 years ago | (#38571960)

White-spaces to denote code-blocks is genius, it forces you to write well formatted code and you are also rid of all the clutter with brackets.. Furthermore the language is on of the most readable and easy to understand languages out there plus it has a huge user base and many rich libraries and frameworks. But i guess its personal preference.

Personally i use python on google app engine with the webapp2 "framework", and i love it ! You get things out the door unbelievably fast. Comming from a background of .NET and PHP ive never been happier with my switch to python !

Re:Django (4, Insightful)

BasilBrush (643681) | more than 2 years ago | (#38572082)

If copying and pasting blocks in Python is not working right, then get an editor that is aware of Python indenting. And switch on the option to always convert tabs to spaces.

Whenever anybody mentions indentation as their one argument for/against Python, I'm pretty sure they know very little about the language. It's like the very first thing about the language you learn.

How a language denotes blocks is just a detail. You learn best practice for that language and get on with it.

Re:Django (1)

Verunks (1000826) | more than 2 years ago | (#38572014)

indeed I've been using django from quite some times and it's absolutely great, the only downside is that it's not supported by every hosting providers and it's a little harder to setup, it's not just copy & paste the php file on the ftp

PHP is an ugly programming language (2)

YEPHENAS (1518907) | more than 2 years ago | (#38571834)

PHP is an ugly programming language. Just look at a comparison with some other languages to get a feel for its ugliness: http://hyperpolyglot.org/scripting [hyperpolyglot.org]

Re:PHP is an ugly programming language (0)

ErGalvao (843384) | more than 2 years ago | (#38571920)

"An ugly programming language"? PHP syntatically follows the same style as Perl and C, so you're basically saying all three are ugly? Or maybe you're saying that only about PHP because it makes you look so cool? Seriously now, if you wanna criticize a programming language do so by using technical arguments, this is not a beauty pageant.

Re:PHP is an ugly programming language (3, Insightful)

Anonymous Coward | more than 2 years ago | (#38572086)

Perhaps a better word is 'inelegant'. A massive global name space, inconsistent function names and argument order, tacked on object model, crappy exception handling.

There's almost nothing that php does better than other modern scripting languages.

Re:PHP is an ugly programming language (4, Informative)

Sneeka2 (782894) | more than 2 years ago | (#38572142)

There's almost nothing that php does better than other modern scripting languages.

Very true; but it's ubiquitous, very easy to get into and has great documentation. Choose your evil.

Re:PHP is an ugly programming language (1)

YEPHENAS (1518907) | more than 2 years ago | (#38572196)

"An ugly programming language"? PHP syntatically follows the same style as Perl and C, so you're basically saying all three are ugly?

I honestly think that Perl and C++ are ugly. And C to some extent, too.

Re:PHP is an ugly programming language (0)

Anonymous Coward | more than 2 years ago | (#38572016)

Exactly how would this matter in any way? This kind of comment always come from the comp sci nerds who never did any programming themselves, and always failing with getting anything done, because they're too busy being know-it-alls and making pointless remarks about petty awkward details in this and that piece of software.

Just imagine if you will, a carpenter who would refuse, or as in your case, being incapable of working or completing a task because he didn't have have his favorite hammer available, or being supplied the wrong color toolbox. Yeah, exactly.

Re:PHP is an ugly programming language (0)

Anonymous Coward | more than 2 years ago | (#38572250)

What do you mean by ugly? It is as ugly as the other languages (sometimes it is the same thing).

I mean, why people hate PHP in such a blind manner?

PHP & Python (4, Informative)

truthsearch (249536) | more than 2 years ago | (#38571836)

I use PHP for 90% of my work because it's the right tool for the job. We can also bring other developers up to speed on our own framework and projects pretty fast.

There are times when Python is a better fit. The fact that it remains running across page loads can be very handy (as opposed to every request to PHP being completely distinct, which has its own advantages). A continuously running app is often better for backend processing, especially when interacting with third party systems.

ASP.NET Is Bloated (1)

Anonymous Coward | more than 2 years ago | (#38571846)

ASP.NET is bloated--it's only good for web applications where you aren't concerned with the user experience. The downside of using it's existing libraries is that a simple task becomes thousands of lines of JavaScript. PHP is much simpler for your every-day dynamic site, and you'll have a better experience working with hosting providers (not to mention plans that typically cost less).

Re:ASP.NET Is Bloated (1)

Canazza (1428553) | more than 2 years ago | (#38572178)

only if you use ViewState. if you use something like MVC then you cut out a shittonne of JS.

Catalyst? (1)

kurisuto (165784) | more than 2 years ago | (#38571884)

What do you guys think of Catalyst these days? Does Catalyst still have enough support behind it to make it worth my while to sit down and really learn Catalyst?

This is assuming that I already know Perl well, and that I'm also not interested in switching to another language at the present time.

Re:Catalyst? (3, Informative)

oneandoneis2 (777721) | more than 2 years ago | (#38572352)

Yes, it's still very actively developed. Especially if you throw in Moose and Plack.

J2EE (2)

bfandreas (603438) | more than 2 years ago | (#38571886)

It does have its flaws but there are a plethora of Java based frameworks out there.
The sheer amount of options you get at zero cost(some of it actually Free) and the quality of API documentation is simply astounding.

Re:J2EE (1)

Anonymous Coward | more than 2 years ago | (#38572162)

The API documentation of JEE is like an Ikea assembly manual. At first it all neatly plays along, but then you always end up cursing and swearing.

PHP is not great (0)

Anonymous Coward | more than 2 years ago | (#38571890)

PHP is quick and dirty (not to mention easy - but in a bad way), but it has scaling issues. Frameworks are nice and all, but in the end it's still a hodgepodge of code spaghetti. Personally, I prefer Django with Python because of the built-in ORM, security features (i.e. CSRF protection), modularity, a "true" built-in templating engine plus native OOP w/MVC design coupled with the power (and conciseness) of Python. Scalability is also easier because Django "out of the box" supports Memcached, CDN's, tiered architectures, multiple database types, etc.

Every language sucks (4, Funny)

mveloso (325617) | more than 2 years ago | (#38571902)

Use the language of Money and buy someone to build it for you. Problem solved!

BASIC, of course! (3, Informative)

tomknight (190939) | more than 2 years ago | (#38571916)

... well, not really. But there is such a thing for the web: http://www.runbasic.com/ [runbasic.com]

why to hate php (1)

cthlptlk (210435) | more than 2 years ago | (#38571918)

First, let me commend the original poster on an irresistible troll.

"I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say 'Yeah it works but you're leaking memory everywhere. Perhaps we should fix that.' I’ll just restart Apache every 10 requests." --Rasmus Lerdorf, the Original php guy

Wt (5, Interesting)

paugq (443696) | more than 2 years ago | (#38571924)

Wt [webtoolkit.eu] is the best one I have tried. I use the C++ version, although there is also a Java version (JWt).

What makes Wt unique is its approach: widgets. You develop web applications like you were developing desktop applications. Also, the API is Qt-like (but using Boost).

I gave up on Rails after I used Wt.

Want a virtualization console? Take Wt, libvirt and an HTML5 VNC client and you are done.

Need Active Directory authentication? Wt, Samba (or Windows APIs if you are on Windows), done.

Streaming? Wt, ffmpeg libraries, done.

Forgetting about bindings and being able to use the millions of C/C++ libraries out there was a huge relief.

Also, size: Rails, Django (and even PHP) just do not fit in an embedded environment. Wt does.

Zend + HTML + jQuery (1)

konmpar (1822540) | more than 2 years ago | (#38571946)

Zend is a php-framework ready to do almost anything. It has a very active community which updates very often the code. Very easy to learn it although the documentation is lacking a lot of things.

Along with some html/css/javascript tricks you can do a lot of amazing things that they are not allready exists in the wild.

Re:Zend + HTML + jQuery (0)

Anonymous Coward | more than 2 years ago | (#38572124)

Embarcadero's RadPHP XE2 is an excellent IDE that uses Zend ... http://www.embarcadero.com/products/radphp

mod_perl (0)

Anonymous Coward | more than 2 years ago | (#38571966)

Only thing worth using is based on mod_perl

Just template toolkit should be ok

or you can use a framework like catalyst

(If it is good enough for Slashdot likely good enough for you).

Go C++ with Witty! (4, Interesting)

scorp1us (235526) | more than 2 years ago | (#38571970)

Wt ("witty") [webtoolkit.eu] is a C++ toolkit that is modeled after Qt. It uses boost and STL, but you get to use familiar Qt concepts - signals & slots, Model view, etc. Basically think of Qt-based web pages. It fully supports AJAX and can handle the data server-side or on the client. It also has a C++ -> JS converter so you can just make a function for conversion to JS and have it exec on the client. Of course it runs as a module, or it comes with its own server. It fully supports CSS, DOM, etc.

I reall like this approach because my two complaints of PHP:
1. It is unstructured
2. it is ugly (both syntax, and having code embedded in pages)
are alleviated.
1. C++ object orientation encourages a structured approach.
2. The "it's 100% C++" ensures that you focus less on the presentation in PHP and just on the application logic. This helps encourage a model-view-controller approach. While you might have to write CSS, you will never have to write HTML and you won't ever have to mix the two in a CPP file.

Another reason is speed. Everything is compiled and runs natively, or compiled to JS and moved to the client.
Yet another reason is security. Wt has several protections built in. See the features link below.

If you're looking to do web pages entirely differently, this is it.

Additional features list [webtoolkit.eu]

it's the apps, stupid (0)

Anonymous Coward | more than 2 years ago | (#38571986)

The programming language itself is pretty irrelevant. You won't find huge differences between the popular choices. What will make a much bigger difference is the platform. I ran my website with Drupal (PHP, drupal.org) for years. When it came time to move to a new platform, I chose WordPress (PHP, wordpress.org). The fact that WordPress is also based on PHP was of secondary importance. I wanted the biggest community and the biggest selection of prebuilt components to save time.

Re:it's the apps, stupid (1)

Sneeka2 (782894) | more than 2 years ago | (#38572066)

I really don't get why people refer to Wordpress as a "platform". It's a blogging system for crying out loud. If the app you're building is very close to a blog, yes, it makes sense to customize Wordpress. Even if the core of your system is very CMSish, Wordpress may be a decent choice since its admin interface is quite extensive and ready to go. But don't refer to Wordpress as a "platform" for any other purpose, please.

php is fine but.. (0)

Anonymous Coward | more than 2 years ago | (#38571996)

use a good framework.

Depends on your application (0)

Anonymous Coward | more than 2 years ago | (#38572000)

I'm just another peon in the startup world, but if I were starting out on a new project in a new language right now, then I would pick one of two languages for server-side.

Ruby on Rails: The speed of development with RoR is remarkable. As a framework, it is incredibly well supported, and for most tasks, an ideal candidate. Not only is it a great language, but it's probably one of the easier languages to find capable, ambitious young talent in. It has a lot of ... conventions ... and RoR will punish you for going outside of them, but all in all, they're reasonable conventions. There have been complaints about performance, but they are being addressed with every release.

Node.js: If you're building a web application in which users interact in real time, or for some other reason need some kind of timely event notification, node.js is a good candidate. Built on top of google's V8 javascript engine, it's very fast (gaining advantage from every advance Google puts into its web browser), can connect into C/C++ to link with your existing infrastructure, but its defining feature is being able to maintain a large number of long lasting connections.

PHP is fine, and there's something to be said for 'going with what you know'. Also, there's no question you'll be able to find cheap labour to build out your project in PHP. There are some great PHP frameworks, too.

I would use PHP.... (0)

Anonymous Coward | more than 2 years ago | (#38572040)

PHP is just fine. There's nothing wrong with PHP at all and it powers some of the largest sites on the internet. If you want something slow and awkward, choose Java just like all of the banking websites use.

Nothing wrong with PHP. (5, Insightful)

gfxguy (98788) | more than 2 years ago | (#38572044)

I've been doing a lot of web programming, and I evolved from PERL to PHP to Python. I happen to prefer Python these days, but there's nothing wrong with PHP. I wrote my company's PTO system using PHP (LAMP) and it works great. I would also suggest JQuery or similar for richer content.

Most "disdain" for any given language is mostly elitism and people self-validating their own choices. It's true PHP can be messy, but I recall having a Ruby developer look at my PERL code and be surprised at how readable it actually was... in other words, it's up to the programmer. I can make some pretty ugly programs in any language.

Use Javascript (1)

Anonymous Coward | more than 2 years ago | (#38572048)

I'm sure you will receive a lot of suggestions for server side MVC frameworks such as Rails, Django, Play, Asp.net mvc, etc...

How about a different direction and use javascript without a server side MVC framework at all. Node.js can run on the server and serve back json for your service urls. Should you need to provide pages in addition to just the service urls, you can return static html documents and use something like jQuery and Knockout to fetch the json from your service url and render the model to the page.

If you'd prefer to use something statically typed on the server side, using Scala and a framework like Scalatra or Unfiltered for the web server gives you a lot of power in a concise syntax.

Good luck (4, Insightful)

beowulfcluster (603942) | more than 2 years ago | (#38572120)

You might as well ask which religion is the best one.

I know.... (1)

3seas (184403) | more than 2 years ago | (#38572140)

The one with the least amount of security.... That way everyone will know... if it connects to the internet, there is no privacy... rather than lying babel saying otherwise.

It's more than just the language (0)

Anonymous Coward | more than 2 years ago | (#38572150)

The reason why there is so much disdain for PHP programmers is because the language is only one part of the picture which many PHP programmers don't learn. Having good project layout and design is important. Picking the right technology choices for backend, frontend, ORM, plugins and modules is important because they will all eventually roll in to a big ball of mud. Ultimately bad and good PHP software degrades due to a lack of automated testing or bad coverage. You should seriously consider learning a good testing suite first before you foray in to actual development. Lastly, rather than invent your own framework and methodologies, consider using well adopted web frameworks with a good community behind them.

As far as I am concerned, I really enjoy developing in Ruby and Rails. RoR has really reached the maturation plateau where it's no longer necessarily so cool but great people are getting great work done with it. There is a significant amount of culture surrounding it so that is important and you can really isolate yourself and not write RoR code well if you don't pay attention. If you need scalability from the get-go, it doesn't matter what language or platform you use; if you don't know how to write scalable apps you're going to fail at that regardless of what you use. Consider visiting and then joining your local user groups. I attend the local Ruby on Rails group and have built some great relationships with other local devs in town as well as learned who all the significant employers in that space are.

Githubs, anyone? (2)

Crimsane (815761) | more than 2 years ago | (#38572184)

Nobody should be allowed to register an opinion in this topic without linking to their githubs.

Don't listen to them. (5, Insightful)

GNUALMAFUERTE (697061) | more than 2 years ago | (#38572190)

Here's a little secret for you: Anyone that uses the word "enterprise" is full of shit. It is used by mediocre developers who work at relatively big corporations and have been forced through the years to work with a bunch of bureaucracy. This people can't release a fucking shell script without 10 formal test cases, 50 meetings, 10 flowcharts, and it's own repository.

Serious huge projects are written in C++. Serious huge projects that need incredible performance are written in C with assembly optimizations. When somebody tells you that you can't write anything if it's not done in Java, that guy is a corporate droid. If somebody tells you the same for Perl, he's an old monk. If somone tells you that for Ruby/Python/Brainfuck, he's a snob and a fan of that particular language, ignore him too.

Truth is, leaving aside the obvious differences, when it comes to features that help organize huge projects, C has nothing that PHP doesn't implement on some way. Don't get me wrong, I'm not comparing the base of all modern computing with a modern and not very well designed interpreted language, I'm talking about features that some idiots would call "corporate". And yet, there are incredibly HUGE projects written entirely in C. And yes, there are also huge projects written in PHP.

Truth is, if you are a good coder, you'll do a good job even if you have to use Basic. And if you are not, you'll write spaghetti code even in C++.

PHP is a simple, straight to the point language, with a very clear syntax, that is great for web development. It's syntax is very much C-like, just like Javascript, and that certainly helps when you are writting web apps. It's easy to find PHP coders, and that certainly helps too.

The problem with PHP's reputation is that it's incredibly easy to just write some script or modify an existing one, and call yourself a coder. So the amount of bad PHP code out there is incredibly huge and incredibly public. Of course, if you reviewed each of those Corporate-enterprise-mega-super-jumbo java apps, you would find as many WTFs as you could in your average PHP project, the only difference is that the assholes rooting for Java won't show you their code, and they'll act very dignified.

Also, avoid the motherfucking frameworks. You don't need them, at all.

Too many unknowns (0)

Anonymous Coward | more than 2 years ago | (#38572216)

The submitter left out far too many criteria to make this a useful Ask. We can't possibly know what platform(s) would suit his endeavors. But he sure succeeded in starting a bunch of little flamewars :)

Django (1)

CHJacobsen (1183809) | more than 2 years ago | (#38572240)

The thing about PHP is that it is very easy to get started with, and gets a big user base partially because of that. Because it has a large userbase, people sometimes assume it is by default the best choice.

It is a decent language, and after all, you can use it for most tasks.

However, i'd strongly recommend you to give Python and Django a try before you settle for PHP. It is so much nicer than PHP once you get used to it.

This video is a good (although slightly old) intro:
http://www.youtube.com/watch?v=p-WXiqrzAf8 [youtube.com]

Go with what you know. (0)

Anonymous Coward | more than 2 years ago | (#38572278)

The bigger hate that most people have expressed is the randomly put together hack jobs of code that people need to support and it is apparent in any language. I have had C# and PHP projects that I have looked at a few weeks later and simply said "What the hell was I thinking?".

If you know PHP, it is a perfectly capable web framework and great for development. If you want to learn something else, there is a lot of other languages out there but the time to become a proficient developer in another language that does the same thing as PHP to me is not worth the hassle. Depending on the project, pick the language you know. If it is a larger scale project then I would simply choose PHP because I know it well and how to write clean code. If I was doing some smaller project, I may pick another language or framework to start to learn and grow on.

They all suck (5, Insightful)

Alkonaut (604183) | more than 2 years ago | (#38572366)

Honestly all web platforms have drawbacks, and all of them will have supporters claiming they dont.
  • python: pros: easy, decent tools, good frameworks. cons: syntax is difficult to check for correctness (non-compiled).
  • perl: pros: it's free: cons: Its perl
  • .net: pros: techincally bloody excellent, good tools. cons: practically win-only, no free server software
  • javascript (e.g. node.js): pros: it is the same on the client if you want one. Cons: it is still bloody javascript.
  • java: pros: widespread, good servers. cons: a million frameworks to choose from and none is great, next year all will be obsolete and 100 new ones will come. Slow language development (java 8 is .net from about 2005)
  • php: pros: easy, straightforward, multiplatform cons: practically web-only

They all suck, which one sucks the least depends on the circumstances of your project (time, budget, techincal aspects, what you already know, what you would like to learn, performance requirements, scalability requirements).

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>