68 karma · joined Dec 30, 2011 (14y ago) · 24 submissions
twitter.com/russjf github.com/rf
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
Re your comment about olive oil, an extra virgin olive oil has flavor and it would be pointless to roast with it, but you absolutely need oil while cooking food as it's a thermal interface between your pan or your oven air and your food. Of course there are finishing oils that tend to be something with a lot of flavor like EVOO, sesame oil, or an e.g. rosemary infused olive oil, but most oil needs to be added during cooking.
8.
Ask HN: What are some US universities with lesser-known, but great CS programs?
7 points · by russfrank · 5y ago · 2 comments
comment 7y ago · link · parent
You need to try and think about what things look like when the company is much, much larger.
comment 7y ago · link · parent
Your OKRs put that sort of thing in one place. The process to determine what the OKRs are ensure that everyone's on the same page about the objectives. People in an organization want to feel like they know what they're working towards. When they don't they get stressed out and unproductive.
13.
What are the hottest startups in The Valley right now?(facebook.com ↗)
19 points · by russfrank · 13y ago · 4 comments
comment 14y ago · link · parent
I lead a somewhat large (~10000 sloc) project which uses the module pattern everywhere. I think the best argument against the module pattern is the difficulty of debugging. I can no longer just pop open a console and inspect objects.
Responses to your individual points:
>> * you cannot use previous OOP experience
While unfortunate I believe this is largely unavoidable. Javascript's object system is not 'classical' inheritance. The module pattern, however, is also not 'classical' inheritance. Regardless of OOP technique, the New Javascript Programmer must learn about the object system.
>> * there are MANY ways to do OOP using prototypes
There are also many forms of the module pattern. You just showed me another one I hadn't seen before. Then there's immediately invoking function expressions, which some people like to do like this
(function () { var exports = {}; return exports; })());
and others like to do like this
!function() { var private = 4; return { getPrivate: function () { return private; }; }();
>> * 'this' has different meanings depending on context
Can't argue against this one.
>> * prototypes make existing objects unreliable -> requires prior knowledge about libraries and APIs (leaky abstraction)
I'm not sure I see the argument here.
>> * building an object with prototypes requires far more mental steps: ..
I'm not sure you really need to know about all of these things.. but sure, prototypal inheritance is confusing to those with a 'classical' background.
As for the advantages:
>> * conforms to established industry and business standards in OOP
I don't see why prototypal inheritance does not. If you look at CoffeeScript, it even appears classical.
>> * requires less knowledge about language details
I have to disagree here. Explaining object literals and immediately invoking functions and closure isn't all that easy.
>> * very transparent, no sugar code or libs required
That's true.
>> * neat code
There's no reason why new/this/prototypal code can't be neat!
>> * design patterns blah blah
There's no reason why new/this/prototypal code can't do design patterns!
>> * protection against corruption
I've never seen this as an issue in practice, but my code isn't running in the browser. Unless you're talking about protection from other programmers, in which case, I would quote Guido van Rossum.
>> * no this, that or self variables
Could be a good thing or a bad thing. This means that you have to know what's public and what isn't, rather than it being explicit. I rather like it when things are explicit.
Sometimes we sacrifice a little simplicity for a little flexibility or a little efficiency. Sometimes it's worth it, sometimes it isn't.
comment 14y ago · link · parent
The first part of your example is due to the conversion between primitives and objects for method calls. It has little to do with prototypal inheritance.
Then, you override the method on an instance of String. When you set toString to null, of course, the call to toString fails.
Lastly, you override it on the prototype of String, which will apply to all String objects. Why is this an unexpected error? toString is on the prototype, because it's defined on the class, not the instance. I'm not sure what the confusion is here.
comment 14y ago · link · parent
comment 14y ago · link · parent
http://vim.wikia.com/wiki/Vim_Tips_Wiki
Your .vimrc is essentially just going to be a collection of snippets that you've found that seem to do some good. Many of mine have been taken from other people's dotfiles, from dotfile projects such as
http://skwp.github.com/dotfiles/#section-13-1
and from the sites above. Take a look at the .vimrc of people you might know on github, for example. Here's mine, it's fairly well commented: