ID:152603
 
This doesn't only apply to DM, but does anyone else find themselves doing this?

Example: You're working on part of a game/program or adding a new feature that uses an old part in someway. Then, you have a little bit of trouble using the said old code and then just redo it all? Recently I was working on something, and then whilst adding something to interact with my old stuff, only to have a little bit of trouble.

I spent an hour or so redoing it, and now it's not only more efficient, better done, smaller but know I'll be able to add or use it where ever I want. So know I've ended up redoing around a quater of my project just because something wouldn't let me impliment stuff into it easily.

I know it's better doing it good the first time around, but sometimes it just doesn't come out right.
Yep, I do this all the time, and so do professional programmers. The technical term is refactoring. It's frequently a good thing; experience from implementing one design can often be applied to improve the design. Doing so sometimes requires ripping out and replacing large sections of code, so it can set back your progress temporarily; but in the long run having better code will save you more time than you spent doing the refactor.

Edit: Man, it's Typo City around here. I need to get some sleep...
Because I generally put down a project, then pick it up months later, I do this a lot.

But then I get to the point that I'm redesigning so much of the game, I just recode the entire system. Datums are beautiful.


~Polatrite~
Unfortunately, I don't. =(
I have no sense of efficiency, and I'm lazy, so I never redo anything unless I have to.
Whenever I work on games it's just me redoing what I've already done. I tend to realise half the objects involved don't even have a reason to exist, and then I got all suicidal...
In response to Elation
Elation wrote:
Whenever I work on games it's just me redoing what I've already done. I tend to realise half the objects involved don't even have a reason to exist, and then I got all suicidal...

I'm scared.




But yeah - I do this quite a bit. That is, until I decide that it's taking more work than it's worth and I just redo the whole thing. I've done it on at least three of my projects so far. :D
In response to Audeuro
Yep! Definately. Doing stuff like this increases the efficiently and flexibility of the game/program's code.
You had do redo one fourth. I'm going to have to redo almost all of it. The code is ugly, long, and inefficient. And believe me, there is a lot. Several .dm files worth. It's not going to be fun, but in the end the game should run much better. :/
In response to Popisfizzy
Yeah. It sucks when you have to do a lot. But a forth of my current project was only a few hundred lines.
My current work on Murder Mansion is plagued by this as we "speak"...

I know the end result will be worth it (and in some ways, requires it), but it's a very overwhelming task... Especially when the original programming was done at a relatively early stage in my BYOND experience, and is a jumbled and practically indecipherable mess...lol

In response to Smoko
Another thing I've realized are how important comments are. Some of the stuff is a mystery to me, which goes to go how poorly I wrote. It's going to be a major undertaking, but it will be worth it in the end.

*sigh*
In response to Popisfizzy
I do it all the time.

I do it midway in programming...

"Why is this *not* working... ERG *deletes whole chunks of programming and starts over*"

Oftentimes I redo it in half the time and it's much more refined.
In response to Jerico2day
I had a computer science teacher with an extreme philosophy- the projects that we turned into him could have, excepting i/o, no procedures that were more than five lines of code. It was very uncomfortable to start, but I learned a LOT about code modularization and since though I don't stick to the five-line rule, I do tend to make a whole herd of small procedures in order to handle a more complex task: it makes the code more re-usable, and often makes things easier to read and edit later on.

If anybody is looking for a challenging and interesting way to improve their code-writing skills, I highly suggest choosing a proof of concept project and completing it using the five-line restriction on non-i/o procedures.
In response to PirateHead
Five lines of what? Five lines of Python can do about a million times more useful work than five lines of Java. =)
In response to Crispy
Five line of Java. I wish I could take some classes using Python, but I don't know where to find them!
In response to PirateHead
PirateHead wrote:
Five line of Java.

[Expletive deleted].

It takes much more than 5 lines of code to, say, set up a Swing window in Java. =P

I wish I could take some classes using Python, but I don't know where to find them!

Hands-on introduction for programmers of other languages: http://diveintopython.org/

Official tutorial (bit long-winded, but worth reading once): http://docs.python.org/tut/tut.html