views:

299

answers:

4

I'm tired. I have ~30 really messy PHP files in my project. Hearing people say that Asp.net is more structured , that it is better (I'm mostly relying on Jeff's advice @codinghorror here) and that it is possible to use asp.net without using bloated software from M$. I don't want to and will not convert the the work done upto now, by hand.

Note: I want a good tool -- I don't want to go from ~30 unstructured and messy files to even messier stuff stored in a quantillion directories with odd file names (Java)

+1  A: 

I'm not sure how much luck you'll have finding a program that'll convert 30 messy PHP files into beautifully structured ASP files, I think someone would make quite a fortune with something like that (and a lot of us would be out of jobs). However, if you really want to pursue it, googling for "convert php to asp.net" turned up multiple results.

Adam
Like if the PHP code is satisfactory, then can it at least produce something satisfactory? btw. I could search on google if I wanted ... I posted a question here because I wanted to know whether *anyone has had success with such a tool* , not some fricken marketingspeak page about some horrible tool.
Aviral Dasgupta
http://www.asp.net/downloads/archived/migration-assistants/php-to-aspnet/ Considering it's coming from the horses mouth, I would assume it's trustworthy.
Adam
+9  A: 

The difficulty is that you can do some things automatically in ASP.NET that you have to do by hand in PHP. For example, if I change a input textbox and when I tab away I want it to be saved automatically, in ASP.NET I can use AutoPostback='true'. Then, in the code-behind you would handle this update.

My point is that ASP.NET and PHP are very different, in that there are so many tools that ASP.NET that you can use, so your code will look very different when going from PHP to ASP.NET.

I think using a tool would be a bad idea, as this rewrite would give you a chance to clean up the code and to decide which options to use that are available.

UPDATE: In order to do more with interactive applications there is a free toolkit available that I would recommend: http://www.asp.net/ajax/AjaxControlToolkit/Samples/

James Black
btw. do you know of any good asp.net books for people who "know their stuff" in PHP?
Aviral Dasgupta
I haven't read any books on ASP, using VS2008 it is pretty easy. I will add an update that will help.
James Black
+3  A: 

I build automated translation tools for a living (see DMS Software Reengineering Toolkit. In my 15 years of experience doing juist this, it isn't worth the trouble to build ("customize DMS" or do something similar with a similar techology if you can find it) a translator for 30 * 1000 lines of code.

You might be hoping for somebody to have done this in advance, "Gee, wouldn't it be keen if somebody built such a translator and I can just use it?" Such a hope is pretty forlorn. The problem is that every source application uses some arbitrary combination of input technologies (you're probably using PHP, MySQL, JavaScript and some weird libraries) and want some arbitrary configuration of output technologies (ASP, TSQL, JavaScript, C# libraries). The space of input/output configurations is too vast for you to have any real chance of encountering at translator that somebody might have built that matches your needs. Therefore you'll need a custom translator. Ooops, back to the previous paragraph.

You can pray for miracle. But I suggest you clean up your PHP files and live with them. The world is full of "beware what you build, because it will last a lot longer than you expect". Choose your technology and architecture more carefully next time, so you don't end up with "messy files".

Ira Baxter
A: 

Sorry mate. If your OOPS fundamentals are strong you just have to twist a bit & write the code.And ASP.Net is a framework, not a language.You can use an IDE like visual studio to make your life easier

JJ