views:

126

answers:

5

Need help here,

I'm a coder who has always felt the weight of a tremendously strong force pushing him to reinvent the wheel. It was so strong that I was nearly trying to reinvent jQuery lately [Note] and this really made me think.

I read also these well written articles, but they don't give any practical suggestions to follow in order to avoid the reinventing wheel 'brain spiral'.

Since I'm pretty sure this brute force does not push only on my brain (and I don't have money to go to a psychiatrist right now), I'm asking to the few part of coders in this website who have ever felt the same (or almost the same) of me, or maybe are still feeling the same sometimes:

HOW DO YOU HANDLE THIS MENTALLY?

What do you think (I mean the mental process, the thoughts) that halps you avoiding the somehow idious thing to reinvent the wheel?

What mental process helps you repress (or at least refrain) such force?

I read also this question: http://stackoverflow.com/questions/18428/what-considerations-should-be-made-before-reinventing-the-wheel But it's more about real consideration, it doesn't take into account feelings. Since I'm pretty sure some of you felt my feelings more than once, so you perfectly know how it feels, you know how strong is the desire to reinvent the wheel, I'm sure I'm asking to the proper audience.

There must be one or more coders here that felt the same, but came out from this auto-destruction desire, how did you do this?

[Note] FYI: luckily this time I ended up convincing myself not to do this and I reached a compromise with my insight, I'm writing just an interface that below uses jQuery. Obviously I write new functions of the interface only when I need them. In this way I waste no time, and if I will ever have spare time, I will slowly go through each function of my interface and replace the jQuery calls with a code written by myself. I know one day when Javascript will be obsolete like Assembler or Pascal, I will look back at this as another crazy thing I did, but at least a good comprimise rather than completely reinventing jQuery.

+2  A: 

Every time I think about inventing yet another wheel, I think about how frustrating it would be to support it 4 years later, when you would completely lost all interest in this particular wheel, and actually would think that this particular wheel was not your best idea, but you still have to go with it, and fix everything on your own...

BarsMonster
+2  A: 

To be really helpful we'd need to understand your particualr motivations; perhaps then we might recognise some patterns and share them. I fear that this could become a case of a teetotaller trying to advise someone with a drinking problem. I have an aversion to wheel reinvention ...

Two thoughts:

1). Try understand why you stop! Reinvent JQuery, well OK. But then why not reinvent JavaScript, the browser, the operating system ...? Do any of those further reinventions seem unappealing to you? Can you reflect on why some things seem to need reinvention and others don't?

2). I wonder whether you're simply suffering from impatience? It sometimes is much easier to write a little something yourself rather than learn the jQuery (or whatever) approach. Sometimes you have to grit your teeth and learn it. This is a matter of self discipline, you don't have to like it, habits can be broken.

djna
Well thanks for the comaprisong with the alcholic :) Anyay you gave me good PRATICAL answers: 1) I feel Javascript, the compiler, the OS is something I trust. Also in PHP i trust the native code function call like strlen, but I don't trust Swift mailer. 2) hmm.. not the case here, jQuery is pretty well documented really small learning curve, it's like I feel I could learn something reinventing it, while simply using it I learn nothing it's something anyone could do, and maybe one day one application does not work, I discover it's jQuery fault and I don't know how to fix it.
Marco Demajo
+4  A: 

I don't think there's a single impetus for reinventing the wheel; I think there are lots of them. Presumably they need to be addressed one by one:

Reason to reinvent the wheel 1: it's more fun to write something new then to learn some API that somebody else wrote.

Responses:

  • Sure, but it's not very much fun to maintain and support your new thing for years to come.
  • Sure, but it's fun later to get new features for free (as the existing tool gets upgraded with someone else's work).
  • Sure, but work isn't always fun. Sometimes you have to just suck it up and dive into the documentation.

Reason to reinvent the wheel 2: the existing solutions don't quite do the precise thing that I need.

Responses:

  • OK, so implement a wrapper/adapter/plugin that uses the existing solution and makes it work the way you need.
  • Maybe the approach the existing solution takes is used for a reason; are you sure the thing you think you need is your only option?

Reason to reinvent the wheel 3: the project I'm working on is actually really boring -- it would be much more interesting to implement a new framework layer then to do the actual domain work.

Responses:

  • If that's true, it's a shame, but it's probably not a good reason to do work that, really, doesn't provide value for your employer.
  • In many cases, a framework or library can take away the drudge work and let you focus on just the innovative or complicated part of a given task, which is more fun. But it is true that some tasks just don't have such a part. In those cases I like to focus on speed; again, a framework or library can help with that.
JacobM
+1: very rational way of thinking, I really appreciated this, it might help.
Marco Demajo
#3 is always tempting. It's the same with anything - my bedroom was always very clean around the time that I should have been studying for school exams, for instance...
Daniel I-S
+1  A: 

The biggest mental exercise I engage in is humility: with projects like jQuery (and other open source packages) there are teams of people with hundreds of years of combined experience working on them. I know I am no where near as good as they are and I would rather take advantage of their experience and get the benefit of their knowledge rather than try to do it all by myself. Additionally, I also understand that it may start off as a simple feature you need to implement and then get carried away and become a full-fledged JS framework, but for the most part, I'm much more interested in the project I'm actually working on rather than some utility that is only going to make my life easier and the end user is never going to see.

Chris Thompson
A: 

You also must separate "fun work" vs. "productive work". When you reinvent the wheel, it's not a complete waste of time as you typically will learn quite a bit in the process. I know, as I'm having to build my own XML serialization tool right now (but I have a good reason to). I'm learning a LOT in the process, stuff which will help me later but that I never would have learned without going through this exercise.

When you are focusing on being productive however, this is when the brain exercise can still be "fun" - make it a game of "how little work can I do and still meet all my project goals?" It can still be very challenging and rewarding to become an expert at finding the best libraries and modules to use, instead of an expert an hand coding every little thing.

boomhauer
You say: ...make it a game of "how little work can I do and still meet all my project goals?"...this is a very funny managers' game, but it's an absolutely no-fun game for coders. :)
Marco Demajo
Marco -- it depends. It can be very fun if you can figure out how to get existing libraries/frameworks/tools to handle all of the drudge work, leaving you to work only on the innovative and complicated parts.
JacobM
Being efficient is fun ;)
boomhauer