Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a personal web project I cut my teeth on learning how to program. I wrote it in PHP and learned as I went. I eventually I re-factored it to use MVC and removed all mixing of php/html.

Right now it has no users, save myself, and it makes no money. I have a strong desire to rewrite the entire app. Which really isn't that large of an app.

I have a lot of reasons why I should not rewrite it. I know that I should move forward. It's a working app now and it will only set me back to rewrite it. But I can't shake this feeling that I would be better off using a different programming language in the long run. That I'd enjoy it more. That I'd feel comfortable with it. I feel like my one good reason to rewrite my app is that I have a gut feeling that I should.

PHP seems like a hack thrown together. I want to use a language that feels more elegant to me.

Any feedback you have would be welcome.

share|improve this question
    
Eh, if it is your personal hobby horse do whatever you like, it is fun. –  Gaurav Feb 22 '11 at 10:54
    
A significant reason I don't want to rewrite is that I don't want to lose the time I've already put in. I'm sure that in the long run it will be better for me to rewrite. I'll learn more, I'll use better tools. –  Supermighty Feb 22 '11 at 18:42

9 Answers 9

up vote 7 down vote accepted

If your the only user and there are no deadlines or constraints why not rewrite it. It sounds like mainly an academic exercise anyway so you can't really lose.

share|improve this answer

I have a lot of reasons why I should not rewrite it. I know that I should move forward. It's a working app now and it will only set me back to rewrite it.

Rewriting something that is written in PHP in another language is moving forward.

share|improve this answer

Leave it. Go find some users. If you can't find any, there's no need to rewrite it. If you do find users, they'll probably push your project in directions you never considered. These new directions will eventually break things and you'll be forced to rewrite. Change your tech then if it makes sense.

If this project is just for fun, do what ever you want. A good rewrite is often as refreshing as a colonic cleanse. Then again, not rewriting frees up some of your time so you can start a new project. New projects can be even better than a colonic cleanse. Done right, they're as full of hope and possibility as an uncooked brisket.

share|improve this answer
    
It's for fun, learning, and maybe one day I can make it a business. –  Supermighty Feb 21 '11 at 22:51

Every time you rewrite something, you understand it better, the underlying structures simplify and the implementation becomes cleaner.

I would delete and rewrite everything three times if I had the time to do so.

share|improve this answer
    
I learned a ton when I re-factored my app the first time. It changed so much you could consider it a rewrite. –  Supermighty Feb 21 '11 at 22:48
1  
@Supermighty You'd be surprised at how much there is left to learn when you rewrite it for the second time. –  biziclop Feb 21 '11 at 22:58

I would start a different project, with different challenges. It would also be a good way to learn a new programming language. You've rewritten it once, why not leave it alone for now and start something fresh? Rewrite it in the future, when you have much more experience and you'll see how far you've progressed.

share|improve this answer

If you want to rewrite it, rewrite it. You dont 'need' any reason other than your own gut telling you to do so. Its your application, no one knows it better than you. The only thing worse than doing a complete re-write of an application is blindly following maxims such as 're-writes are always bad'.

Think of such maxims as the 'pirate code'. Not law... just general guidelines. They should never be a substitute for your own judgement.

share|improve this answer

If I were in you place, I would go for it, and you can keep you current site on-line while you work. You can even use the existing site to guide you though the rewrite, by pointing what works well and what don't works so well and how to fix that. Note that this is you base requirements, the implementation if a different thing. Also I sense that you want to learn another web language, and this is one case where you can do it without many risks, but be careful to analyze the language that you want to use, so that you don't make a step larger than you you. (For example from PHP to J2EE...)

share|improve this answer
    
This is basically my plan as it stands now. I'm looking around for another web language to use and I'm pretty sure it's going to be Python. It's the language that's giving me the best overall feel so far. –  Supermighty Feb 22 '11 at 18:37

PHP can feel as elegant as the developer wants it to, it just happens that alot of PHP code is poor. Switching language may make your code better because you are forced to work a specific way but there is nothing stopping you doing that now with PHP.

As for the rewrite, give it a try, you will know fairly quickly if you have learnt anything and if it was positive. Assuming you do a good job it should be easier to maintain and update in the future, also, you may end up with some code for other projects.

share|improve this answer
    
I don't want to be the kind of person who can only do it "if I had the right tool". But I can't shake the feeling that PHP is cludgy, and cobbled together. I have my eye on Python. –  Supermighty Feb 21 '11 at 22:56
    
It just may not be for you but in the right hands it isn't cludgy, luckily though we have so many choices. I've been a PHP developer for 11 years and tbh if I had a choice I would go back an learn something else but not because of any deficiency with PHP. I'm attempting to learn C# atm, PHP pays the bills though. –  G3D Feb 21 '11 at 23:05
1  
It's not the syntax I find cludgy. Rather that every thing is in a global namespace, there are a ton of functions with odd and confusing names, and inconsistency all over the place (argument order being one of them). But it doesn't pay the bills for me, so I guess it's a good time to learn something else if I desire it. –  Supermighty Feb 21 '11 at 23:11

What's the difference between art and design? If you're doing art, you decide when you are done. If you're doing design, the client decides when you are done.

If you have no client, the decision to refactor or rewrite is entirely yours. Do what makes you happy.

I've found it useful to approach the same problem in a different language, just because the idioms and facilities of each language give me an alternate perspective on the problem. The worst possible thing that can happen in your case is that you'll find that you gained no new insight for the time you spent. But that's extremely unlikely.

As someone with lots of experience outside php who's suffered through some legacy php code that I'd give anything to be able to completely rewrite, but probably won't find sponsorship for anytime soon, I find your position, free from the constraints of the needs of a business owner, somewhat enviable. If you have the opportunity, and there isn't some more compelling problem you want to attack, why not rewrite?

share|improve this answer
    
I need to stop myself from seeking perfection. I think that in part I'm doing that. I know there isn't any perfect programming language. I'm just looking for one with a better feel (better chi) than PHP. –  Supermighty Feb 22 '11 at 18:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.