r/Python • u/hopemeetme • Nov 07 '19
Python passed Java as the second-most popular language on GitHub by repository contributors
https://github.blog/2019-11-06-the-state-of-the-octoverse-2019/228
u/__init__RedditUser Nov 07 '19
As someone who never wants to have to seriously learn Java, this is great news
44
u/polaroid_kidd Nov 07 '19
Don't let me reason on your parade, but it didn't really matter if it's in first or fifth place. What I'm trying to say is that you can learn any of the top five languages and land a job (with the bobs and bits that go with being a software developer/engineer)
Personally, I just tried it again after a brief stint in Kotlin and I've come to realise that I really miss the static typing, but then again, I come from Java so I might be a teeency bit biased ^
19
Nov 08 '19
I come from python and I prefer static typing.
1
u/bennyman32 Nov 08 '19
But you can use typing in Python don't you?
11
u/r0npi Nov 08 '19
You can use type hints, but it is far from being the same as static type languages. Python typing doesn't enforce the types, they are just hints, one can still use a different type than the hint
5
u/JohnMcPineapple Nov 08 '19 edited Oct 08 '24
...
7
Nov 08 '19
Unless you can convince your team to use it too, it just doesn't matter. It's not a core feature of the language, so it has barely any buy-in anywhere. Contrast to any static type language where you can't not write without static typing.
61
u/BigASchw Nov 07 '19
I taught myself primarily in Python but I'm at my first dev job and we use Java. You never want to learn Java, it's the worst
43
u/FishBoyBagel Nov 07 '19
Just curious, why would you never want to learn Java? I’m a freshman in college studying Python this semester and Java next semester.
69
Nov 07 '19
Java is absurdly verbose compared to python. Granted, it’s faster, but its much slower to write.
28
u/QualitySoftwareGuy Nov 08 '19
Java is absurdly verbose compared to python. Granted, it’s faster, but its much slower to write.
It is, but some might also say it's easier to maintain medium-large sized applications in Java. I love Python, but best tool for the job is my motto.
8
Nov 08 '19
Depends on how the project was structured imo, but yes compiled languages are more strict so there are less “what the fuck was the author thinking” moments in maintenance
17
Nov 08 '19
The problem with java isn't that it is statically typed, it's that it requires absurd amount of boilerplate to do literally anything. And it's OOP model is not good.
0
Nov 08 '19
[deleted]
4
u/Vaphell Nov 08 '19
let's not get ahead of ourselves with "strong types". Strong-ish, maybe. I certainly love losing type information while using generics, courtesy of type erasure ;-)
Checked exceptions? Lol.
3
Nov 08 '19
Java is pretty fast to write honestly. Long variables names are almost all auto completed. And compared to python I think java is faster to write in some instances, because it requires less testing and checks due to the compiler. Typed python helps a lot there though.
8
u/BigASchw Nov 07 '19
Exactly this, just printing hello world in each language is the perfect example as to why python is so much easier and more enjoyable to write in
44
u/AcousticDan Nov 07 '19 edited Nov 07 '19
I wouldn't judge a language on how printing "hello world" works.
-1
u/matholio Nov 08 '19
It's just a commonly understood indicator, not a final judgement.
11
Nov 08 '19
I found printing to be easier in some assembly languages than in C. Doesn't mean I'd touch any of those with a meter-long keyboard tho.
2
u/Rpgwaiter Nov 08 '19
What's your beef with C? I get not wanting to mess with ASM but man sometimes you just get the urge to mess with some memory directly.
2
Nov 08 '19
I'm just making a point that even if a simple hello world is easier to write in some language doesn't mean that the language is better at all. I'm not saying that C or ASMs are bad in any way.
8
u/tristan957 Nov 08 '19
It really isn't commonly understood though. Printing hello world is not a valid use case for a language. For some reason only Python enthusiasts think it is because they can do it in one line. Tell me how good the async support in Python is.
3
u/pblokhout Nov 08 '19
I've read multiple complaints about a lacking async support. What do you guys mean? I've used asyncio, multithreading, multiprocessing. I'm not sure what is wrong with any of them. Can you explain?
-7
u/matholio Nov 08 '19
Sorry mate that is simple not true and frankly a bit ignorant. Printing Hello World was been a coding meme long be for python. It's basically a demo if what is required to print a string, and it's well loved by many.
4
u/execrator Nov 08 '19
Hello World definitely has a long history, but not as a way to compare languages. It's the "hello? is this mic on?" of programming.
It's not useful to compare languages by the code required to print a single string because that is not a useful program to write. It's like comparing aircraft to see which can cover 2 metres from a standing start quickest. One of them may be fastest, sure... but you don't take a plane on a 2 metre journey.
→ More replies (0)-10
Nov 07 '19 edited Nov 08 '19
So maybe you want an InternalFrameInternalFrameTitlePaneInternalFrameTitlePane MaximizeButtonWindowNotFocusedState? Edit: This is a real Java class in JDK....
69
Nov 07 '19
...python is so much easier and more enjoyable to write in
Most languages have strengths and weaknesses. Doing a task in a language it's ill suited for, just because that language is familiar and easy, will certainly be problematic down the road.
Learning Java at least lets one determine if it was the best tool for the task at hand.
1
u/alcalde Nov 07 '19
Doing a task in a language it's ill suited for, just because that language is familiar and easy, will certainly be problematic down the road.
If it's easy to do something in a language, then that language is well-suited for the task by definition.
24
u/Zalack Nov 07 '19
Not if performance is an issue or you don't have control over the target machine's python environment (there are ways around this last one but it generally comes with other tradeoffs).
I love python, I spend most of my job writing it -- but there are projects where the performance hit of using an interpreted language like python just isn't tenable.
3
u/Brandhout Nov 07 '19
I always thought C would be the way to go if you are looking for high performance. Mostly because I have come across a few high performance systems built in C.
What is your take on that?
8
u/redwall_hp Nov 08 '19
C is a loaded shotgun pointed at your foot, and dealing with strings makes you want to point it at your head instead. Yes, it's fast and excellent for low-level bit blasting, but it's not really a good option for "this relatively high level use case runs slowly."
Java is a perfect medium between Python and C.
→ More replies (0)3
u/Flynamic Nov 07 '19
I'd also recommend Go for that, the language gives you good tools to work with and it's compiled.
2
u/Laogeodritt Nov 08 '19
Anything that compiles to machine code will generally be usable for high performance applications. C is one of them; it's great for low-level performance optimisations. However, most performance problems aren't solved by low level optimisation, as a sibling comment to mine implies. That is to say, performance impact is most significant when it comes to how you, the engineer(s), chose how to organise various responsibilities/functionality at the highest abstraction level (architecture), how you designed all the components that make that up (code/class/function organisation, how data is stored and passed around), implementation choices (which algorithm you chose to sort your giant list, exact data structures and organisation of data, where you're having to translate date between different formats or data structures, communication protocols, etc.), and low level issues (how memory is used, overhead from function calls or data type checking, efficiency losses due to pointer dereferencing or register/cache misses in the processor during the inner loop of an algorithm, pretty much all performance critical computationally heavy algorithms, etc.).
You'll notice that last level is close to the hardware, incredibly specific, and performance gains are minimal compared to fixing a poor design - it's really only applicable to eking out the last little bit of performance, or performance in really computationally heavy parts of the program, where you might be calling the same routine or looping thousands of times per second or similar - small inefficiencies there add up a lot.
I would generally advocate for mixed technology systems when high performance is required, in most computing scenarios (embedded scenarios being a major exception). For example, python for most of the application (way cheaper due to ease of use), with C for the inner loop or computation heavy routines - spend the timr/developer salary writing low level code where it really matters. You can write Python bindings to call C from python easily.
1
Nov 08 '19
I’ve come across high performance systems written in java, c, c++, c#, ocaml and experimentally rust. Plenty of languages do high performance you just need to know how to do it.
-2
10
Nov 07 '19
With all due respect, no.
I understand your point, but I didn't say the task was easy to do in the language, I said the language was easy and familiar.
Is it possibly and easy to write a message queue in Python? Sure. Is it the best choice? Not by a long shot. Erlang is far better suited for that task, especially if you intend to scale. or Go, C++ and Java. That's not an exhaustive list; the intent is to show there are better tools, not which is best. All of the alternatives are arguably less easy, yet better options.
1
Nov 07 '19
I think out of all languages I have ever seen and tried, at least one of them will be better / equally as suited as Java. So fuck Java
16
u/OddsCaller Nov 07 '19
Yeah but you have learned Java at some point, right? I don't like the Java or any language-bashing advice being given to novices. It's like an experienced programmer bashing OOP and telling how functional programming is better. That statement may or may not be better but it doesn't make OOP not worth learning for a novice, and kind of hides the fact that the experienced programmer has learned a lot by actually learning and using and suffering with OOP and a novice can't get that insight by simply refusing an opportunity to learn a concept with complete eagerness because of the negative comments they heard.
5
u/saxattax Nov 08 '19
Yeah but if we bash other languages hard enough, we can create a utopia where all high-level code is written in Python and everything is perfectly interoperable (I'm only kind of joking)
1
u/scarfarce Nov 08 '19
... create a utopia where all high-level code is written in Python...
MEDIC!
(I'm only kind of joking)
Never mind...
5
u/1chriis1 Nov 08 '19
Unless, you encounter the stupidest hickups for a small indent. Love it though!
4
u/nemec Nov 08 '19
When your application is 300,000 lines of code it doesn't tend to matter much how long a "hello world" program is in comparison.
Sure, it sucks for a beginner, but presumably you won't be a beginner forever...
Java sucks though for other reasons
2
u/pwang99 Nov 07 '19
It’s not faster for a huge part of what people use software for, namely, large data processing (data science and machine learning)
1
u/Thameos Dec 04 '19
It's worth noting that Python itself isn't necessarily slower than Java, just the reference implementation (CPython). That also doesn't apply to every task. Jython for example uses the JVM, so it's essentially equivalent in performance. Other implementations such as Cython and PyPy have even faster performance.
0
Nov 08 '19
[deleted]
1
Nov 08 '19
Depends. If you're writing templates, C++ can be way more verbose. It can also be significantly more terse though since it's not a pure OOP language and not everything has to be locked into a class.
12
Nov 07 '19 edited Nov 08 '19
Java isn’t bad. It’s verbose but extremely performant. It doesn’t cross over into “awful” territory until you start applying 20+ years of enterprise “patterns” to everything you do and you start contemplating stepping in front of oncoming traffic on a regular basis.
4
u/niceoutfive Nov 08 '19
In my experience, Java is more pedantic. You have to do it their way or the highway. Python is more easy going. You can do basically all the same stuff, but with fewer rules. In Java you have to write getters and setters (like
user.getName()). But in Python you just sayuser.name.Python gets it done with little hassle, Java gets it done but only if you recite the proper incantation during the right moon cycle while you write it. But it is pretty solid once you learn the arcane arts!
(Caveat: I know Java only in an educational environment, so we were being taught the "proper way." I'm sure that that is way more pedantic than when it is used for real development. Buuut, seeing some actual production Java code at my company, that appears to be the norm. You can get just as structural with Python too!)
You should very much learn Java though. If you know Java, you can figure out the other bad boys like C and C++ a lot easier. If you already know Java, congrats you now know probably 90% of C#. If you want to ever do Android development, you'll need Java (although Kotlin is also getting very big in that field)
1
Nov 08 '19
Java is a totally fine lanuage. No need to worry. It's a bit verbose but a good ide helps with that.
1
u/notlupus Nov 08 '19
As a freshman in college, you don’t need Java. You need Java for writing scalable enterprise web applications. For instance, Java is the dominant language used to build AWS and Netflix. Most of the time you don’t need it, but it’s great when you do.
-6
u/AcousticDan Nov 07 '19
It's probably too strict for some python people.
3
u/num8lock Nov 07 '19
it's not just the typing restriction, compared to python it's obtuse & inhibits creative mindset as evident in all its naming conventions & inflexible idioms all over the internet.
0
7
u/lordmyd Nov 07 '19
Just out of interest how much willingness is there to substitute Kotlin for Java at your workplace?
10
Nov 07 '19
GoLang is fun.
20
u/foobarfault Nov 07 '19
Until you have to figure out where in the stack an error actually came from...
Still my favorite language
3
0
7
u/i9srpeg Nov 07 '19
Go is Java 1.0
1
-5
Nov 07 '19
At least go doesn't need an interpreter.
5
u/CidSlayer Nov 07 '19
Java doesn't have an interpreter. It is compiled JIT by the JVM.
1
u/trumpgender Nov 07 '19
Well, some of the bytecode is interpreted directly, other parts that the JVM senses can benefit from speedup will be JIT compiled.
2
-5
Nov 07 '19
That's the description of a bytecode interpreter...
3
u/tristan957 Nov 08 '19
I don't think you understand at all. Your computer is just a machine code interpreter. Java is a compiled language, not interpreted. Please stop.
0
Nov 08 '19
You compile it to bytecode.
It's bytecode - true. You need an interpreter to run it.
What's your point there?
No I will not use java propaganda phrase and call this a JVM. It's just a Bullshit way of doing things.
3
u/CidSlayer Nov 08 '19
But that bytecode is not interpreted. It's then compiled down (again) to assembly, on the fly, by HotSpot. Then you could argue that those assembly instructions are actually interpreted, but then no language would be compiled.
→ More replies (0)-3
u/ProjectSnowman Nov 07 '19
It's not the language I have a problem with, it's JRE. It's the biggest piece of shit ever made.
5
Nov 08 '19
The Jre is literally one of the best pieces of software written.
1
u/ProjectSnowman Nov 08 '19
For developers? Sure. For users? Not so much. Having to install several different legacy versions of JRE to run applications either no longer supported or with no equivalent is painful.
7
u/FlukyS Nov 07 '19
Syntactically Java was never bad in its day but in comparison to Python it's night and day. I do think learning python both helped my C and Java stylistically but learning Java would never help my Python. Add that just better tooling for Python right now and there is really good reason why the language is in demand. C++ needs to watch it's back too.
3
u/thisisshantzz Nov 07 '19 edited Nov 07 '19
Somewhere I feel that Python should have been a strongly statically typed language while maintaining its simplicity of writing style. So many times I had trouble identifying the type of argument that a function takes especially when using third party libraries.3
u/GrizzyLizz Nov 07 '19
How is Python not strongly typed? Compare it to JS, where you can implictly convert one to another, Python would give you a TypeError with such things
3
Nov 08 '19
He means static and explicit typing. Obviously. It really isn't that hard to infer what he means unless you just want to be a dick.
1
u/thisisshantzz Nov 07 '19
Made an edit to my comment.
My gripe though is that most of the times functions are defined as
def func(a, b):
If this were a third party library, I would not know what is the type of a and b that I need to provide to the function and what is that type of the value returned by this function so that I can use it down the line unless the person who made the library was kind enough to document it. If a is supposed to be a list and I pass an int to it, Python won't raise a TypeError and to actually know what is the type of a that is expected without the documentation, I will have to read the code itself.
3
u/panzerex Nov 08 '19
I think the term you're looking for is static typing. Python can't tell you beforehand that the argument you provided is not the appropriate type.
2
1
u/ginbear Nov 08 '19
The typing library in python 3.6+ can accomplish a lot of this. Of course it’s still an interpreted language so it’s more of a linter effect. Regardless people should really consider duck_typing in python, it’s really the pythonic thing to do.
1
u/Mjerman Nov 08 '19
I think this goes to poor documentation. If you’re reading code and it doesn’t tell you the types of function’s input in the doc string, it is poorly documented.
2
1
53
Nov 07 '19
And I would've gotten away with it, if it weren't for those meddling javascript developers
28
u/Everyday_Analyst Nov 07 '19
anyone who can use Python and JavaScript must be imminently employable
8
3
1
u/toyg Nov 08 '19
I wish that were true. Not my experience. Then again, I’m middle-aged and my CV is in another tech domain, so the first question I get asked is “after 10+ years in that domain, why do you want this (web) job now?”, and nobody believes that it’s what I always wanted to do but couldn’t (because life).
1
u/Everyday_Analyst Nov 08 '19
The way I've got around that so far was to keep my current job but bring that functionality in to improve my own work and reduce my team's workload. I essentially do these side projects o spec. My team has come to depend on them now.
6
u/lattakia Nov 07 '19
Has python3 overtaken python2 usage yet ?
5
u/midnitte Nov 07 '19
Been that way for a while I believe, only something like 25%.
I would imagine it would depend upon company for professional use though.
5
u/kringel8 Nov 07 '19
If you look at the 2018 survey it's down to 16% (https://www.jetbrains.com/research/python-developers-survey-2018/#python-3-adoption).
3
5
u/oscarjrs Nov 07 '19
What happened to Ruby?
36
9
Nov 07 '19
My opinion: Rails happened. Ruby saw an upshot because of Rails. It became the cool thing to do. When another, newer cooler thing came along, the crowd jumped ship.
I appreciate Ruby, but I've never been compelled to do anything meaningful in it.
1
Nov 08 '19
What's the other, cooler thing? Django?
2
u/toyg Nov 08 '19
No, Node and React. Most people I know who used to be Rails devs are now Node devs.
1
Nov 08 '19
Couldn't tell you. I'm not the target audience for Django and its ilk. What I can tell you is there was a time where some would claim to know Ruby, where they did not (they knew rails and enough ruby to get rails to render.)
I'm not disparaging that group, don't get me wrong. The important part is, Ruby's surge (and decline) is a result of people flocking to Rails. (Or, Rail apps are soooo stable, they require no future maintenance.) Assuming the former, a next big thing means a lot of the chatter about Ruby disappears with them.
If Django is the next big thing - python already has a huge community that isn't about content management; if they come and go it wouldn't be much more than a statistical error.
(There are a lot of projects that I LOVE that are done in ruby/rails, BTW.)
4
u/Skogsberg89 Nov 08 '19
I love python <3
14
2
2
u/execrator Nov 08 '19
The language is no different no matter which position it occupies on this chart. I was going to continue and say that, on the other hand, the ecosystem surely improves with popularity, but then you have JS as a cautionary tale... so
2
3
2
u/log_2 Nov 07 '19
Not surprising since Oracle killed java.
14
u/james_pic Nov 07 '19
Oracle only killed Java if you think it was theirs to kill. For me, Java's meant OpenJDK for best part of a decade. Oracle stepping back from it is a chance for the community to step forward.
2
u/toyg Nov 08 '19
Not a big fan of O, but they did actually give back to Java some development speed. They started with the long-overdue Java 7 in 2011 and it’s been a breakneck run since then (with the occasional debatable choice, like breaking a lot of stuff in Java 9). Before Oracle, Java as a language was literally rotting.
The only controversial choice Oracle made, regarding Java, was the Dalvik lawsuit (which Google really should have seen coming, they had literally bullied a weakened Sun out of their own market). Pretty much everything else they did alright. The recent license change is a bit confusing, but they’ve literally given the JDK more freedom that it ever had under Sun: anyone can now build a JDK that is just as good as Oracle’s own in all the ways that matter. That is big.
5
u/colemaker360 Nov 07 '19 edited Sep 13 '25
smell existence seemly cagey chop employ plant bag wild soft
This post was mass deleted and anonymized with Redact
5
u/alexhairyman Nov 07 '19
The number of well developed non-java JVM languages makes the opposite point I think. Scala, Kotlin, Groovy, and Clojure just to name a few. All can interact with each other on the JVM. The adoption of OpenJDK as the new standard install and AdoptOpenJdk gaining traction shows a strong community not tied to Oracle. Which is a good thing because I don't trust Oracle from a business or ethics standpoint
1
u/fxgx1 Nov 09 '19
I hate it when the reporter with zero engineering background read something on GitHub and write about it as if the world is coming to an end. Python is still used by a lot amatures. Although I wouldn's dismiss it right. But the doesnt run on Python and that will never happen. The hypes around this news is the fact that a lot of people who failed to learn C, C++ and Java but consoled themselves with Python are feeling validated. A real software engineer care less about the popularity of a certain programming language. It's about what problem are you trying to solve and not what programming language you are using.
1
-3
u/bonestormII Nov 07 '19
To be honest, I could go my whole life and never read one of these stupid “Python is more popular than...” posts.
2
0
0
0
Nov 07 '19
[deleted]
6
u/sharkbound github: sharkbound, python := 3.8 Nov 07 '19
i used to (and still do sometimes) do C#, overall, its not bad, but i have grown to love python so much more.
python also offers so much more in terms of depth of the language IMO.
you can mess with python's inner workings, and do stuff like have custom attribute access logic, or completely overriding attribute access with your own stuff
other than python, one other language i enjoy is Kotlin
8
u/nemec Nov 08 '19
python also offers so much more in terms of depth of the language IMO.
I think you're underestimating the depth of .NET. With the reference source you can dig into the inner workings of the framework and carve bits out with reflection. For example, I once wrote a program to intercept all calls that print to the terminal and highlight certain words in red.
Custom attribute/property access exists, too, but generally is only used with libraries like IronPython.
45
u/hopemeetme Nov 07 '19
https://octoverse.github.com/#top-languages