bookface's comments

bookface | 4 years ago | on: Don’t be spooky

I don't take as much issue with this happening the other way around. It's a rare opportunity for the information asymmetry shoe to be on the other foot.

bookface | 11 years ago | on: ITerm2 2.0

This is exactly why I started using iTerm. You and I even use the same key combination! It is so convenient that whenever I use others' machines, I try to bring down the visor and get frustrated when nothing happens.

Terminal.app can do this with the help of TotalTerminal. I used to use that, but switched over to iTerm for the greater degree of customization.

bookface | 12 years ago | on: CoffeeScript's Time is Waning For Me

Can anybody explain some good use cases of implicit return? When I was doing a project in CoffeeScript last year (the only time I've used it), I found myself just using the return keyword explicitly because it was more readable, and I never ran into the issue the article talks about where it can be bad to accidentally return something from a function that should return null/undefined.

When would implicit return make code better? Maybe I'm answering my own question, but I can see them being more readable to somebody coming from a Haskell or LISP background than to somebody like me who has worked mostly in C, Java, and Python.

bookface | 12 years ago | on: A glimpse of undefined behavior in C

I like using it when I'm filling an array with an indeterminate number of elements. I've used this pattern a few times:

    foo foos[255];
    int ct = 0;

    if (<condition for adding first element>)
        foos[ct++] = foo1;

    if (<condition for adding second element>)
        foos[ct++] = foo2;

    ...

    for (int i = 0; i < ct; i++) {
        /* do something with foos[i] */
    }
IMHO, this is more concise and readable than separating the increment and assignment into two lines.

bookface | 12 years ago | on: A glimpse of undefined behavior in C

I was actually asked in an interview at Google in 2011 whether pre- or postincrement was faster in a snippet of code where the expression's value wasn't used. When I said that I was pretty confident that the compiler would produce the same assembly in both cases, the interviewer insisted that pre- was faster based on the same logic you mentioned.

To her credit, she didn't penalize me for disagreeing with her and I still got the offer.

bookface | 12 years ago | on: It's the Umami – Why the Truth About MSG is So Easy to Swallow

I didn't originally see the connection between MSG and Chinese food as coming from a place of racism, but you might be right. I'm still not so sure though. If somebody said to you "I got food poisoning from a Chinese restaurant last night", would you say "That's racist! An Italian restaurant could have just as easily given you food poisoning."?

It's pointless to try to tell people what is and isn't offensive. Normally, I err on the side of thinking that if somebody is offended, they must have reason to be and I should be sensitive to that, but in this case I had no idea what racism the author was referring to.

bookface | 12 years ago | on: It's the Umami – Why the Truth About MSG is So Easy to Swallow

I think the main difference between the two is the intent that's being implied. "Jewish Banker Syndrome" is implying something about me as a person. It's saying that, as a Jew, I'm more likely to be greedy and corrupt. "Chinese Restaurant Syndrome" isn't really blaming the Chinese for anything, it's just noting the correlation that was observed.

Maybe a better comparison would be "Jewish Bank Syndrome", which to me sounds a lot less harsh than "Jewish Banker Syndrome".

bookface | 12 years ago | on: The Code Documentation Fallacy

Agreed completely about how awful dynamic languages can be in this respect. I've found what helps a lot is consistent naming of parameters. For example, numberOfWidgets (an integer) versus widgets (a collection) or file (a file handle) versus path (a string).
page 1