On Friday, 30 May 2014 at 15:26:00 UTC, Adam D. Ruppe wrote:
On Friday, 30 May 2014 at 15:09:00 UTC, Chris wrote:
Plus, if there's a bug, you're stuck. I like to re-invent the
wheel too, because existing wheels might not be fit for your
purpose.
Aye. But I don't like the term "reinvent the wheel" because
writing new code isn't really an invention most the time; I
often don't create new theoretical concepts, it is just a new
instance.
To take the wheel analogy further, inventing it would mean
things like figuring out that it needs to be round, figuring
out concepts like spokes and tires and inflation etc.
That's not what I'd do if you asked me to get you a wheel. The
options there are to buy one off-the-shelf or to go ahead and
build one (quite possibly using some or many off-the-shelf
components - a few existing library functions here and there -
or maybe making my own but using existing molds - e.g. looking
up the algorithm on wikipedia but not downloading an existing
library).
I already know that round wheels rock and you need to grease
the hub and that , say, 27 inches is a pretty good size and 36
spokes is a nice round number. I don't have to do the research
that went into figuring all that out.
"Re-inventing the wheel" makes it sound a lot harder than it
is. In reality, what we're doing when writing our own libraries
is more like "assembling a new wheel from your existing
knowledge".
You don't want to ride on a wheel assembled by an idiot, but if
an experienced mechanic gave me a wheel she or he build, I'd
use it and I'd like it. (indeed experienced mechanics tend to
take very good care of their bikes!)
You're right there. "Reinventing the wheel" is often used, when
you don't want to use 3rd party software, to make you look like
an idiot.
For a server app I had to create HTML output. What did I do? I
rolled my own dom module in D (187 lines of D code, including
comments). Now I have a perfectly fine dom tree that does more
than possible with JS. Had I used a 3rd party library, it would
have taken me days to get it working properly, no customization
possible, plus I would have additional library dependencies. And
... you learn a lot while "reinventing the wheel" too.