I don't think that's really a fair categorization of the specific comment you've responded to (especially given its parent). Did you perhaps interpret "ribbing" as a sexual reference, rather than meaning "good-natured teasing" ? I do agree that https://news.ycombinator.com/item?id=7688033 is quite low-substance, and think it would be better to call it out instead.
{
f();
var a = 3;
function f() {
console.log(a);
}
}
That will print "undefined" because the entire function f() is hoisted and callable in the first line, but the variable a has not yet been assigned the value. That's not a race condition (those are related to timing in concurrent systems) but is certainly the sort of counter-intuitive visibility that makes me prefer to use function expressions most of the time.
You can still pass in callbacks to them. So if I got the parent's intent right, you've got:
function bunchOfAsyncThings(callback) {
var function1, function2;
function1 = function (callback) {
// do stuff here, then do callback
function2(callback);
};
function 2 = function (callback) {
// done with everything
callback();
};
function1(callback);
}
Not to be harsh, but in my first responder as well as my first aid training the first thing is "check for your own safety". If unsafe, then be as selfish as you can. If I was in a helpless situation, I hope I don't still try and help with the result that both don't survive.
e.g. fire and person inside some room is really far away, lots of smoke, cannot see, heat, etc? Close the door, you cannot help and you'll very likely die.
As said: This is taught during first aid and first responder courses.
Very difficult situation. Very hard to risk your life to save another. But how do you live your life knowing that you could have saved another life but you were not brave enough. Scares me just to think about being in that predicament.
I don't know if he had kids or not ... but I have four and still would rather that they considered their father a hero than "that guy who wouldn't do anything". I have good life insurance because there are plenty of instant ways to go.
I think that it’s important to try to help other people, but your safety is also important. For example it’s common that to rescue one person is drowning, more than one person attempts a rescue and all of then get drowned. You must learn how to proceed in those cases to be helpfull.
A few years ago I did a first aid mini-course. It was mostly about CPR and how to act in case of fire and chemical splits. The guide emphasized that the security of the rescuers is important. For example that before entering a door, you must check that the door will not close and trap you inside the dangerous place. Or make sure that the place you enter don’t have toxic fumes.
I agree that you need to be trained ... classes that teach life-guarding skills are essential around water, basic and advanced first aid, mountaineering, wilderness survival. You also need to be physically fit enough to do what you're contemplating (and more importantly ... know your own limits). I'm not going into details (it's not the point of my original comment) but learning these skills has been worthwhile.
Good lord. There's a huge range of options in between dead hero and "that guy who wouldn't do anything". You might, for example, bail out at some point after trying to help, and you should be allowed to make that decision without being equated to an idle bystander in any way.
You'd have them think that a stranger was more important to you than them? I don't think I'd ever give up my own life for a stranger's. Even the thought of my six-year-old son trying to cope with that news is pretty unbearable.