News for hackers. Stuff that matters.
Re:Joel Spolsky is doing an IAmA on reddit by chrisaycock on Wednesday April 20, 2011 @03:11PM (#2467951)
Every time you feel like you've made the world better by upvoting a story about injustice, you're just making yourself feel smug. Forget the upvotes... go work on making the world a better place.

He was writing about how stories of social injustice get a ton of upvotes, but nobody actually goes out and does anything to fix the situation. I'm sure there's a lesson here for HN.

Re:Joel Spolsky is doing an IAmA on reddit by pstack on Wednesday April 20, 2011 @04:17PM (#2468194)
I don't have the time, energy, or resources to address every single social injustice or well intended cause. I might donate cash and possibly even time toward a cause after I have taken care of my job and mortgage and family and other immediate self-survival needs, but there are just too many causes that are worthy.

I can, however, give the slightest nod of support to promote countless causes that I may appreciate, but not be able to do anything about. Or I could smugly tell people how smug they are (believe me, I do that, too!).

Edit: Not that I don't agree there are far too many cause-whores out there who have stickers and shirts and web-buttons for a bunch of trendy causes that don't contribute toward anything in the world and that there aren't a ton of people who feel they directly had a part in the recent middle east uprisings, just because they followed activists in the thick of it, via Twitter.

Re:Joel Spolsky is doing an IAmA on reddit by hunterjrj on Wednesday April 20, 2011 @06:03PM (#2468574)
Pertinent quote:

"I defend the value of "not caring about 90% of stuff" Care deeply about everything == accomplish nothing." - John Carmack

Re:Joel Spolsky is doing an IAmA on reddit by makmanalp on Wednesday April 20, 2011 @03:25PM (#2468004)
Aptly named "slacktivism" (I didn't coin that one).
Re:Joel Spolsky is doing an IAmA on reddit by pclark on Wednesday April 20, 2011 @03:26PM (#2468011)
Can anyone argue that the time spent upvoting a reddit story of injustice provides negative net value to the world?
Re:Joel Spolsky is doing an IAmA on reddit by michaelkeenan on Wednesday April 20, 2011 @08:11PM (#2468947)
Yvain wrote about this on Less Wrong. He described a study that showed that people who had just done one good act were less likely to do another: http://lesswrong.com/lw/1d9/doing_your_good_deed_for_the_day...

"All those biases that lead people to give time and money and thought to causes that don't really merit them waste not only time and money, but an exhaustible supply of moral fiber"

Re:Joel Spolsky is doing an IAmA on reddit by tomjen3 on Wednesday April 20, 2011 @03:41PM (#2468060)
I can, I think:

When you upvote a story on reddit about some issue you deeply care about, that tricks your brain into thinking that you have done something about it.

It is the same problem that announcing your goals makes you less likely to achieve them, because you already see yourself as a person who has accomplished that.

Re:Joel Spolsky is doing an IAmA on reddit by DavidChouinard on Wednesday April 20, 2011 @03:47PM (#2468081)
Related: http://www.ted.com/talks/derek_sivers_keep_your_goals_to_you... (one of Derek Sivers' TED talks)
Re:Joel Spolsky is doing an IAmA on reddit by chrisaycock on Wednesday April 20, 2011 @03:39PM (#2468052)
If people felt they had "done something" with the upvote, why would they feel the need to intervene for real?

One of the negative consequences of social media in general is that it can lead to very casual and even cynical views of how we relate to one another. Thus, what was meant to bring people together can actually make them more emotionally distant. If I see a hundred stories of trouble in the world, why would I take action on even one of those troubles?

Re:Joel Spolsky is doing an IAmA on reddit by warrenwilkinson on Wednesday April 20, 2011 @04:20PM (#2468207)
I notice this in politics. Some people vote for charitable political parties, while they themselves never give to charity.
Re:Joel Spolsky is doing an IAmA on reddit by pavlov on Wednesday April 20, 2011 @05:45PM (#2468510)
This actually makes sense in politics, because a successful party can exercise charity on your behalf using tax money.

It's the "Swedish model" -- there private charity is rare, but public welfare and development aid is generally accepted and supported by voters.

Re:Joel Spolsky is doing an IAmA on reddit by Retric on Wednesday April 20, 2011 @10:57PM (#2469288)
It works as a stable multi player multi round prisoner's dilemma.

Basic strategy "always defect until everyone agrees not to while voting that everyone not defect."

Re:Joel Spolsky is doing an IAmA on reddit by euroclydon on Wednesday April 20, 2011 @01:50PM (#2467600)
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 were just some use case where C would help me get something done, I'd be all over it.

Re:Joel Spolsky is doing an IAmA on reddit by follower on Wednesday April 20, 2011 @03:01PM (#2467909)
For years as I developed with Python and Javascript I thought "I really should write something in C again and maybe I should learn some C++". But nothing I was doing was performance critical or low level enough that I needed C or C++.

Then, a funny thing happened and I started playing with the Arduino.

And, while they go to great pains to hide it from non-technical people, the whole Arduino stack (ignoring the IDE) is based on C/C++. So then I began writing C again and learning C++. (I always find it slightly odd that I'm using C++ on a microcontroller--admittedly it's very small subset of C++, mostly just used for the object encapsulation/abstraction. (Insert handwavy, "yes, yes, I know it's not strictly C above library level" here.))

So, you might like to take a look at playing with the Arduino if you want to get into C. And if nothing else it's fun playing with tangible things that interact with the "real world".

Re:Joel Spolsky is doing an IAmA on reddit by fryguy on Wednesday April 20, 2011 @05:49PM (#2468526)
You can take slightly larger leap, and program the Arduino processor directly, without using the Arduino abstraction. It's the next logical leap, as "industry" doesn't really use the Arduino platform.
Re:Joel Spolsky is doing an IAmA on reddit by Homunculiheaded on Wednesday April 20, 2011 @03:10PM (#2467945)
A great exercise for Web developers is to build a minimal web-server. You can choose your definition of 'minimal' but essentially it should receive some request and return a response (from and to a web browser). As a webdev I found even the very, very minimal web server in Land of Lisp to be really insightful to build. If you wanted to flesh out the actual handling of http verbs better that would be even more awesome. Minimal webservers should be the minimal lisps of web developers
Re:Joel Spolsky is doing an IAmA on reddit by SkyMarshal on Wednesday April 20, 2011 @02:16PM (#2467706)
Re:Joel Spolsky is doing an IAmA on reddit by orijing on Wednesday April 20, 2011 @03:38PM (#2468050)
You could try using C to solve some problems on Project Euler, or puzzles like Facebook Puzzles, or even past problems from Google Code Jams.
Re:Joel Spolsky is doing an IAmA on reddit by Splines on Wednesday April 20, 2011 @05:40PM (#2468493)
I found Project Euler and Topcoder to be easy ways to get into C (although nothing beats learning on the job).
Re:Joel Spolsky is doing an IAmA on reddit by xentronium on Wednesday April 20, 2011 @03:38PM (#2468049)
> 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

Write a C-extension for infrastructure-level ruby gem if you're a rubyist, or fix a bug / add a feature in your favorite scripting language.

Re:Joel Spolsky is doing an IAmA on reddit by jrockway on Wednesday April 20, 2011 @02:37PM (#2467804)
So, if you're a web developer, you probably use Perl, Python, Ruby, or some similar language. Guess what, these are written in C(+). When you need to add or fix a feature, guess what language you use?

(+) Yes, yes, programming languages are not written in anything. Their implementations are. I know you know what I mean.

Re:Joel Spolsky is doing an IAmA on reddit by euroclydon on Wednesday April 20, 2011 @03:04PM (#2467926)
I hear you, but adding or fixing a feature in Python/Ruby/Perl doesn't ever come up for me. Does it for you? Plus, I understand that much of the standard libraries are written in the high level language.
Re:Joel Spolsky is doing an IAmA on reddit by haberman on Wednesday April 20, 2011 @04:53PM (#2468335)
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 at C you might have a security vulnerability in there, and there could be maintenance headaches). But you'll have learned a lot.

Re:Joel Spolsky is doing an IAmA on reddit by uxp on Wednesday April 20, 2011 @06:08PM (#2468589)
> 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 really make it faster, or better, but I learned a bunch of C.

Re:Joel Spolsky is doing an IAmA on reddit by haberman on Thursday April 21, 2011 @02:16AM (#2469639)
> 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 by bricestacey on Wednesday April 20, 2011 @11:20PM (#2469323)
I have not needed to add or fix a feature in a programming language but I have needed a ruby gem that uses native extensions (written in C) that are not available for my environment. I know enough C, but I have no idea how to implement this so I can't use it. Thus, instead of calling a few functions in a library I literally have to install another version of ruby, wrap the gem in some high level API, and expose the service via Sinatra, and call it via Net::HTTP. Not fun.

Particularly, libraries search their catalogs using the z39.50 protocol. Ruby 1.8 has a gem ruby-zoom[0] that does this using YAZ[1] however there is not a ruby 1.9 version. If anyone has a guide that explains native extensions for Ruby, please advise.

[0] http://ruby-zoom.rubyforge.org/ [1] http://www.indexdata.com/yaz

Re:Joel Spolsky is doing an IAmA on reddit by lactoferment on Wednesday April 20, 2011 @02:12PM (#2467687)
Write a LISP interpreter? :-)

This was the final project in the C class I took in college. It's not a bad idea.

Re:Joel Spolsky is doing an IAmA on reddit by olavk on Wednesday April 20, 2011 @05:57PM (#2468552)
Heh, the only thing I have ever written in C was a Lisp interpreter :) I learned some C and Lisp at the same time, so it was a valuable exercise.
Re:Joel Spolsky is doing an IAmA on reddit by notyourwork on Wednesday April 20, 2011 @02:24PM (#2467743)
Great project; I remember implementing a scheme interpreter in scheme back in undergraduate. It gave me a great understanding for scheme.
Re:Joel Spolsky is doing an IAmA on reddit by volkadav on Wednesday April 20, 2011 @02:50PM (#2467864)
Try writing a custom apache module? (Or nginx, or similar...) You can do some pretty fun things once you get into that layer of the web transaction life cycle (e.g. modifying behavior of things outside of the usual request/response part of the http transaction that you'd usually work with).
Re:Joel Spolsky is doing an IAmA on reddit by 2mur on Wednesday April 20, 2011 @02:24PM (#2467737)
I'm learning it now too. My primary use case, at least initially, is going to try to extend python with C. Not really because I have a need, but mostly because I can't really imagine needing C for any other task than speeding up some of my poorly optimized python at some point down the road.
Re:Joel Spolsky is doing an IAmA on reddit by elai on Wednesday April 20, 2011 @03:10PM (#2467944)
Make an iPhone app to connect to your web apps? That way you'll have a need to use it, even if your mostly typing objective-c.
Re:Joel Spolsky is doing an IAmA on reddit by rubentopo on Wednesday April 20, 2011 @02:32PM (#2467779)
Maybe doing some time-consuming jobs in C?
Re:Joel Spolsky is doing an IAmA on reddit by leon_ on Wednesday April 20, 2011 @02:08PM (#2467676)
> 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.

Re:Joel Spolsky is doing an IAmA on reddit by euroclydon on Wednesday April 20, 2011 @02:37PM (#2467801)
Listening to you, I'm thinking about just reading the C books and nothing more. If C's usefulness to non-C-programmers is simply that it gives them greater understanding of how computers work, then reading might suffice.
Re:Joel Spolsky is doing an IAmA on reddit by BrianHV on Wednesday April 20, 2011 @03:07PM (#2467932)
I'd encourage you to write some code, too. There's a lot of intuition you gain by manipulating the bits that you can't get by reading. You may think you know what a pointer is, but until you've had to debug a double-free segfault or a memory leak, it's hard to understand the ramifications of the concept. The standard string handling functions look trivial in documentation, but when you actually use them you'll find yourself forgetting to add null bytes or not realizing that some of the functions mutate the string you're working on. I'd argue it's that process of figuring out how to make things work that gives you the famed understanding of how computers work.
Re:Joel Spolsky is doing an IAmA on reddit by tedunangst on Wednesday April 20, 2011 @04:32PM (#2468250)
I don't think sufficient understanding of how computers work can come from just reading a book. If it could, you should read a book about how computers work, instead of trying to glean that through the lens of C programming. Understanding comes from doing.
Re:Joel Spolsky is doing an IAmA on reddit by jswinghammer on Wednesday April 20, 2011 @05:23PM (#2468439)
If you have read the K&R C book I am not sure you would say that. It's great no matter what you do with it.
Re:Joel Spolsky is doing an IAmA on reddit by smokinn on Thursday April 21, 2011 @01:21AM (#2469537)
Personally, I don't agree. I think a majority of the value of K&R actually comes from the exercises.

K&R gives you a very good, clear and detailed explanation of the topic at hand and then immediately gives you several exercises to practice it. If you don't do the exercises the information will just fall out of your short-term memory whereas if you actually do them your long-term memory will get engaged as well as general muscle-memory for C coding.

Re:Joel Spolsky is doing an IAmA on reddit by tedunangst on Wednesday April 20, 2011 @05:42PM (#2468499)
That's a bizarre thing to say. Do you think the K&R book is a great way to learn French?
Re:Joel Spolsky is doing an IAmA on reddit by jswinghammer on Wednesday April 20, 2011 @09:09PM (#2469071)
No offense but are you just being obtuse? Clearly I meant something other than what you are suggesting.
Re:Joel Spolsky is doing an IAmA on reddit by EdiX on Thursday April 21, 2011 @05:26AM (#2469902)
> 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 by JoachimSchipper on Thursday April 21, 2011 @07:13AM (#2470170)
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.)

Re:Joel Spolsky is doing an IAmA on reddit by ceejayoz on Wednesday April 20, 2011 @01:47PM (#2467588)
A dedicated ama.stackexchange.com could be an interesting experiment.
Re:Joel Spolsky is doing an IAmA on reddit by gecko on Wednesday April 20, 2011 @01:56PM (#2467632)
I'm not really convinced that StackExchange is the best system for that. You'd really want one StackExchange per person; otherwise, the one-answer-per-question nature of StackExchange, with voting for "correct" results, which result in bizarre gaming behavior and impossible-to-follow discussions.
Re:Joel Spolsky is doing an IAmA on reddit by chrisboesing on Wednesday April 20, 2011 @02:00PM (#2467652)
You could use the tag system. The questions would be at ama.stackexchange.com/questions/tagged/Joel+Spolsky. The person who posted the question just had to accept the answer of the person who he had asked.
Re:Joel Spolsky is doing an IAmA on reddit by scorpion032 on Wednesday April 20, 2011 @02:52PM (#2467874)
The native use of reddit is to be able to do an IAmA. Why would you even want anything else for that?
Re:Joel Spolsky is doing an IAmA on reddit by Apocryphon on Wednesday April 20, 2011 @02:34PM (#2467785)
He mentions how functional programming is valuable, something that many graduates are lacking in. Does JavaScript count as a functional language?
Re:Joel Spolsky is doing an IAmA on reddit by jrockway on Wednesday April 20, 2011 @02:36PM (#2467796)
Do Javascript programmers program in terms of function applications, or do they program in terms of sequences of state-changing operations?

If they do the first, then Javascript is a functional language. But without even a function composition or application operator (or function), it's obvious tht Javascript is not intended to be functional. It's an imperative/OO language with lambdas, like Common Lisp.

Re:Joel Spolsky is doing an IAmA on reddit by olavk on Wednesday April 20, 2011 @02:45PM (#2467837)
There is no canonical definition of "functional language", so I guess it depends on your definition. JavaScript is an OO-language, but it is possible to program in a functional style, just as with many other OO languages.

But typical JavaScript development will not teach you the functional programming paradigm, if that is what you ask.

Re:Joel Spolsky is doing an IAmA on reddit by runevault on Wednesday April 20, 2011 @06:47PM (#2468709)
If you really want to learn functional programming, you are better off trying something that at least makes you go out of your way to code in a non-functional style. Anywhere from all the way off the deep end with Haskell to Clojure and F# being good choices from personal experience.
Re:Joel Spolsky is doing an IAmA on reddit by harryh on Thursday April 21, 2011 @02:50AM (#2469699)
no