Hacker News new | ask | show | jobs
by cowboyhero 4889 days ago
She's also got a repo called "Kittydar" (Face detection for cats in JavaScript). This is someone who loves her language of choice and is just spinning out some fun projects with it. I think that's great.

Rewriting sed in JavaScript is cool. Even as a one-off, proof of concept, "I did this because I could." I mean, why not? Isn't that what the so-called hacker "ethos" is supposed to be about? She never said her version was better. She never evangelized its use over the traditional *NIX tools.

In the early 1990s, some crazy bastard decided to riff on the Unix kernel. About a decade later, another nut decided to rewrite the encyclopedia, and encouraged people to help him do it. Then another crazy wrote a programming tutorial using bizarre illustrations while eating a lot of chunky bacon. Why not? All three of those projects could have been considered pointless. We already had kernels. We had encyclopedias, and god knows, plenty of programming books.

I have the urge now to follow in Heather's footsteps, waste my own time, and write a version of sed in PHP. Or maybe Perl. And then write a wrapper for it in Applescript. Because, why not?

5 comments

For the record, JS isn't just "her language of choice". Heather works for Mozilla, and has contributed extensively to Mozilla's JS Engine[1]. So, she knows the language damn well... she literally wrote it.

[1] http://bit.ly/V8Y5V7

If she was ridiculed then others have no chance against this crowd.
Wow, that's a real twist.
> I have the urge now to follow in Heather's footsteps, waste my own time, and write a version of sed in PHP. Or maybe Perl.

The Perl guys beat you to it ;) (check the man page for the s2p program included with Perl. Might also be called psed).

"Because, why not?"

OK, I'll bite. What follows is devil's advocacy, so be warned.

On the whole, it would be better for the world if you wrote something that provided either novel functionality or improved functionality over the existing code. A poor man's sed in PHP is not really very useful, unless there's some way in which your version is going to be better for users - faster, more reliable, easier to use (though the latter could be achieved by wrapping sed in a nicer interface).

Secondly, the people most likely to use such a program are PHP developers who aren't aware of sed. They would probably be better served by being told how to use sed rather than thinking that they have to use the PHP ghetto version. Knowing that lots of people are using your poor-man's-sed, and even getting kudos from these people, does not mean that you've created something new and awesome.

OK, devil's advocate over. I don't really believe all of that, although there is _some_ truth in it. We should try to stand on the shoulders of giants, and creating a monolithic application which replicates the behaviour of sed, grep and find but in a more tightly-coupled and less reusable package is still behaviour worthy of (mild) criticism in a programmer. If we don't make these criticisms, then in 10 years we'll still be awash with half-assed versions of Smalltalk, or package managers that are no advance on apt or yum, or what-have-you.

As a community this is a huge challenge for us. So much work done by programmers is pointless reinvention of work already done (and improved in countless iterations) by others, and we should lament the fact that reuse is so hard that just rewriting stuff in your favourite language is considered to be the best option.

But what about what is better for you as an individual, as far as creating something for learning purposes or because you find a different type of interface easier to use?
> I have the urge now to follow in Heather's footsteps, waste my own time, and write a version of sed in PHP. Or maybe Perl. And then write a wrapper for it in Applescript. Because, why not?

Wise words my friend :)

At least (if by any chance writing sed in PHP doesn't teach you anything) you can look back and say "I've written sed (in PHP), maybe it didn't come up as clean or as good as the real deal, but at least I have done it".

Which programming book are you referring to?