Live data from Hacker News

Joel Spolsky is doing an IAmA on reddit

reddit.com

51–54 of 54 posts

Re: Joel Spolsky is doing an IAmA on reddit

#51
post #44

Earlier quoted context omitted.

See if you can find some bottleneck in one of your Python/Ruby/Perl apps that's chewing a lot of CPU time. See if you can devise a definition for a relatively simple function that if it was REALLY FAST would make this hot spot a lot more efficient. Then implement that function in C and expose it to the high level language. It might not be a good idea to actually use your fast C function in production (if you're new a…

> See if you can find some bottleneck in one of your Python/Ruby/Perl apps that's chewing a lot of CPU time. I found that hard to do as a starting developer who didn't know what was actually a bottleneck in my code, but I did have a particular library/gem that I wrote myself that did a few things I constantly needed (think of authentication in a web app, it's almost always included). So I rewrite it in C. It didn't r…

> I found that hard to do as a starting developer who didn't know what was actually a bottleneck in my code

That's what a profiler is for! Even experienced developers use them, it's the only reasonable way to find bottlenecks.

> It didn't really make it faster, or better, but I learned a bunch of C.

That works too! :)

Re: Joel Spolsky is doing an IAmA on reddit

#53
post #6

I really want to learn C, like he says. I get plenty done without knowing it, and I have few doubts I can continue to find decent work without knowing it, but I haven't been able to gain any traction when I try to learn it. I've got the books sitting front of me, and I've written some trivial visualizations of sorting algorithms using terminal output, but damn if I can find a way to use C as a web developer. If there…

> but damn if I can find a way to use C as a web developer Write a web app in C? ;) But yeah, in most cases C won't improve your productivity as a web developer. But it will certainly make you understand the computer better. So maybe start a recreational project in C? A command line utility, a demon, a music streaming server - something not really web-dev related.

> Write a web app in C? ;)

Probably not very fun, with all the string manipulation involved.

Re: Joel Spolsky is doing an IAmA on reddit

#54
post #53
post #6

Earlier quoted context omitted.

> but damn if I can find a way to use C as a web developer Write a web app in C? ;) But yeah, in most cases C won't improve your productivity as a web developer. But it will certainly make you understand the computer better. So maybe start a recreational project in C? A command line utility, a demon, a music streaming server - something not really web-dev related.

> Write a web app in C? ;) Probably not very fun, with all the string manipulation involved.

C is pretty flexible. Just write a create_pool() function, an sprintf()-workalike that allocates memory from the current pool, and a destroy_pool() function that deallocates the current pool. Use one pool per request. It's not Perl, but I'd imagine it's not that inconvenient - and very fast.

(See also: raphters, which was featured on HN not so long ago.)

Post reply on HN