8 ms·
Python Is Eating the World
- netfl0 7y agoI remember betting hard on python in 2008. I was all in. I watched as the ML space embraced it as the lingua franca. It was exciting. Best decision of my career :)
- Waterluvian 7y agoWhat does that mean?
- netfl0 7y agoIt means focusing on learning the toolchains and ecosystem in my free time so that I was really productive with the technology.
- analog31 7y agoI'm a R&D scientist in private industry, and so I don't write commercial software, but have used programming as a tool throughout my career. For me, betting on Python meant migrating almost all of my technical work to Python based tools. Oddly enough it started at home. I was a long time Visual Basic programmer, but I decided to try Linux on my home computer, and needed a way to write simple programs. Going a step further, I decided that I wanted my tools to be open source and platform independent. After evaluating a few tools, I settled on Python and started playing with it. I tried out things like Maxima and Octave as well. A few months later, a big crisis landed in my lap at work, and I decided to use Python to develop the solution. I was amazed by how productive it seemed to be, and I decided to sweep more projects towards the event horizon of Python. I've also climbed aboard the "reproducible science" movement. Though I don't publish my work, reproducibility is just as much of a problem within a closed setting. Jupyter notebooks have made it much easier for me to dredge up an old project and figure out what I did, months or even years later.
- quickthrower2 7y agoWhat do you mean "betting hard"? It kind of implies that if you didn't get into python in 2008 you missed the boat. But in reality anyone who can code another programming language can pick up python if they want to do it for career reasons (or any other reason).
- timothycrosley 7y agoSimilar to parent I bet hard on Python in 2008. That means I've been writing Python for over 10 years. Sure, any programmer can pick up a new language, but I'm able to build (what I believe) are useful projects and release them in Python every single week, outside of my full time job, community involvement and family: https://timothycrosley.com/ https://timothycrosley.com/. That level of productivity only comes from long term investment in a language IMHO.
- chrisweekly 7y agoNice choice. Also, great blog; your `whoami.md` is quite a read. Thank you for sharing! Keep it up!
- elamje 7y agoI concur! https://timothycrosley.com/whoami https://timothycrosley.com/whoami
- crtlaltdel 7y agoi first used python in ~2001-2002 and used it for many things, including a bunch of cgi-bin scripts for a very early VOIP startup. i did not consider myself to be a "dev" back then as i was mostly doing EE work and what little programming i did was split between limited firmware development and "scripting". python was an appealing way to script things out quickly. i didnt have much use for the OO, if anything finding it a layer of unneeded complexity. i would agree that there is an amazing amount of productivity to be gained by reaching for mastery over a language. that said, the efficacy of that mastery is determined by how "useful" the language is in a wider context. this is, for better or worse, highly influenced by "popularity" when it comes to programming languages. Mastering something like brainfuck? ymmv ;)
- mlthoughts2018 7y agoI invested time in a similar way with Python and it has definitely been the most lucrative skill investment for me so far. I can think of a few specific projects in my early career where I wrote things in Python while other teams in my company were trying to write similar things in C++. The Python implementations (which used Cython for a few tiny performance critical sections) ended up running much, much faster than the C++ projects (which were written by very veteran C++ engineers at the time). More than that, they were easier to test, easier to modify, and easier to teach to random new programmers joining the team. We benefited from much more user-friendly third party tools and specialized domain tools and could easily wrap any of the in-house & domain tools only accessible in C/C++.
- saagarjha 7y ago> The Python implementations (which used Cython for a few tiny performance critical sections) ended up running much, much faster than the C++ projects (which were written by very veteran C++ engineers at the time). More than that, they were easier to test, easier to modify I’m honestly really surprised. Can you provide some more detail as to how Python was beneficial for these?
- mlthoughts2018 7y agoIt allowed me to write Cython for only small pieces of programs for which there is profiling evidence of a performance bottleneck. Cython is a slight superset of Python that compiles to heavily optimized C or C++. So it is extremely easy to write & autogenerate Python bindings to your own C extension modules. The difference is that it frees you to write Python (much easier to write & maintain) for everything, and only care about compiling down for speed in a few isolated places. Contrasted with writing everything in C/C++, this is a big advantage.
- rectangletangle 7y ago>much faster than C++ I've been writing Python for over a decade and I find this a bit surprising (not saying you're wrong). Python's strong suit was always speed of productivity over runtime speed IMO.
- eweise 7y agoI bet hard on java in 1998. Still winning... or am I?
- manishsharan 7y agodepends on what you call winning. Java will continue be to be used for boring enterprise applications, which are basically glorified CRUDs with pretty HTML GUI. Meanwhile, interesting stuff is being done on Python, Julia and R and Rust , if you also include system programming.
- kamaal 7y agoJava is still where the excitement is. Also a few people would use Python for serious production facing applications. Python didn't even reach the fame Perl had in the 80s to mid 2000s. Python is for beginner programmers, who absolutely don't want to learn anything new at all.
- shabda 7y ago> Python is for beginner programmers, who absolutely don't want to learn anything new at all. Python is used by the largest companies as well as the smallest one person company who need to get shit done. You can continue liking Java, without becoming bitter about Python.
- deleted 7y ago[deleted]
- smt88 7y agoRust is an interesting language with a fantastic community, but it was created to (and mostly does) very "boring" things.
- cltsang 7y agoThat depends. If you bet on JSP, good luck. If you've shift to data or infrastructure, you're in good shape. There are lots of Apache projects[0] that are innovative and relevant today. [0] https://projects.apache.org/projects.html?language#Java https://projects.apache.org/projects.html?language#Java
- RickJWagner 7y agoGood call. I was already firmly invested in Java, another good choice. Another common choice was Ruby, probably not so good.
- eropple 7y agoRuby is absolutely fine, even today. I've moved away from it and towards TypeScript and Kotlin mostly because I was always a static typing sort of person (most of my open source Ruby projects, like my OpenAPI 3 Rack framework[0], heavily used dry-types to give me some semblance of safety) but Rails 6 is really good if you're of a brain to enjoy Rails and the language itself is hard to criticize, IMO, when put up against JS (outside of TypeScript) or Python. [0] - https://github.com/modern-project/modern-ruby https://github.com/modern-project/modern-ruby
- smacktoward 7y agoI remember betting hard on Python in the webdev space in 2003-2004. It was not the best decision of my career :-/
- js2 7y agoHuge discussion last month: https://news.ycombinator.com/item?id=20672051 https://news.ycombinator.com/item?id=20672051
- crtlaltdel 7y agoo? thx for the context!
- _bxg1 7y agoWhat's the static-typing landscape look like for Python? JavaScript, the other dynamic language that's eating the world, has the well-known TypeScript to help it scale. I couldn't imagine maintaining any large codebase without a good type system.
- netfl0 7y agoPython’s new type hinting seems to solve most problems pragmatically, are there issues you have with it?
- sabujp 7y agopytype is nasty when you're trying to set a return type for a function that was previously returning different types (e.g. let's say different protos).
- ShinTakuya 7y agoHow so? You could use the Union type temporarily if needed.
- BerislavLopac 7y agoMy main problem with it is that it can add a lot of extra syntax which -- while immensely useful for static checking -- is never executed in production. PEP 484 includes support for stub .pyi files, which contain the typing, but IDEs still don't take advantage of that.
- Varriount 7y agoPython has type annotations[0] and tools such as mypy[1], which enable fairly decent optional static typing. [0] https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html [1] http://mypy-lang.org/ http://mypy-lang.org/
- _bxg1 7y agoIt's cool that there's an official spec; JS doesn't have that even though the syntax for typescript and flow is nearly identical.
- buboard 7y agoIt's not really "Eating" it the way that javascript was eating into the server space. Python is a de facto fallback language, and is being used wherever there isn't a better domain language, because it s well known. i dont think developers with superior DSLs switched to python. it's like a broken clock that s right many times a day. Even their graph shows that it's not really cutting into any other major language
- Iv 7y agoGood.
- tus88 7y agoDo people who complain that Python doesn't have typing are effectively arguing against the very existence of every scripting language and Lisp in the world?
- silentsea90 7y agoScripting languages are for writing scripts. Production code is much better served by typed languages. Use a Ferrari on a racetrack, use a fortified tank on the battlefield.
- deleted 7y ago[deleted]
- bArray 7y agoI'd go one step further, I would accept the existence of both typed and non-typed "runtime" versions of Python (i.e. a run-time flag or program argument). Writing a quick script? Reach for the non-typed version. Writing production software? We ought to make sure we're type checking. Default to non-typed to stop beginners breaking their code. The same with something like JIT vs compiling, I don't want to find out that some edge case a quadrillion loops in has some simple error a compiler could have found.
- L0stLink 7y agomypy can be used to achieve the same effect, but I would also like the ability to enforce types at run-time, and it would be great if more tools made use of PEP 484.
- bluejekyll 7y agoI’m not sure what your analogy is getting at. Many typed languages are compiled. A lot of them are faster than interpreted languages—also, because they are typed, they could be referred to as fortified.
- saghm 7y ago
- ggregoire 7y agoSeems more like it's eating the ML world. 80% of the new questions on StackOverflow tagged Python are about pytorch, tensorflow, anaconda or pandas.
- WilliamEdward 7y agoI noticed this trend too. Python has immortalised itself in ML because it's extremely important to be easy and clear if you want to write already complicated data science, and it has the data structures that other languages just can't compete with. Plus it's very close to pseudocode, and a lot of ML is spoken in algorithms.
- nikofeyn 7y ago> it has the data structures that other languages just can't compete with mind elaborating?
- WilliamEdward 7y agoList comprehensions, dictionaries, as well as libraries such as pandas and numpy with their linear algebra data structures are some of python's strong points, i think.
- harry8 7y agoThat has as much to do with SO style and nature. Raw python questions already have answers so if you ask one you're downvoted to oblivion. Pytorch, tensorflow et al are new-ish enough there are novel questions to ask and answer. If there's a new hotness in python web frameworks (or whatever) that suddenly everyone wants to use, questions about that will top the list of new questions.
- nikofeyn 7y agoi feel like python is just the next c++. everyone rides the hype train and thinks it’s gravy until 10 years later everyone realizes it’s full of mistakes and yields unwieldy codebases readily. i have never developed python code and said “this is fun” like i do with scheme and ml dialects.
- smt88 7y agoPython is 28-ish years old. We've had plenty of time to realize its mistakes. The current source of Python growth is its excellent ecosystem, which wouldn't exist if the mistakes were that terrible. We are clearly not in some kind of a Python hype bubble that will burst -- not that C++ ever was either, honestly. (This is coming from someone who loathes Python, btw.)
- bsder 7y ago> everyone rides the hype train and thinks it’s gravy until 10 years later everyone realizes it’s full of mistakes and yields unwieldy codebases readily. Python isn't just "well, it's the only thing there" like C++ was. Python already had a well-established and well-liked competitor that it had to displace--Perl. It is extremely hard to communicate the juggernaut that was Perl/CPAN back about 1996. So, Python has already demonstrated that it has better survival traits than most of its predecessors (Tcl, Perl, etc.). The current popularity of so many of the languages developed in the 1990's shows that they really did do something significantly better than the languages that came before them. "It's the developers, stupid"
- xuesj 7y agoI like python.Python makes programming easy and efficient.python program is easy to read.
- _jal 7y agoMy personal theory of "why python" is that it broke with the unixism of recycling syntactical conventions. While the conventions were useful, the line-noise aspects that were perpetuated turned a lot of people off as unnecessary obfuscation. Python was more than a clean break from that, it was pushing towards actually trying to enforce a certain amount of readability. I default to python for scripting at work because it is popular - we are more likely to find folks who have at least seen it before. Most of my throwaway and experimental code is Perl5, just out of long habit.
- rectangletangle 7y agoThe clean minimal syntax has always been my favorite part of Python. I'm really really glad that Python 3 didn't go the way of Perl 6, It was very close there for a while. Also the ellipsis literal `...`, never need to use `pass`.
- m463 7y agoI think you're right. It "downgraded" regular expressions, which are entrenched as first-order citizens in most of unix, and made you use function calls instead. Although it would seem to make regular expressions clumsier to use, it made it easier to encode and decode them. One of the most frustrating and painful things is trying to figure out if something in a regular expression is a literal character, a matching character or an escape character, and it can be deeper, such as a variable or other syntax character from the enclosing language. This kind of stuff trips up beginners and seasoned folks alike. Python did the same thing with path manipulation, which suffered from the same sorts of problems.
- segmondy 7y agotons of things are eating the world. it depends on your world. c/c++ are out there, crushing it. so is python and javascript and java and go and c# and so on and so forth.
- leoc 7y agoPython, the World's Okayest Language.
- kumarvvr 7y agoIt's not okayest. It's a great language. I cant really pin it down, but when I am programming in Python, the language flows along with my thoughts. During intensive programming sessions, I never really feel the difference between my thoughts and the language flow. I hope I make sense. Often, I start solving a problem, solve a core part, then have to tack on additional conditions or workflows and I can just think about them and build them in python. I have never had that happen in other languages and I have used C#, JS, C, C++, Java, Scala & VB.
- stjohnswarts 7y agoPrepare for people to tell you that you're not a real programmer because you aren't using their language of choice. I've fallen in love with Rust lately, but I'm not going to beat you up because you like Python
- bsder 7y ago> I cant really pin it down, but when I am programming in Python, the language flows along with my thoughts. Python has a much simpler grammar than most programming languages.
- banachtarski 7y agoIMO, the tab-sensitive syntax is one of the worst aspects of the language.
- deleted 7y ago[deleted]
- m463 7y agoyou regain quite a bit of screen space by eliminating other forms of syntax sugar such as braces and semicolons Also, I use spaces, never tabs! https://duckduckgo.com/?q=jwz+tabs+spaces https://duckduckgo.com/?q=jwz+tabs+spaces
- foobarbecue 7y agoTechrepublic is republishing last month's Zdnet article? https://news.ycombinator.com/item?id=20672051 https://news.ycombinator.com/item?id=20672051
- lostgame 7y agoAs someone who has never used Python, has never had the need to, and doesn't know the first thing about it - can someone quickly sell it to me? And also, perhaps, recommend something for pure beginners to the language? I know C/C++/C#/Obj-C, Java, Swift, JS, PHP, et al, to give some context.
- silentsea90 7y agoPython is a language that feels natural and easy to read/write, and helps you get sh*t done quickly especially for scripty/ml use cases.
- Avamander 7y agoAlso helps you get s*it done in small service cases, e.g. you need a small HTTP API that returns you some database value, very easy to make compared to majority of other languages.
- mianos 7y agoJust learn it doing a tutorial and you will smile. That is what did it for me many years ago and still does.
- Rotareti 7y agoYou can write Python like pseudo-code. Sometimes the results look almost like plain English. For example, if I have to design software for a micro-controller that uses C/C++ I sometimes write down the algorithm in Python (with editor support: auto-formatting, etc.), then I implement it in C/C++. There is no better way to write pseudo-code that I know of. Python is also great to create a prove of concept for something. It allows for rapid prototyping due to the simple syntax, the high-level features, the huge ecosystem and the dynamic type system. Most of the time the result is good enough for production. You can add type annotations and get statically typing via mypy [0] to harden the code base. This works really well. (See: JS->TypeScript). Python has a well developed FFI which allows you to call C/C++/Rust, without large performance hits. I think this is one of the main reasons for Python's success. It can be used as a high level interface to a huge low level ecosystem. ML wouldn't exist in Python without that. Python is a great language to create simple scripts as well. I use it as a bash replacement. But beware: Python can get really ugly if you rely too heavily on OOP/Inheritance. There is a lot of ugly Python code out there. I think Python shines the most if you use it in a procedural/semi-functional style and describe data-types for your business logic (almost) entirely with (dump) dataclasses [1] and namedtuples [2]. Beware2: Python's packaging story (package manager, etc) is currently in a messy state. There are good solutions, but it's difficult to find the right tools for a newcomer. I think it will take a couple of years for the dust to clear, but you might want to check out pipenv [7] or poetry [8] These packages will make your life a lot easier. I use them for every project: - black [3] or yapf [4] (auto-formatter) - mypy [0] (statically typing with editor support for VSCode) - pylint [5] or flake8 [6] (linter) [0] https://github.com/python/mypy https://github.com/python/mypy [1] https://docs.python.org/3/library/dataclasses.html#module-dataclasses https://docs.python.org/3/library/dataclasses.html#module-da... [2] https://docs.python.org/3/library/typing.html#typing.NamedTuple https://docs.python.org/3/library/typing.html#typing.NamedTu... [3] https://github.com/psf/black https://github.com/psf/black [4] https://github.com/google/yapf https://github.com/google/yapf [5] https://github.com/PyCQA/pylint/ https://github.com/PyCQA/pylint/ [6] https://github.com/PyCQA/flake8 https://github.com/PyCQA/flake8 [7] https://github.com/pypa/pipenv https://github.com/pypa/pipenv [8] https://github.com/sdispater/poetry https://github.com/sdispater/poetry
- breakerbox 7y agoI love HN so much for threads like this. It is seriously one of the best places in the world to grab some popcorn, hangout, and watch beginners, students, CEO’s, experts, consultants, etc rant and rave about company X or programming language Y. Genuinely love the spirit of HN, even if people say it’s different for the worse now. I assume there aren’t many places on the internet for nerds to publicly hang out with experts and executives in their field. On another note, many of these arguments talk about typing. Why say a language must be static or dynamic, etc, when you can achieve both. Making a C# MVP is much more verbose than python. Maintaining an untyped 3 million LOC monolith, is likely harder than C#. Everyone here is working on pretty different projects and codebases, so why argue for one? Anyone have gripes about mypy, or experience successfully using it(or an alternative)?
- m463 7y agoOne of the biggest reasons I detest stack overflow. I would see really interesting questions shut down with: "this question will likely solicit opinion, debate, arguments, polling, or extended discussion." I wondered why they couldn't be inclusive and possibly just move the questions elsewhere but let them live.
- Avamander 7y agoIt's basically the culture on SO to take what were meant as guidelines as rules. Trying to question why should the rules forbid x or y will often end up on tautological "because it's the rule", I've seen it multiple times.
- tarsinge 7y agoI don’t know why, but my brain refuse to work natively with Python. I wrote countless projects in more than 10 years of professional experience, from small scripts to advanced ML, libraries are fantastic, and I still fight the language. In comparison with Ruby, even after years I can write complex expressions and get standard library names just by guessing and be right. In Python it’s like my brain is wired at the opposite of every convention. Even JavaScript feels more natural. I have 0 joy programming in Python even if I get the job done, whereas in Ruby (or other languages) I’m instantly in the zone. I know it’s purely a taste issue but I’m sad Python “won”.
- out_of_protocol 7y agoSame here. And i even started with Python first. Something fundamentally different here, "brain is wired at the opposite of every convention" is on spot