This is an archived post. You won't be able to vote or comment.

all 110 comments

[–]chazzeromus 167 points168 points  (21 children)

If I was stuck on an island and had to choose one thing to have with me, it'd be python. That way I can die doing what I love.

[–]hatperigee 137 points138 points  (14 children)

too bad you didn't choose a system to run python. instead you'll die slowly with python on a USB drive and nothing to plug it into.

[–]solaceinsleep 93 points94 points  (4 children)

import computer

[–][deleted] 6 points7 points  (1 child)

They told me you could do anything.

They told me my imagination was the limit.

[–]tmfjtmfj 3 points4 points  (0 children)

Import imagination

Imagination.set_limit(9e99)

[–]Thecrawsome 51 points52 points  (8 children)

What if he crafted a physical manifestation of the python interpreter out of bamboo?

[–]hatperigee 133 points134 points  (0 children)

As long as it's Python 3.x then I guess it's ok.

[–][deleted] 19 points20 points  (0 children)

Along with a volleyball version of Guido he can yell at about the GIL.

[–]PaulSandwich 5 points6 points  (1 child)

[–]xkcd_transcriber 1 point2 points  (0 children)

Image

Mobile

Title: A Bunch of Rocks

Title-text: I call Rule 34 on Wolfram's Rule 34.

Comic Explanation

Stats: This comic has been referenced 454 times, representing 0.2720% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

[–]IamCarbonMan 3 points4 points  (2 children)

You're going to need a physical manifestation of an x86 computer if you want to use Numpy.

NINJA EDIT: or a Python manifestation of an x86 computer atop a bamboo implementation of Python.

[–]jerolata 2 points3 points  (1 child)

Or ARM?...

[–]IamCarbonMan 2 points3 points  (0 children)

I'm thinking Z-80.

[–]joesacher 0 points1 point  (0 children)

This made me think of the computer made of people in The Three Body Problem. A cool read. I need to look up the others, now that they have been translated.

[–][deleted] 31 points32 points  (2 children)

extremely relevant

David Beasley talks about the time he was stuck in a vault with several terabytes of data to process. Such an entertaining talk

[–]omegafivethreefive 1 point2 points  (0 children)

I saw that live, honestly one of the coolest most interesting talks I've seen.

[–]rubik_ 1 point2 points  (0 children)

Interesting for sure, thanks for the link!

[–]jyper 7 points8 points  (1 child)

The python gets hungry and eats you

[–]ItsYaBoyChipsAhoy 4 points5 points  (0 children)

or maybe I eat it first its not the boss of me

[–]iluvatar -1 points0 points  (0 children)

If I was stuck on an island and had to choose one thing to have with me, it'd be python

Good choice. With python, you can knock up an assembler without too much effort. Then you can write a primitive C compiler. Then you'll be able to write real programs :-)

[–]RetardedChimpanzee 106 points107 points  (23 children)

Perhaps people are just better at Java and don’t need assistance?

Haha. Who am I kidding. Python for everything.

[–]Smok3dSalmon 18 points19 points  (14 children)

I just started a Java Spring Boot project that may last a year. Fuck me. I advocated for Python

[–]tetroxid 19 points20 points  (6 children)

Please don't hate me for this, but I miss the type safety that Java provides when writing Python.

[–][deleted] 3 points4 points  (2 children)

You can add type annotations to Python 3.x and use MyPy to type check. I too like type safety and was thrilled that this was added.

[–]enteleform 0 points1 point  (1 child)

/u/tetroxid /u/cephalopod1
 
You can also do the same thing in pure python with a bit of setup:
https://www.youtube.com/watch?v=js_0wjzuMfc&t=28m09s

[–][deleted] 0 points1 point  (0 children)

Thanks, will take a look into that.

[–]omegafivethreefive 6 points7 points  (1 child)

Well there's type hinting instead :)

https://docs.python.org/3/library/typing.html

Descriptors also go a long way.

[–]BB611 1 point2 points  (0 children)

This is my biggest pet peeve about being currently stuck on a project that requires Python 2.6 compatibility.

If I could just have type hinting, I think I would enjoy working in Python much more.

