Hacker News new | past | comments | ask | show | jobs | submit | sumeeta's comments login

FooIsBar doesn't need to be a subclass of X, does it? The polymorphism comes from the interface (implements `quux`), so inheritance doesn't seem relevant.

Feel free to correct me if I'm wrong. Still trying to learn the difference between inheritance and "evil" inheritance :)


Python doesn't have traits/roles, so it's hard to give a good example. You should build classes by composing them from smaller pieces of classes. There are two good ways to do this; delegation and role-based composition. Delegation is where you pass the constructor of your class an instance of another class, and your "foo" method becomes an alias to that instance's foo method. This allows you to do the same interfaces/roles as the object you're "wrapping", but still lets you customize the behavior of each method call you choose to delegate. (The Law of Demeter protects you from other callers touching the non-delegated methods.)

Roles let you implement pieces of classes without being a full class yourself. A classic example is a "Comparable" role, that requires the consumer to implement a "cmp" function, and then provides lt, gt, and eq implemented in terms of "cmp". You mix this into your class that does cmp, and now it gets lt, gt, and eq for free. You also get the security of knowing that you're calling the right method; duck typing will treat a tree's bark and a dog's bark as the same actions, while roles will let you determine whether you have an object with a wooden outer layer, or an object that can talk like a dog.

Python's philosophy doesn't seem to push delegation or composition, so we use inheritance in the above example to stick with Python programmer's expectations. Just beware of invoking the wrong type of bark; duck typing is flexible, but it ain't safe.


So it means you're used to following through on your curiosity, and capable of fast growth? That's at least what I'm getting out of it right now.


How does this work?


grep treats "[m]yapp" as a regex, which will match "myapp" but not itself. That is, it won't match the exact string "[m]yapp" so the grep process won't show up in the listing.


Revision was always emphasized to me, but I never understood why. I always thought I was above it. After I became a programmer and had to look at old code I’d written, I finally understood why revision is so important.

Couldn’t my teachers have told me that revision is so important because we’re not qualified to evaluate our creations until they’re no longer fresh in our heads? It’s not an obvious concept, and I wish others didn’t have to learn it the hard way.


This isn’t as big of a deal as the headline makes it out to be. The article describes a video playback issue that Apple’s already released a software fix for.


Your statement is misleading. The article does indeed describe that playback issue, but then goes on to describe a number of other issues reported by users that go a bit beyond a 'video playback issue'.

So yes, probably not as big a deal as the headline makes it out, but also not just one bug already addressed.


mrjob doesn’t contain any Cython. The author was just stating it was a challenge getting Yelp’s codebase (which contains some Cython) running on EMR.


I understood that from the article. But, in the light of recent discussion on Cython, i though it was interesting to note a "2.0" company like yelp using Cython.


The author misspelled MacBook :(


Ha. Scalien is a great name.

How does a startup that develops database software plan to make money? Selling support?


I’ve heard that as soon as you start paying for quota, the datastore gets way snappier. I can’t confirm this though.


I have been paying for quota and I was effected by the recent flaky behavior of the datastore (as were some high traffic production apps). This was a pretty huge deal for a lot of loyal app engine users and I am pretty sure Google will not let it happen again.

Also, the upcoming "business class" service offers an SLA so it appears that the platform is maturing nicely. Since the recent datastore fix performance has been superb.


You spelled GitHub wrong.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: