532 karma · joined September 23, 2010
Currently: Movin' money at Square
Previously: Backend developer at Airbnb, mobile developer at Khan Academy, lead developer on Burner, SWE at Google
For example, `ReadableInstant` [1] in Joda implements 3 interfaces and has 7 subclasses. And really, what is the difference between `AbstractDateTime` and `BaseDateTime`? Whereas `Instant` from java.time [2] is an immutable value type and I haven't found it lacking in any respect.
On the whole java.time has struck me as extremely well designed (after coming from Python and previous date and time libraries in Java) and I think it would behoove other languages to liberally copy its design.
[1] https://www.joda.org/joda-time/apidocs/org/joda/time/Readabl...
[2] https://docs.oracle.com/javase/8/docs/api/java/time/Instant....
I mostly read non-fiction. To improve my recall over the past 7 years, I type up notes as I read. It's made the process of reading much slower, but it has helped when I've needed to recall some example or detail or framework of a book.
I did this (selfishly) for myself, but decided to upload my notes at https://github.com/mgp/book-notes. (Shameless plug I suppose?) The README explains exactly how I take the notes – but essentially there's no shortcut. I have my text editor open and simply type notes as I read.
Some people are uncomfortable with the extensive bytecode manipulation that it does. While Lombok provides annotations, it is not your normal annotation processor. From http://notatube.blogspot.com/2010/11/project-lombok-trick-ex...:
> Project Lombok hooks itself into the compilation process as an annotation processor. But Lombok is not your normal annotation processor... The trick is that Lombok modifies the AST. It turns out that changes made to the AST in the Annotation Processing phase will be visible to the Analyse and Generate phase. Thus, changing the AST will change the generated class file.
That said, we never encountered any Lombok-related problems when running services in the cloud or locally. And the Lombok plugin for IntelliJ is good enough in that the auto-complete will "see" the Lombok-modified version of the file. For example, using the @Value annotation creates an immutable value type, which among other things a) makes every field private and final, and b) generates a getter method for each now-private field. With the Lombok plugin, IntelliJ auto-complete will a) not auto-complete the composed fields which are now private, and b) auto-complete the generated getter methods.
I highly recommend looking past the voodoo bytecode manipulation and using Lombok. The @Value annotation alone is worth the price of admission and made me a more productive programmer.
Most Android applications that rely on both Retrofit and RxJava use them together in this manner.
As for too many requests pending, I'm not sure if OkHttp (which Retrofit uses for making requests and is again on that list) is configurable in that regard. If you want to handle it at the application level, you could maybe model the request queue to the network layer as an Observable<Request> and use RxJava's backpressure operators.
For more information on functional reactive programming (which I would call promises or CompletableFuture done better), see http://reactivex.io/
And for more information on RxJava, see https://github.com/ReactiveX/RxJava
The author says that Google is making the same mistakes that LiveNinja made over a year ago. And that LiveNinja has learned a lot and iterated since then. At this point, I'm ready to believe that LiveNinja is the more mature product. That if I have a need, I should probably go to LiveNinja. I'm ready to be sold... But then the author does nothing. He don't actually tell me WHY LiveNinja is better. Instead, he mentions Google Answers, Buzz, and Wave.
Why not drop the ad hominem, and sell to your potential customers instead?
That said, at least they adopted a Unicode encoding, and helped it establish mindshare.
These slides look to be from the same deck. I wonder if there are more yet to come.
Note that if there is a lot of text traffic on a given number, carriers like AT&T, Verizon, et al will block texts to and from that number until the traffic subsides. What's worse is that if you send a message to that number from the Twilio dashboard, its status will be "sent," but you will not actually receive it. Apparently in the world of SMS, "sent" simply means the message has been delivered to the destination carrier, and it is not a delivery receipt like with iMessage or BBM.
Twilio suggests that, to reduce this risk, you load balance across a collection of such numbers, or purchase a short code, which isn't cheap: http://www.twilio.com/sms/shortcodes
You've got to let go of this attitude. If you cling to it, then you will never leave, even if your co-founders are idiots and the business is a failure. What you need to do is quit as soon as possible. Only then can you start on a better endeavor and improve your quality of life.
I once heard someone say, "Give up on crap." It may sound juvenile, and it goes against the rosy, feel-good "Never give up" pep talks that we're used to and almost expect to hear. But I've found it to be a much better guide in life decisions. Go with it.
And trust me, there is no way Google ever would have said "rewrite it in Python." They would have said "rewrite it in Java," like every other frontend they run (Gmail, Calendar, Docs, etc).
Prefer itertools.izip instead of zip to avoid materializing a new list.
Appending the comma operator to the print statement suppresses the newline character and appends a space instead, which is how print 1, "world" works.
The only tip I'd add is using mapping keys in string formatting operations:
>>> d = {'cow': 'moo'}
>>> print 'the cow says %(cow)s' % d
the cow says mooDon't ask me why Google didn't throw lots of resources at making Python more efficient like they did with JS and V8. I often wonder that myself.
I believe this is demonstrated clearly by the jobs pages for both Apple and Google. From Apple:
* Every detail matters… It matters all of the time. That’s how we do things at Apple. The result is some of the best-loved products in the world.
* Simplicity isn’t simple... It means rethinking every customer experience until the clutter has fallen away — until all that remains is what’s essential, useful, and beautiful. That might be a new product feature that delights even die-hard fans.
From Google, specifically an interview with Google employees about work there:
* ”... love to work on challenging projects”
* ”... love being faced with problems that were not ever solved before”
* ”... you hear people talking about algorithms and coding and programming languages”
* ”... it was just a pleasure being interviewed by smart people and being given a lot of puzzling questions”
I discussed this in a blog post I wrote which you can find here: http://mgp.github.com/2012/02/13/problems-and-products.html
I used to work at Google, and I joined there during a period when I wanted to work on interesting (i.e. hard) problems. I left to work on interesting products.
Don't be shy!