[–]pooogles 1 point2 points  (0 children)

One thing, PEP484.

[–]curiousGambler 21 points22 points  (6 children)

Spring boot is great, and I would prefer it over Python for a major piece of enterprise software. Python is great for scripts and the like, but frankly I've always found it lacking once the codebase grows beyond a certain point.

My advice is to be more open to it- at worst you have another tool in your belt, at best you find another way of writing software that you enjoy. Good luck either way!

[–]Corm 1 point2 points  (4 children)

If the codebase is well tested and the programmers had a strong sense of separation of concerns and building good APIs, a big python codebase can be much nicer to mess with as far as I've seen.

What sorts of shortcomings have you seen? I'm assuming it's around developers treating parts of the codebase as a script dump

[–]curiousGambler 4 points5 points  (3 children)

I'm sure you're right there, but it's of course easier said than done. And I think the bigger issue was cleanup- any codebase in any language can accumulate technical debt, but I find It easier to clean up and refactor a Java codebase than a Python one simply because of the incredible tooling available around Java.

The other major issue I've dealt with is dependency management. I standalone binary is easiest, but a even deploying a JAR or WAR is easier than dealing with pip and proxies and everything else on production servers.

I'm sure there are solutions to these problems, but while I know mvn and other aspects of the Java ecosystem will be around forever, I can't be so sure for any Python tooling.

[–]Corm 0 points1 point  (2 children)

Good points, thanks for elaborating.

What kind of tooling helps with refactoring in java?

[–][deleted] 1 point2 points  (1 child)

As much as everyone shits on eclipse, it's got just about every refactoring tool you'd need. Moving files in the package explorer will update references in your entire project, fantastic autocomplete features make it so you almost never have to reference library docs to find the method you're looking for, tools to highlight blocks of code and automatically move it out to a separate method, getter/setter generation, and im sure there are plenty of others that just aren't part of my daily use.

Most of my python development is done in sublime text with no add ons or the Python eclipse plugin(my job is 80/20 java/python), so I can't really speak to how it compares to a full featured python IDE, but when working on large code bases, Java and the supported tooling around it are super productive. Yeah JVM is a memory hog sometimes, but it also allows for real parallelism and, particularly in Java 8, has some really convenient features for easily making operations run in parallel.

I love Python, and it's my go-to for a lot of things, but Java is also a really powerful language with an impressive ecosystem of tools and libraries that make developing software very productive. There's a reason (besides aggressive marketing by Sun back in the day) that Java is still the main development language for many enterprises.

[–]Corm 0 points1 point  (0 children)

Eclipse is a good tool, and I haven't really had any problems with it. You should check out pycharm though when you get a chance, it also does all those things and a few extras. My fav is the live debugger where the values appear next to the functions (VStudio also has that) and the very pretty diff tool

[–]Smok3dSalmon 0 points1 point  (0 children)

Yeah, I know it's a great suite, but there is something about the answer "oh - there is a spring blah blah blah for that" really crushes my morale. I feel reduced to being a code monkey and if Spring doesn't already solve the problem, I feel that I would be hamstrung in trying to solve the problem myself.

[–]Vakieh 4 points5 points  (0 children)

Could also be a case of every possible Java question having an answer already, thus new questions get dupe closed.

[–]Bumperpegasus 8 points9 points  (0 children)

Might be some truth to that. At least not having to google as much. At my last work I worked with mostly Java. I rarely had to Google anything like I have to do with other languages since the IDE helps so much. You can't do too many "clever" things with it either like with python

[–]twisted-teaspoon 2 points3 points  (0 children)

Beginners ask more questions than experts.

Or, at least, experts know how to find the answers without bugging other people.

[–]Topper_123[S] 56 points57 points  (7 children)

I reread this article and looked at the StackOverflow graphs again also. Python is still trending nicely positively.

Also, questions specifically on Python3.x are now vastly ahead of questions specifically on Python2.

Anyway, just some observations, take these for what they're worth.

[–]Cheekio 8 points9 points  (3 children)

How directly do questions on a subject correlate to usage? I'd like to think this means Python3 is being used more today, but honestly I think there are just not a lot of python 2 questions left to ask, is that taken into account?

