views:

87

answers:

4

We are looking at doing a 'version 2' of our web application that is currently written in PHP with a MySQL database. Since it has been in a constant state of development for about 5 years with numerous developers, over time you look at it as a whole and think 'we could do this so much better if we started again'.

So we are looking at doing a new build and have been discussing the most appropriate development path to take. Do we stick with PHP and MySQL on Linux servers or do we make the move now to .NET.

We already have Visual Studio etc etc as we have developed integrations between our web app and many third party products like Microsoft Office and MYOB.

What I want to try and work out is what is going to be a better environment for us in terms of customer perception, scalability, support and so on. Put aside cost because I don't really care, I want the cold hard facts.

For a business management web application that requires integration with third party products both web based and application, whats our best option?

+2  A: 

If this is a version 2, then you should know all the shortcomings of your application and the new features that you want to implement. I am a fan of staying the course, if the current platform allows for all the features and the stability that you are looking for then there aren't any reasons to change. I am just getting started in this community so I am not sure what the policy is on answering subjective questions, but I can tell you that depending on who you ask, you will get a different answer to this every single time you ask.

jangeador
A: 

If I have to purely choose between .NET and PHP, .NET wins on all accounts. I cannot think of any reason why PHP would be better, except that it's more cross-platform and doesn't require Windows Server to be deployed. In your case there might be other reasons though.

Added: Sorry, I was in a hurry. Let me clarify why I think .NET is superior to PHP:

  • it's got a far better performance - it's a compiled language with JIT that produces machine code which uses all the abilities of the current CPU;
  • superior IDE - Visual Studio is by far the best IDE I've ever seen. And I've looked. For PHP the next best thing is NetBeans, but that doesn't come close either. For instance, Visual Studio (in .NET projects) is the only IDE in which I've seen code completion (aka Intellisense) which works 100% of time. Instantly.
  • the language itself has more benefits than I care to describe - strong types, proper classes (this can't be null, static methods are always static and vice versa, operators can be overloaded, etc.), delegates and events, etc;
  • the standard library is well organized PHP's long lack of namespaces and bad choices in early versions (just see the string functions) are infamous even in the most devoted PHP developer circles;
  • the documentation is spot on - Here actually PHP isn't so bad, as it's documentation is mostly quite adequate, but MSDN with its tight Visual Studio integration and wealth of knowledge still wins
  • This one's subjective, but no matter how much I've tried to write good, clean PHP code, it's always been a struggle. In PHP it's easy to throw together a quick little app, but when you want to write something bigger, with frameworks and many pages, shared business layers, etc - it's difficult. Pretty quickly it gets messy. In .NET it's somehow much easier, as if the language itself would be encouraging best practices.

Added 2: Diclosure - I'm primarily a .NET developer, but regularly write PHP code as well, so I'm fluent in both languages and their libraries.

Added 3: Note, that this is a pure comparison of both environments. The existing PHP experience (and .NET inexperience), as already said, is a very strong factor as well, probably even stronger then all of the above combined.

Vilx-
why would you say that .NET wins on all accounts?
Tim
it seems to me that you just gave me 2 very good reasons that php is better.
Tim
@Tim - sorry, read the update.
Vilx-
+1  A: 

This is an utterly subjective question and, full disclosure, I am a PHP programmer.

There is a lot of hating on PHP by non-PHP programmers for a lot of (good and bad) reasons. I will leave it to them to list the reasons why .net is better. I believe that most of the differences are academic and with that said, here are some reasons you might want to stick with PHP:

  1. You can copy and paste code out of your current app into your new app. No reverse engineering, just literally copy and paste.
  2. Your organization is probably staffed with PHP programmers, as you currently have a PHP app.
  3. PHP has more support and resources available online. The community is huge.
  4. PHP is easier to understand than .net (which is also one of the critiques of PHP, because the simplicity comes in part from lack of support for languages such as C#, J#, and C++).
  5. PHP integrates exceptionally well with MySQL (Wikipedia, for example runs on the two) as well as SQLite.
  6. Most importantly, PHP is open source. As with my #3, this means more support. It also means, in my humble opinion, more security.

But, as I said, this question is subjective and both are (nowadays) fine object oriented languages.

Ted
Comments on your points from the Dark Side: 1 - this promotes cargo-cult coding, stale code and general messiness of things; 2 - true; 3 - perhaps, but C# community is immense as well. There's no shortcoming of support and examples on both sides; 4 - Perhaps, but this again contributes to the large amount of crappy code on the net. .NET has less of that.
Vilx-
5 - MySQL has been getting along with .NET quite well for a long time already. And I've found it to be an excruciating pain to write **good** mysql code in PHP. That is, one that would properly handle every possible bad input and error condition. PDO is a bit better, but has a handful of problems itself. In .NET it's easier, albeit different. 6 - Security - maybe. More support - only if you want to scrape the internet for solutions yourself. Microsoft OTOH offers guaranteed business support. Which is best depends on your clients, really.
Vilx-
+2  A: 

I'm not a big fan of PHP, however I would suggest that there's little point in wholesale ditching your deployment platform for .Net when all you really need to do is re-architect / refactor your existing PHP application.

There is obviously some other unspoken impetus that you haven't detailed in your question, since you imply that your only options are to stay with PHP or move to .Net... Depending on the application, it's requirements and development roadmap, there may be a number of other development options available.

It's also difficult to suggest anything concrete when the purpose and integration requirements of the application are unknown.

Update

Thanks, I appreciate your comments.. as for other unspoken The managers have gotten all excited about .NET for some reason and are suggesting that we need to rebuild in .NET. I am looking for some evidence that there is anything to benefit from doing that or if we should just stick to php. – Tim

From the way you worded the original question, this is what I imagined. I'd say that the fanfare around .Net should be taken with a pinch of salt, a lot of $$$ go into marketing .Net and a lot of people eat it up whole.

That said, PHP is hardly the poster child for #1 language design and consistency, however, we're talking about the devil YOU know here, and it's a known quantity within your enterprise.

However, If the bosses are willing to invest in solid re-training, for you and your team, moving to .Net could be a good thing, particularly for you and your colleagues career development, since, bottom line you will have a more valuable skill set as an experienced C#/.Net developer.

I'd suggest pragmatism over fanaticism in either case.

slomojo
Thanks, I appreciate your comments.. as for other unspoken impetus. The managers have gotten all excited about .NET for some reason and are suggesting that we need to rebuild in .NET. I am looking for some evidence that there is anything to benefit from doing that or if we should just stick to php.
Tim
I've updated my answer in reply.
slomojo