Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tchaffee
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
151 ms
·
1471.
▲
by
tchaffee
10y ago
I thought this technique was such common knowledge that I kept waiting for the punchline in the article. It was a good reminder that even the simple stuff deserves to be written about and revisited every so often.
1472.
▲
by
tchaffee
10y ago
Lately I've been finding a thorough test suite to be better at documenting code than comments. But I have to chuckle at "self documenting" every time I hear it.
1473.
▲
by
tchaffee
10y ago
The reason TODOs have survived the test of time is that bug trackers come and go while source code sticks around.
1474.
▲
by
tchaffee
10y ago
> Last year, our obviously racist hiring manager > African developers in general? Don't be your racist hiring manager. Stop trying to generalize.
1475.
▲
by
tchaffee
10y ago
Because the abstraction already has a name: high level language.
1476.
▲
by
tchaffee
10y ago
Google has the name to attract strong programmers. I'd like to see stats on how few (or many) strong programmers their interview process misses. Especially when that interview process is used at a company without such a huge name.
1477.
▲
by
tchaffee
10y ago
> This might go some way to explain my attitude about this Yep. You're giving bad interviews because you're expecting someone to have the same previous recent bad experiences as you. I would never ask about the context of the p
1478.
▲
by
tchaffee
10y ago
> Wikipedia disagrees; do you have a citation in mind? Nowhere in the wikipedia main article about inheritance does it cover concatenation inheritance ( https://en.wikipedia.org/wiki/Inheritance_(object-oriented_p...
1479.
▲
by
tchaffee
10y ago
I agree now that what Eric Elliot is doing is not composition. But it's not inheritance as it is commonly known either. If I inherit from a prototype, then inherited objects can use the prototype methods via prototype delegation. If I
1480.
▲
by
tchaffee
10y ago
I can get foo.author.title and foo.post.title no problem using Object.assign: Object.assign({}, { author: author }, { post: post }); Can you give a better example of where a reference to an instance is any different than copying an i
1481.
▲
by
tchaffee
10y ago
I can get foo.author.title and foo.post.title no problem using Object.assign: Object.assign({}, { author: author }, { post: post }); Can you give a better example of where a reference to an instance is any different than copying an i
1482.
▲
by
tchaffee
10y ago
Thanks for the article, it's a long read that requires some thinking so I'll get to it tomorrow. In the meantime I'll put a Kyle Simpson chapter out there as a rebuttal to "there is not a single disadvantage introduced w
1483.
▲
by
tchaffee
10y ago
How is Object.assign not a "has-a relationship"? From the first article you posted, this example of composition was given: { author: createAuthor(), posts: createPosts() } How is that different from this? O
1484.
▲
by
tchaffee
10y ago
It's sort of wrong, but not really if we are using the commonly used definition of inheritance where we think of the strict hierarchical inheritance provided by classes. And you mention prototype delegation which is only one type of in
1485.
▲
by
tchaffee
10y ago
Classes enforce a strict hierarchical relationship which is rarely how the real world works. And you also inherit everything from a parent class whether you need it or not. One alternative to class inheritance possible with javascript is ob
1486.
▲
by
tchaffee
10y ago
Encouraging inheritance in the first place is the mistake. Using composition with Object.assign is far less fragile than inheritance. An article with concrete examples: https://medium.com/javascript-scene/master-the-jav
1487.
▲
by
tchaffee
10y ago
Good naming is hard because you are using the wrong tool. Names in code, and even in the business world, are usually abbreviations for much more complex things. You should not be looking for too much meaning from the name itself. Most wor
1488.
▲
by
tchaffee
10y ago
And deliberate trolls should be exposed to protests. Protests are a form of speech too.
1489.
▲
by
tchaffee
10y ago
Because of my prior knowledge on how the subconscious works to solve problems, I had a feeling that I understood that part of the course better than most people, but maybe not. I do wish though that they would really highlight just how much
1490.
▲
by
tchaffee
10y ago
Coursera offers a course about "Learning How to Learn" which I found very helpful. Once you understand what's happening in the brain it can motivate you to do what works (e.g. spaced repetition). In that course, they talk abo
1491.
▲
by
tchaffee
10y ago
A lot of folks are saying there is no substitute for complete immersion in a country that speaks the language. While it's true that immersion is a huge help, it's not so difficult to simulate. I learned Italian in Italy, but now I
1492.
▲
by
tchaffee
11y ago
I've said long ago that Google at one point became a new R&D branch of the US military.
1493.
▲
by
tchaffee
12y ago
I think the breakdown could be helpful for other people doing a KS project, but 7% profit margin is good for many businesses.
1494.
▲
by
tchaffee
13y ago
Java would be an example of a language with weaker OOP capabilities. Javascript can emulate classic OO inheritance and it also supports prototypical inheritance. Crockford covers this in his Good Parts book, and you can find stuff around th
1495.
▲
by
tchaffee
13y ago
Could you give a concrete example? Why wouldn't you be able to use first-class functions when building something up from user input? How about giving us a code snippet? The consensus in the CS community is that the command pattern disa
1496.
▲
by
tchaffee
13y ago
The command pattern is featured in the article. Why would you use that pattern in a language that supports first-class functions?