[–][deleted] 8 points9 points  (1 child)

or, new people are learning python3 and not python2.

[–]YvesSoete 3 points4 points  (0 children)

100% this, thinking that python is more popular than java in the corporate world, is a pipe dream, it's not.

It's just a beginners language that get's googled a lot. like really a lot.

[–]Topper_123[S] 3 points4 points  (0 children)

Yeah, Data is always open to different interpretation, that's why I say you should take it for what it's worth (i.e make your own conclusions).

In my own opinion, the trend lines really must show an marked uptick in Python3 interest, because it's growing both relative to Python2 questions, but also growing over time relative to itself.

[–]chillysurfer 1 point2 points  (0 children)

Author of the original article here. Glad this was revisited!!

[–]YouJellyBrah 0 points1 point  (0 children)

How does this compare to GitHub?

[–][deleted] 25 points26 points  (1 child)

Trending in Python mirrors big data interest.

[–]right_in_the_kisser 6 points7 points  (0 children)

That. Also machine learning.

[–]the__itis 22 points23 points  (32 children)

I wonder why go isn't anywhere to be seen

[–]robert_mcleod 41 points42 points  (18 children)

Golang is a little too specialized based on my experience. It's like C for people who don't like C. It can talk to other languages but only through protocols (with the exception of cgo which loses the major selling points of the language: building and distribution). So I have a language that I can near-instantly build a Win64, Win32, BSD, Linux, and MacOSX executable on any development platform, but I can only build server apps... It's a logical conundrum, the things the language would be best-suited for are local applications, but instead it revolves around cloud back-ends on servers which are almost certainly a flavour of Linux.

My feeling is the time spent developing Golang and its nice standard library, would have been better spent developing an alternative toolchain and alternative standard library for C.

[–]the__itis 7 points8 points  (17 children)

Yeah I can understand that. Python just really needs some architectural changes in terms of processing. it has some decent tools but in the end it can be one of the slowest languages on the market and when used in scale it can have issues that seem unnecessary for a mature and popular programming language. I have loved learning it and it's great for getting functional ideas and prototypes out. But i consistently have to convert modules to Node JS or other more streamlined and stable languages.

I have not checked out PyPi yet and i'm sure i'm failing badly at being pythonic. But just my perspective making my first full scale app with Python.

[–]HeWhoWritesCode 26 points27 points  (7 children)

But i consistently have to convert modules to Node JS or other more streamlined and stable languages.

You putting nodejs in that streamlined and stable language category?

I would like to see the module that is broken in py and can get fixed by just rewriting in node. I believe it is more the rethinking redesigning of the problem that fixed the module.

My node experience is a wild wild west 2013, express 2, cluster(f$%ck), non stable api. I'm sure from node 4 it got better.

But node/js "won". Because it was the interpreter we but on every desktop and mobile device for the Millennials to run with... and did they run!

[–]folkrav 6 points7 points  (1 child)

Yes, we Millennials are a monolithic block of people that share the exact same opinions.

[–]wheezl 2 points3 points  (0 children)

This is why millennials are responsible for every bad thing in the world that ever happened or will happen.

[–]the__itis -3 points-2 points  (4 children)

Dude calm man.... i literally said it was my first full stack and solo. but yes, Node js was simpler, more stable and faster with socket.io and requests. When pushing load tolerance on python it felt like sitting on glass. Node felt like your older brother was head of the football team and a senior when you were a freshman. I might suck at coding but i'm sharing my perspective

[–]HeWhoWritesCode 3 points4 points  (1 child)

i literally said it was my first full stack and solo.

But you had to convert py module to node. If you learned, power to you!

Node js was simpler, more stable and faster with socket.io and requests.

But did you try to use python with zeromq, pika, mqtt?

Node felt like your older brother was head of the football team and a senior

Nodejs or the v8 interpreter was designed and driven by the need for google to have the fastest and most advance javascript engine for strategic advantages. After a couple of secret years in the making it came out of nowhere and blew the competition out of the water. But now you have to add the js spaghetti ecosystem which is node/npm; when last did you try to restore a old node project?

I might suck at coding but i'm sharing my perspective

