4 Replies - 818 Views - Last Post: 09 April 2011 - 08:49 AM

#1 Servatis  Icon User is offline

  • D.I.C Regular

Reputation: 48
  • View blog
  • Posts: 394
  • Joined: 30-March 09

Writing useless code

Posted 05 April 2011 - 03:18 AM

Lately I have found myself doing this more and more.

I'm working on a project of my own. An idea pops into my head that peaks my interest and I wonder whether it would be possible to implement, and what would be the best way to implement it. I then spend anywhere from half an hour to a couple of hours trying different ways and using different methods. then once I found the best solution and I sit back to marvel at my own work I start to think "Is this really as usefull as I thought?" and "Does this make it unneccesarily complex?" then after a few minutes I decide to take it out.

For example, I was working on my own little project yesterday. I was working on a feature that would display information about what the user is doing. kind of like a feedback box, where the application is telling the user what is going on in the application. I'm using a multiline textbox for this. anyway I got it into my head that I wanted to make it so that users couldn't do anything to the text box, so I spent some time configuring the text box to be read only etc. the basic stuff. after that I spent a little over half an hour trying to make the text not selectable without disabeling the entire textbox (I didn't want the text to be gray) I got a good solution working. Then I got to thinking "Why would I not want users to select this text? What if they run into something and they want to copy the text and send it to someone?" I then proceeded to delete the half hours work.

Does this happen to any of you? and is it neccesarily a bad thing? even though I end up deleting it I definately learned something new, so it wasn't completely wasted time in my opinion.
My curiosity gets the better of me sometimes. And it doesn't help my productivity.

Is This A Good Question/Topic? 3
  • +

Replies To: Writing useless code

#2 hookiethe1  Icon User is offline

  • D.I.C Lover

Reputation: 416
  • View blog
  • Posts: 1,335
  • Joined: 28-September 10

Re: Writing useless code

Posted 05 April 2011 - 04:53 AM

View PostServatis, on 05 April 2011 - 03:18 AM, said:

My curiosity gets the better of me sometimes. And it doesn't help my productivity.


There's the core of the problem, if there is a problem. Your curiosity and persistence in working these things out is a virtue and will only lead to greater experience and understanding. For that reason you should keep doing what you're doing.
On the other hand, if your productivity is suffering badly to the point where there may be detrimental consequences, you might want to save yourself a to-do list and learn to put your curiosity on the back burner from time to time until your necessary work is done.

I think it could be argued that no code is ever useless if you learned something from doing it.
Was This Post Helpful? 1
  • +
  • -

#3 Servatis  Icon User is offline

  • D.I.C Regular

Reputation: 48
  • View blog
  • Posts: 394
  • Joined: 30-March 09

Re: Writing useless code

Posted 05 April 2011 - 05:08 AM

I dont really have this problem at work. since I have to work on very specific designs so I can't go off the reservation like that.

but it mainly happens on personal projects. the problem is that it's an application that is (highly) anticipated by a bunch of people. I don't really have a release date set. but my plan was to have the application finnished by the end of febuary.
the people that will be using this application are now using a very buggy thing that I wrote a long time ago, and i'm getting a lot of people complaining that stuff doesn't work. So I want to get this new, and propperly coded, application out of the door.

On the other hand I want the application to be finished when i release it.
But my definition of finished seems to get biger every day.

I have set up a to-do list, and made a point of finishing that. before I even think about adding anything else.

how far is too far when it commes to improving an application before release?
Should i just force myself to finnish the essentials and then release additional functionality in an update? that seems like the best solution right now.

maybe in future projects I should make sure to set up a solid plan, with clear boudaries. to prevent myself from going off the reservation too much.
however that still doesn't solve the fact that I spend to much time on trivial things. on the other hand I love figuring things like that out.
Was This Post Helpful? 0
  • +
  • -

#4 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Writing useless code

Posted 05 April 2011 - 09:15 AM

I find myself doing spike solutions now and again. It's a useful way to try something out. The only problem is that it takes time (which == $$) and doesn't always lead to including the solution in the project. Don't beat up on yourself, but if time is important, ask those questions you mentioned ("Is this really as usefull as I thought?", "Does this make it unneccesarily complex?") before you build it.

Sounds like you are experiencing scope creep. Do yourself a favor and come up with a set of core functionality and build that first. Ask yourself, "Will the app function without this?" If the answer is "yes" then it's not a core function and should be pruned/ice-boxed. Once you release your app with core functionality you can then start adding the "nice-to-have" stuff.
Was This Post Helpful? 3
  • +
  • -

#5 (Cryptic)  Icon User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 69
  • Joined: 13-January 11

Re: Writing useless code

Posted 09 April 2011 - 08:49 AM

My personal opinion (not that it matters) but it looks like to me your not looking into the future purpose of your idea and its actual use. I can understand that its almost impossible to find all interactive usages. (for a personal project don't sweat it).

If its for actual release, then sweat it. Personally for me, in a working environment i expect most of the features to be properly thought out. If its not it bugs the hell out of me because I end up having to figure it out for others and constantly telling them, and it feels like I'm shoving their stupidity in their face (which isn't a very nice feeling to know your potentially insulting your boss in which most bosses love yes men. Yes I'm a money man, I try my best to follow the yes).

But on personal projects, then its just your creative flow working its magic. Its one of the best ways to keep improving. Idea's get better the more you work on them and find its fault.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1