Live data from Hacker News

Instagram Makes a Smooth Move to Python 3

thenewstack.io

31–40 of 62 posts

Re: Instagram Makes a Smooth Move to Python 3

#31
post #16
post #7

types in python 3.5?! I had no idea -- that's exciting.

Note they are type annotations . They are for tooling/development only; the runtime doesn't care about the types at all.

> Note they are type annotations. They are for tooling/development only; the runtime doesn't care about the types at all.

Neither does, say, Haskell's runtime.

Re: Instagram Makes a Smooth Move to Python 3

#32

Right, you hear a lot of griping about moving from Python 2 to 3 but I personally didn't have as much trouble as expected. Some of my projects just worked. One small tip I don't think they mentioned. Start using the logging module instead of print and it will eliminate one class of potential issues.

I've heard people complain about print being a function now more than a hand full of times and my response is always "are you really using print that much in your code base?"

Re: Instagram Makes a Smooth Move to Python 3

#33

“Yeah, Python is great in so many ways, too bad it’s not really scalable.” I'm not even sure what this means anymore. I guess I'm just not sure how any language, when used correctly, could be inherently unscalable. My guess is statements like this came from a time when monoliths were the application design of choice? Now, assuming Instagram has just 1,000 photo handling servers, each one is only responsible for 95,00…

See issues like https://engineering.instagram.com/dismissing-python-garbage-...

If you have to turn off a crucial language feature to increase performance, I'm not sure whether a language is considered "scalable".

Re: Instagram Makes a Smooth Move to Python 3

#34
post #19
post #17

Earlier quoted context omitted.

Not really. You'll notice a pattern in most tech bigcos where they move from dynamic lang X to a statically typed language that can multithread properly. A few examples: Ruby on rails to java (twitter). Java & c++ (google). Java (linked in). Python/Node -> Java/Go (uber). Or they start doing silly things like make a new VM (facebook).

I wonder if there is some survivor bias there. I'm sure there must be cases where everything went wrong but nobody writes about it.

Wouldn't survivor bias explain who BigCo X can be found using whatever questionable choice they originally made, but not explain why lots of BigCos have changed their practices.

This might explain Facebook and PHP, but it doesn't explain the stuff mentioned in the previous comment.

Re: Instagram Makes a Smooth Move to Python 3

#35
post #17
post #14

Earlier quoted context omitted.

And at that scale you can make additional microservices for the critical path where it matters.

Not really. You'll notice a pattern in most tech bigcos where they move from dynamic lang X to a statically typed language that can multithread properly. A few examples: Ruby on rails to java (twitter). Java & c++ (google). Java (linked in). Python/Node -> Java/Go (uber). Or they start doing silly things like make a new VM (facebook).

Don't be obtuse, it's not because of multithreading.

They move to static typed because their team is 100+ developers none of which knows the entire code base - and static typing helps lower the bugs possible.

Re: Instagram Makes a Smooth Move to Python 3

#36
post #17

Earlier quoted context omitted.

Not really. You'll notice a pattern in most tech bigcos where they move from dynamic lang X to a statically typed language that can multithread properly. A few examples: Ruby on rails to java (twitter). Java & c++ (google). Java (linked in). Python/Node -> Java/Go (uber). Or they start doing silly things like make a new VM (facebook).

I heard through the grapevine that Go was only chosen at Uber to help with hiring.

That seems silly. There are far more Java devs out there than Go devs.

Also, I would assume Uber probably has hiring problems in general at this point.

Re: Instagram Makes a Smooth Move to Python 3

#37
post #7

types in python 3.5?! I had no idea -- that's exciting.

Anybody have experience of using this? More info: https://docs.python.org/3/library/typing.html

I've been using TypeScript a lot recently and it has had a big impact on reducing bugs and making refactoring easier so something similar for Python looks great.

Re: Instagram Makes a Smooth Move to Python 3

#38

Earlier quoted context omitted.

I heard through the grapevine that Go was only chosen at Uber to help with hiring.

That seems silly. There are far more Java devs out there than Go devs. Also, I would assume Uber probably has hiring problems in general at this point.

> That seems silly. There are far more Java devs out there than Go devs.

I wouldn't underestimate the level of hype-driven development that exists in this area. "Chasing the new shiny" seems like it could be a line item in a resume, these days, sometimes.

Re: Instagram Makes a Smooth Move to Python 3

#39
post #26

Earlier quoted context omitted.

That's not entirely true. The information from the type annotations is available at runtime. ApiStar takes advantage of this, for example.

The information from annotations is exposed to the runtime, but nothing in the runtime treats them as types or performs any type checking. The feature was introduced as a generic way to annotate functions, without being constrained to a single use case (type checking), and all the tools which actually do type-checking based on annotations are third-party.

C++ also does do any type checking at runtime. Compile time checking is all that really matters.

Re: Instagram Makes a Smooth Move to Python 3

#40
post #7

types in python 3.5?! I had no idea -- that's exciting.

The types do the actually speed up execution but I find them useful in various parts of my codebase when I work on a project (for exaple when defining classes which represent more advanced and complex data types for my specific project). It help staying organized and making sure your not ambiguously passing in wrong data types. Also pycharm uses them to understand custom classes and functions you define and provide suggestions.
Post reply on HN