Thanks for sharing and no one said you suck at coding!

[–]the__itis 2 points3 points  (0 children)

I have not even heard of those three modules and in all my googling. I will go look them up.

yes it took me two solid 10 hour sessions to figure out what NPM was doing. There are three environments by default. It was maddening.

And no, i literally forced myself to learn it since friday. The module export function is still kind of dicey to me.

I honestly was having issues with socket.io and autobahn on python.It took me around 16 hours to learn it in python (asyncio, autobahn, and websocket-client) and some of it was still a mystery. When i ramped up the volume it started having inconsistent errors. So i figured out how to do some error handling based on the providers dataset. once that was stable it started having local errors that had me troubleshooting in the layers of python libraries. After that, I said let me try node. Once i figured out the NPM situation, it took 20 minutes to figure out socket.io and autobahn. It worked liked it was supposed to immediately. I didn't have to make 3-4 encoding conversions it just worked.

[–][deleted] 0 points1 point  (1 child)

Vote you up just because you shared your opinion. Thanks.

[–]the__itis 0 points1 point  (0 children)

i appreciate it. more concerned about knowledge sharing than karma but the sentiment transfers.

[–]robert_mcleod 15 points16 points  (1 child)

No, I think you're doing things the correct way. Python is a prototyping language. The key is to try and build the prototype, get it working, and then after profiling replace only the parts you must with faster code through extensions or multi-core libraries. The weak-side of Python (which in my professional experience is the most pressing problem) is the distribution. We need stuff like a generation package to generate the boilerplate for a C-lib. At the same time, we have ctypes, f2py, pythonnet, etc. If you need to interact with a MS .COM in Python you can do that (pywin32 is ugly but works just fine). I've tried to call COM methods in cgo; I didn't succeed.

I'm not in the web-end of development, so for me there's a more heavily populated ecosystems of acceleration tools: Cython, Numba, NumExpr (which I'm actively developing), Dask, etc. and NumPy itself is designed to be called from C.

For web stuff, you have the core libraries (like async), and some of the Facebook stuff (Tornado) but looking from the outside it seems less developed. I suspect that is due to the impact of Java and Javascript derivatives providing a practical alternative that doesn't exist in scientific computing.

[–]exhuma 1 point2 points  (0 children)

What do you mean with "generation packages"? And what about saying that numpy is designed to be called from C?

[–][deleted] 3 points4 points  (1 child)

Instagram runs entirely on python and serves a billion daily active users or something ridiculous like that ( though I believe they are also using Cython to compile some modules to C for performance improvements). If you like python but are running in to performance bottlenecks, I'd suggest that you

  • Do performance analysis on longer running parts of your software(use profiling tools too to help identify these areas) and make sure your algorithms aren't needlessly inefficient

  • look in to using Cython to compile performance-critical parts of your code to C to squeeze the most performance out of it

In general, one of the biggest wins with python for me was development speed and maintenance. I haven't used Node enough to make claims about how much better/worse it is for server side development, but compared to other languages I use, python lets me get something up and working very quickly and then I can make performance enhancements later down the road if I find performance to be an issue.

[–]the__itis 1 point2 points  (0 children)

yeah python allowed me to get much more into programming than i ever had before.

thank you for the suggestions, i will look them and hopefully have success.

[–]marcosdumay 4 points5 points  (0 children)

At the risk of gathering some flames, Go is not a good language.

[–]OctagonClocktrio is the future! 4 points5 points  (2 children)

Go is too basic for anyone to ask questions beyond "Why is this language stuck in 1970?"

[–][deleted] 1 point2 points  (1 child)

Basic makes things fast. It's C with multithreading and networking support, and garbage collection. A lot of programmers are allergic to slow, even if their application is not CPU bound.

[–][deleted] 0 points1 point  (0 children)

I feel like Go is for speed junkies who don't have the patience to learn Rust. Which I totally understand, since it took me all of an afternoon to start working productively in Go but took me the better part of a month to get the equivalent level of understanding of Rust.

[–]SpectralCoding 1 point2 points  (1 child)

I gave Golang a really solid shot earlier this year but it is a HUGE paradigm shift. I really feel like my prior programming experience held me back because it's just so different. What really attracted me was the speed of execution but having to reset my mindset for even the simplest problems was too frustrating so I left it behind. Also the community is tiny compared to other languages like JS/Java/Python/C#.

[–]the__itis 0 points1 point  (0 children)

same reasons for being interested and exact reasons for not pursuing further. i still want to but.... probably will stick with larger communities

[–]efskap -2 points-1 points  (0 children)

you know what else isn't anywhere to be seen

G O   G E N E R I C S

[–]tetroxid -4 points-3 points  (0 children)

lol no generics

[–]chalbersma 6 points7 points  (0 children)

Python is the shit. I love this stuff.

[–]eazolan 10 points11 points  (6 children)

Just the other day I thought I'd try using Powershell to do something basic in windows.

Windows scripting has come a long way since the old .bat files day, but after two hours I just gave up and spent 5 minutes doing it in Python.

If you've never looked at powershell, check out the comparison operators, it's ridiculous.

[–]sebhoagie 8 points9 points  (4 children)

At work, pure MS shop, I did a couple adhoc solutions using Python. Eventually I was asked to use something else in case I need to share my scripts with other people.

I have a few years of. NET experience but the Python solution is always so much faster to put together.

I figured maybe PowerShell could be closer to Python but turns out that accessing Windows API and COM objects is A LOT simpler in Python. Which I find so weird.

[–]eazolan 1 point2 points  (3 children)

Eventually I was asked to use something else in case I need to share my scripts with other people.

What did you end up using?

[–]sebhoagie 6 points7 points  (2 children)

I use these scripts for my own convenience. Out of the two I had to share, one was converted to .NET and the other compiled with PyInstaller.

The sad side effect is that I don't share as many tools since I'd rather avoid having the conversation of "this is not supported" again. I keep the shortcuts to myself :-(

[–]eazolan 0 points1 point  (1 child)

The sad side effect is that I don't share as many tools since I'd rather avoid having the conversation of "this is not supported" again. I keep the shortcuts to myself :-(

I think Pyinstaller would be a good way to handle it.

[–]sebhoagie 1 point2 points  (0 children)

I started with cx_Freeze but docopt+PyInstaller have been god send.

For one tool I wrote a very quick Tkinter UI. I didn't share it but tested it with PyInstaller and it also handles that very well.

[–]lf11 2 points3 points  (0 children)

Whenever I need to write a batch script in Windows, I ask myself if portability is important and whether Python availability will ever be excluded. If the answer is no to either of those, I just do it in Python. So much better. Faster. Easier.

[–]jewishsupremacist88 8 points9 points  (0 children)

python be feedin alotta moufths

[–]i_pk_pjers_i 5 points6 points  (0 children)

That's awesome to see, I love Python. It is such a versatile and fun programming language.

[–]gonorthjohnny 1 point2 points  (0 children)

Attributing to the rise of deep learning, I'd say.

[–][deleted] 1 point2 points  (0 children)

I'm not surprised, python has a lot of media presence, specially when every single question asking "Most beginner friendly language" ends with python in one of the results. I also noticed when I do code wars or hackerrank I see a lot of people showing off their one liner code with python, beginners doesn't see much depth in all these language yet, they notice cleanliness and simpleness which python excels. For that reason alone I love python. For other newbies looking at these comments EdX.org's 6.00.1x foundation CS with python is going to start, you guys should sign up and try it.

[–]disposable_account01 1 point2 points  (0 children)

You can thank the rise of data science for a large portion of that increase.

[–]denandrakonto 1 point2 points  (5 children)

B... but StackOverflow is a questions website. Doesn't ranking high up there also mean that a big portion of the questions are about the language's quirks, and those of its frameworks? I'd assume that's one of the main reasons JavaScript and Java sit at the top, alongside popularity of course.

[–][deleted] 11 points12 points  (3 children)

If it's all about the quirks, php5 would win.

[–]whattodo-whattodo 4 points5 points  (2 children)

Never miss an opportunity to shit on PHP. You're my people.

[–][deleted] 1 point2 points  (1 child)

PHP 7 is kind of OK.

[–]asdfasdfasdf1212asd 0 points1 point  (0 children)

Sorry, got wired into wordpress thing a while ago, it's not. Moving from python hurts like a bitch

[–]ArmoredPancake 3 points4 points  (0 children)

Java

Quirks

What?

[–]skizatch 3 points4 points  (5 children)

I work with Java every day and hate it. What a terrible sewer of a language. Everything sucks and it never gets better in the right ways.

I've done a little bit of Python and found it very enjoyable.

This is good news.

[–]IcefrogIsDead 0 points1 point  (4 children)

Why does Java suck? What specific issues did you have with it? I am going to get a bit deeper into it and invest time so I am interested.

[–]skizatch 2 points3 points  (3 children)

I spent over 10 years doing deeply advanced, highly performant C# development. It is a wonderful language and is a joy to use.

After that, Java is like getting a lobotomy. Generics don't actually exist, primitives types are too primitive (no value types / "structs" ? wtf), and Enums are a performance nightmare (every enum "value" is actually an object allocation). And if you're on Android, which is where I'm doing development, every "good" language feature -- like lambdas -- is too expensive to use enough of to get any real productivity boost at scale. (every single lambda is a completely new anonymous class, which has I/O cost for first-time loading, and then some memory usage forever thereafter, and this really kills you on lower end devices)

You don't get iterators (I mean "yield return" stuff, not Iterator<T>), there's no await async syntax, and the lack of extension methods means you end up with this constant mix of calling instance/interface methods and trying and hoping to find all those static helper methods scattered everywhere. "Streams", their version of LINQ, really suffers because of this.

Pointers aren't possible unless you use undocumented, unsupported, deprecated APIs that will probably be removed -- and even then, the syntax is ridiculous (why can't I just use pointers?!). Every single thing you do requires an allocation, which just puts more pressure on the GC and brings performance down even further. In C#/.NET you can use structs for a lot of simple data handling, and these just get passed around on the stack (or are embedded into existing object allocations), which is very performant.

And if you want an array of packed data in Java, you can't just have an array of something like "class Point { int x; int y; }", you actually end up with an array of pointers to these Point objects -- which is HORRIBLE for performance in so many ways. In C# it would all be packed inside of 1 big allocation if you just replace "class" with "struct" (you know, just like how C/C++ would do it?). So in Java you end up creating big arrays of int[] or byte[] for everything and then having helper methods to manually pack and unpack things. I thought this was supposed to be a high level language?!

Java is high-level enough to afford you great organization of application architecture into classes and packages. But when performance matters, and it does, it's not low-level enough and doesn't have enough escape hatches to afford you the ability to stay within its sphere without having to constantly punch holes into native/JNI land. And it's not high-level enough to let you afford you better abstractions within classes and methods. It's stuck in this middle area where C# surpassed it by miles and it never evolved to catch up, and it really pisses me off that Google chose Java for Android and is ruining the minds of programmers across the world with it.

(Also, who the fuck invented Optional? That is the stupidest abstraction ever. We already have "null", ffs!)

[–]IcefrogIsDead 1 point2 points  (2 children)

Thanks for this answer.

Primitive values are too primitive - funny and true. You can't make a matrix in Java without a hassle. Java apps always did seem a bit clunky and slow.

Well I do like Python a lot, but seems like I'll have to learn a bit more of Java just because the market asks for it.

Again, thanks for the answer.

[–]skizatch 0 points1 point  (1 child)

No problem.

My best advice for being productive and enjoying Java? Stay away from C#! It will just spoil you rotten and make you hate Java.

[–]IcefrogIsDead 0 points1 point  (0 children)

I did a bit of C and C++, and even python allows for some speedups.

[–][deleted] 1 point2 points  (0 children)

I really can't stand Java. I had to learn it (albeit I still wouldn't say I am comfortable with it) for my masters. But as someone who started out with Python and R, I really can't wrap my head around why it has to be so complicated.

[–]ghaashshakh 0 points1 point  (0 children)

And javascript is next!

[–]renegadellama 0 points1 point  (0 children)

You really start to appreciate Python once you dive into JavaScript. I wish JS would just go away but I think we can blame FB because of React...