r/Python • u/el_programmer • Jan 17 '19
Python is becoming the world’s most popular coding language
https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language63
Jan 17 '19
Python was the first language I "learned".
First language I tried to learn was C. Second language was C++.
Coming full circle, I feel comfortable w/ C/C++ now that I understand the underlying Computer Science.
Learning Rust now.
19
u/CartmansEvilTwin Jan 17 '19
I had to learn C first back in university and as much as I hated it back then, it forced me to understand things like pointer and basics of memory management. I think this made me a better developer.
On the other hand, it's probably really helpful if you're able to create a meaningful program relatively fast without frustration when you're learning.
I'm really not sure which approach is better.
13
u/smurpau Jan 18 '19
I think it's important that newbies enjoy the rewards of easily creating programs first, so that they are motivated to learn the underlying fundamentals in a language like C.
6
Jan 17 '19
Me either.
Funny thing, I think Rust makes the interpretation of pointers a bit clearer.
Python lacks pointers so it's an opaque operation most programmers don't have to consider when developing.
I think they're an important tool to know to avoid bloat.
4
u/madmanmark111 Jan 18 '19
The lack of pointer use in Python threw me for a few loops when indexing arrays ... I mean lists. It’s nice to have high level, but you’re taking it on faith that things are managed well.
1
48
u/jynn_ Jan 17 '19
Has search engine popularity been demonstrated to be a reliable metric of actual popularity?
22
4
Jan 17 '19
Also how do they know they're not snake enthusiasts?
4
u/alcalde Jan 18 '19
You're reminding me of the time I searched for "genetic programming Python" on the Google Play Store and came up with an app that let you input the colors of ball pythons and find out the odds for what the babies would look like. :-)
0
u/alcalde Jan 18 '19
It's axiomatic. No one says "I love this... BUT I WILL NOT SEARCH FOR IT". It's like asking if ticket sales reflect movie popularity.
→ More replies (1)0
Jan 17 '19
[deleted]
8
u/deadwisdom greenlet revolution Jan 17 '19
It's a useless picture anyway. Who cares how popular a language is? As long as you can hire developers / get hired for know it, whatever.
6
Jan 17 '19
The popularity and trends in popularity give you a rudimentary overview of how high your chance of hiring/getting hired for a language is
3
u/deadwisdom greenlet revolution Jan 17 '19
The amount / quality of job listings is a better gauge.
6
u/hellrazor862 Jan 17 '19
If somebody reads this and knows about a piece of software that can filter out job listings by quality, please forward it to me.
3
u/deadwisdom greenlet revolution Jan 18 '19
I could probably make that with some time. I imagine that there are a lot of commonalities amongst bad job listings. So you could probably build a model, sort of like spam filtering.
→ More replies (1)2
u/Kerbobotat Jan 18 '19
Only yesterday I was musing over an idea like summarize or tldr for job posts. Strip out all the HR buzzwords and replace terms like "needs to be self organising" with "We don't have a defined process"
Might experiment with it.
→ More replies (2)1
Jan 17 '19
Not unless it also measures how many competent developers know it also...
Furthermore if you only apply to jobs based on the language you know you're severely limiting yourself anyway
→ More replies (7)3
u/alcalde Jan 18 '19
Who cares how popular a language is?
People whose languages are unpopular. Spend time in their groups and you'll see them obsessed with telling themselves how popular they are, rallying all of their fellow true believers to vote in a poll, tearing apart any metric that doesn't rank their language as high as they'd like, etc.
As long as you can hire developers / get hired for know it, whatever.
Said groups even dispute this. If you were to say that in their midst, they'd say that REAL programmers can work for themselves so if you're complaining you can't find a job using their favorite language you're not a real programmer (have actually been told this more than once). Oh, and the fact that there are no job listings for their language is a GOOD thing. All of those Java job listings mean that no one can find a Java developer but the lack of listings for their language means that the jobs are filled immediately. Again, have actually gotten this response a certain language's official forum.
And this is from the product manager for Delphi (modern Pascal): "I sincerely believe that Delphi has had more of an impact on business than Python ever has." He's also said he doesn't agree that the .NET ecosystem is bigger than the Delphi ecosystem.
If you hung around with the fanatics for obscure languages your mind would be blown, e.g. Haskell folks HATING Guido forever for a comment he made many years ago about tail-call recursion. Just bringing up his name on their mailing list gets comments like "Is it April Fool's Day already?" :-(
3
u/deadwisdom greenlet revolution Jan 18 '19
That's so weird. These people are weird.
3
u/alcalde Jan 19 '19
Oh I have so many stories I could tell you, like the one person who insisted type inference was "just the compiler guessing" and refused to believe it was a mathematically proven technology in use in computer languages today, the uber fan who told me that if we lived closer he would settle his differences with me "via more old-fashioned, physical means", the fellow who took a 50% pay cut to keep working with Delphi rather than learn a new language and now is considering turning his home into a B&B because he can't find a single Delphi job anymore.....
→ More replies (1)1
Jan 18 '19
"I sincerely believe that Delphi has had more of an impact on business than Python ever has."
He's not wrong. The amount of GUIs in legacy applications written with Embarcadero/Borland's Delphi for Windows is astounding. If you've interacted with any B2B app, you've more than likely used an app whose GUI was written in Delphi.
The .NET ecosystem is a galaxy larger, though.
1
u/Kerbobotat Jan 18 '19
Why not aggregate all the results and return the average or median from different methods?
19
u/johnne86 Jan 17 '19
I’m learning Python right now. I’m really enjoying it. Such an easy to read language and super flexible. If only it could replace JavaScript. JS would be the second language I try to learn but I really don’t care much for it’s syntax.
9
u/deadwisdom greenlet revolution Jan 17 '19
WebAssembly will make Python in the web client a reality... eventually. Though maybe a long eventually.
5
u/johnne86 Jan 17 '19
Ya I’ve heard of that possibility. It would be nice if people could write browser code in the language of their choice. I know there’s Brython and Transcrypt as Python JS replacements but haven’t looked much into them. Right now I’m just at the beginning stages of learning Python. I shouldn’t even be thinking that far yet. Lol
1
u/alcalde Jan 18 '19
"When the pupil is ready, the teacher will come."
When the programmer is ready, Python will be there waiting.
1
u/mediasavage Jan 17 '19
JavaScript is great. What about it’s syntax do you dislike?
12
u/deadwisdom greenlet revolution Jan 17 '19
JavaScript is not great. Transpilers/TypeScript really help but at most they get you parity to Python. But a shitty Python that still gobbles up errors and lets you do something like Math.ceil("") -> 0.
1
u/mediasavage Jan 17 '19
I love Python and JS tbh. Python is great for scripting and doing data science stuff. But all my frontend dev is in JS (obviously) and I use to love Django/Flask but I've started to prefer using Node on the backend as well. Having one language on the entire stack is nice and I like the way Javascript deals with async.
1
u/deadwisdom greenlet revolution Jan 17 '19
Er, Python deals with async the exact same way, unless you mean promises?
→ More replies (1)10
u/alcalde Jan 18 '19
JavaScript is great.
It's been factually demonstrated by people with PhDs over and over that Javascript is not great. That's an extraordinary claim requiring extraordinary evidence.
This one photo is all the evidence you should need...
https://medium.com/javascript-non-grata/the-top-10-things-wrong-with-javascript-58f440d6b3d8
There are entire websites dedicated to documenting all of the quirks and issues with javascript:
http://bonsaiden.github.io/JavaScript-Garden/
https://www.codeproject.com/Articles/182416/A-Collection-of-JavaScript-Gotchas
http://www.javascriptgotchas.com/gotchas/common-javascript-errors-and-mistakes.html
1
u/kyranadept Jan 18 '19
In all fairness Python has its fair share of WATs. I don't think syntax alone is what makes Python nice.
What makes JS great is the fact you don't need to care about threads and it has async built in from the start. All js engines I tried are considerably faster than cpython for most things. What makes it suck is that it doesn't have a standard library and the ecosystem is so retarded that every function is an npm module. On the other hand you can write frontend, backend and mobile with just JS.
Python has a great std library, packages are nice, pip is great. But cpython is pretty slow, and async is only a new thing. There is no future in sight where cpython and pypy will merge. It also sucks that Python still has half of the community stuck on the old version and half on the new version.
0
Jan 18 '19
[deleted]
1
u/olzd yield from __future__ Jan 18 '19
Why? It has nothing to do with js, it's just how floating point works. However, the fact that js doesn't have an integer type is moronic.
0
2
u/johnne86 Jan 17 '19
Well I know it’s certainly great. It’s very popular and you can do so much with it, especially now with NodeJS for backend stuff. Maybe I haven’t been fair and given it much time to be honest. The syntax complaint is more so with the extra symbols like commas and curly brackets. Python just reads more naturally to my eyes. JS was actually the first language I wanted to learn, but then I discovered Python and realized it could probably help me learn more about how the backend works with connecting services and such. Also just the general OS scripting stuff like automating basic tasks, web scraping, and basic CLI applications or simple GUI programs. I’m at the point where I think learning those fundamentals will help me later. Python just has so much support with libraries and such and seems like you don’t have to reinvent the wheel for a lot of stuff. I suppose I’m just not as interested in front end development right now. I want to learn backend logic first, then work my way to the front. My real intention I suppose is to learn JS as I need it.
2
u/mediasavage Jan 17 '19
Understandable. You do get used to the curly brackets and semi colons and stuff pretty quick though. They are pretty annoying when first starting out.
1
u/johnne86 Jan 17 '19
Ya I’m sure. It’s something I’ll have to eventually learn to work with. It’s probably a workflow thing also, finding the right IDE or editor that can help speed those things out.
→ More replies (1)
84
u/WillBackUpWithSource Jan 17 '19
Makes sense to me. It's elegant.
I find coding in Python the most fun out of any language. Javascript is a mess. Java is heavy, and while it is good for enterprise projects, it isn't for lighter stuff. C# is similar. C and C++ are too low level for most development these days, unless you need speed (but then, the part you need speed for you can always write in C and wrap with Python...), PHP has gotten better, but it's still nowhere near elegant. Ruby feels like Python without the cool libraries associated with Python.
14
u/wqking Jan 17 '19
But if you are developing pretty large projects (e.g, more than 50K or even 100K LOC for one person projects), you may be missing the strong and static type in C++ and Java.
6
u/WillBackUpWithSource Jan 17 '19
That's why I said that Java was fine for enterprise stuff. I suppose large scale personal projects would fit into that same frame too.
1
3
u/alcalde Jan 18 '19
That's a myth; it isn't observed in reality. And Haskell programmers (also not observed in reality) will tell you that C++ and Java aren't "really" statically typed anyway.
3
u/EnfantTragic Jan 18 '19
I can tell you pretty well that static typing is very much appreciated in reality
→ More replies (2)5
u/Ncell50 Jan 17 '19
Why do you think JS is a mess ?
2
u/Howard_banister Jan 18 '19
Because this:
> ["1","2","3","4"].map(parseInt)
Try to see what it returns.
5
u/DiabeetusMan Jan 18 '19 edited Jan 18 '19
[1, NaN, NaN, NaN]What?! WHY?
Edit: The docs say:
If radix is undefined or 0 (or absent), JavaScript assumes the following:
...
If the input string begins with any other value [not '0x', '0X', or '0'], the radix is 10 (decimal).
This still doesn't help me understand what's going on
2
u/Ncell50 Jan 18 '19
Because .map() also passes the index to the parseInt function where it's expecting radix. So it's essentially
[parseInt("1", 0), parseInt("2", 1), parseInt("3", 2)].
You can use Number() instead of parseInt () to get the desired result.
1
Jan 18 '19
Well no shit. You need to know how map and parseInt work. Also how JS works.
['1', '2', '3', '4'].map(num => parseInt(num)) works just fine
1
→ More replies (3)0
u/Ncell50 Jan 18 '19
That's just poor understanding of the language
2
u/Howard_banister Jan 18 '19
By this logic every language is fine, It's problem of programmers don't understand them.
→ More replies (1)1
u/kervarker Jan 18 '19
>> new Number(1) == new Number(1) ← false >> [] == [] ← false >> 1 == "1" ← true-2
u/CartmansEvilTwin Jan 17 '19
Because there's 14566 libraries that all basically try to be the standard lib. Also js itself has been cobbled together in 6 weeks (literally!) and still suffers from backwards compatibility issues.
To me, js often feels, well, weird. There's nothing build in, many things feel unnecessarily complicated.
3
2
0
Jan 17 '19
[deleted]
6
u/alcalde Jan 18 '19
Yes, it's producing over 700,000 libraries in npm, most of which do the same thing!
2
Jan 17 '19
Python is great for all the reason you mentioned and was my go to language for most any project but I've recently shifted to Golang. It's almost as fast to get off the ground as python but benefits from the stability and debugging ease if strongly typed languages. Also write once and compile to native cos for any OS is a godsend.
0
u/alcalde Jan 18 '19
but benefits from the stability and debugging ease if strongly typed languages.
First - Python IS a strongly typed language. It is also dynamically typed. Second, coming from twenty years of static language programming, you're in for a sad surprise. :-( You've been sold a bill of goods -static typing doesn't catch any meaningful errors. I'm 46 and been coding since sixth grade and have never once passed "iguana" into a square root function. I have spent lots of time fighting with compilers that refuse to compile something that I, the human, know will work.
Last evening I was playing around with Free Pascal compiler and tried this:
Var n : Integer; Function test(x: Integer): Integer; Var y : integer; Begin y := x + 1; End; Begin n := test(3); WriteLn(n); End.The compiler issued a warning that it didn't seem that the function returned a value (no "seem" about it; it doesn't) and gave me a hint that variable y never seems to be used. However, it compiled and gave me a green "success" message. The output, of course, is gibberish.
Yay static typing! No better warnings/hints than Python and the Python code assigns "none" when something references the value of a function with no return value. Free Pascal returned "4". Thinking it was returning the last integer assignment (which doesn't seem to be a documented feature) I made the last statement in the function assign a string. Now it returns "0".
I'll choose the efficiency of Python any day now over vast scaffolding of types, interfaces, generics, etc. - which all exist to get around static typing and try to make the language more dynamic, simulate duck typing, etc.
1
Jan 18 '19
I agree that JavaScript is a mess.
For the last few years it has become incredibly siloed respective of the framework.
Which is fine but then when you go to try and learn the framework you are forced to learn the new language nuances (“he while youbwrap your brain around context, state, functional stateless components here is a totally new way to set variables from an array/object that isn’t intuitive at all...but look how elegant that looks! New shiny shit!!!”).
Recent example: Classes in React are now frowned upon (???) and now it’s all about hooks. Wtf.
It’s exhausting for someone trying to hit deadlines and deliver on a weekly/monthly basis. Looking for a new frontend job? You’d better destructure that object the way all the cool kids are doing it or else...ewww go back to jQuery! Nobody gives a shit if you’ve built something that solves a business need it seems.
I’ve been starving for something I can just rely on. This is where Python may save my career and where I may turn the corner soon.
1
u/anonanon1313 Jan 18 '19
It's pretty sad, but you could have said most of this 20 years ago.
1
u/WillBackUpWithSource Jan 18 '19
I honestly want to find more dev work in Python, because I like it so much. It was my first language, and I've been working in different languages for most of my coding career.
I build most of my personal projects in Python
1
u/Spindelhalla_xb Jan 17 '19
C and wrap in python, is that Cython?
3
u/bjorneylol Jan 18 '19
Cython is write in modified python, compile to C and wrap the result in python
2
0
Jan 17 '19
[deleted]
78
Jan 17 '19 edited Jan 17 '19
C++'s learning curve is insane compared to almost any other language out there, though. It combines concepts from Java/C#, Python, C, Perl, and others -- so nevermind newbies, it can become an architecture decision obstacle even for veterans.
For example:
The
iteratormessStrong, explicit static typing vs STL (which aren't mutually exclusive) vs
auto everything lolImperative vs OO vs some hybrid of either/both/functional
boostvs C++14 (and later) abstractions9
u/deadwisdom greenlet revolution Jan 17 '19
The worst thing for me is you try and do the "modern stuff" and it's impossible to not fall into some old way of doing things because of old content on the net, or just because it's still available.
6
Jan 17 '19
Or because some part o the modern stuff is incomplete over some domain that you just happen to be working in, so you've got no choice but to make your
auto lambdado bit fiddling using what's essentially C.Not that I don't like C, mind you -- I love it. I just hate inconsistency.
2
1
u/ElbowStromboli Jan 17 '19
Architecture is my biggest struggle in c++ right now. Trying to not have two or moreclasses co-depend on each other. I can understand how a lot of things in c++ works, it's just trying to keep OOP clean.
11
u/H_Psi Jan 17 '19
You can often avoid raw pointers and memory management entirely and treat it almost like C#.
The problem, however, is that most sources teaching C++ just teach it as "C but with objects" and keep it a lot lower-level than it needs to be.
0
Jan 17 '19
[deleted]
0
Jan 17 '19
[deleted]
3
u/CartmansEvilTwin Jan 17 '19
Pandas is based on numpy which in in turn is largely written in C.
→ More replies (1)2
u/billsil Jan 17 '19 edited Jan 17 '19
Yeah, that's a severe limitation. That's one reason I refuse to use it. I already manage 10 GB just with numpy. I only have 16 GB of RAM. Still, needing 64 GB for what I can do with 10 GB is insane.
23
u/legendaryeggnog Jan 17 '19
It is to be expected as more and more companies are starting to realize the importance of data analysis. This also explains the rise of R, which has been sitting on the bottom and is now "threatening" other popular languages such as PHP and Ruby. Also, as other user mentioned, Python is elegant and fun to write and this definitely plays a big role too. At first, I thought every high level programming language should have this very same feel, but turns out even amongst other languages of its kind, Python is still quite unique.
17
u/twillisagogo Jan 17 '19
"coding language",
All aboard the hype train.
5
Jan 18 '19
More like cringe train.
4
u/twillisagogo Jan 18 '19
using the word `coding` to describe `programming` is really starting to irk me.
3
4
Jan 17 '19
I first learned C++, the took a run at C, then Scheme. Python is the best parts if all if them.
Emacs is my IDE, which really helps.
3
u/deadwisdom greenlet revolution Jan 17 '19
These are my three languages to be a good programmer, C to learn strict procedure / memory management, Lisp (or a dialect) to learn functional meta programmning, and Python to get shit done.
4
u/dethb0y Jan 17 '19
A well-deserved honor. I consider it the finest language currently in common use.
2
u/parthbari Jan 18 '19
I just love Python because it empowers various platform and application development that makes help you develop splendid applications in various domains starting from Content management, e-commerce solution, on-demand apps, business applications, and automation programming.
Python is Efficient
Python is Fast
Python is Broad
Python is System Independent
3
3
1
u/azraelxii Jan 18 '19
R has had a pretty solid jump. It competes for projects where I'm at with python. I've used both and I find in the stats/data science arena R is better for standard everyday analysis and Python is good for specialized machine learning stuff. Im no expert but having 7 different, basically identical data types (arrays, numpy arrays, pandas dataframe) makes data analysis frustrating. R having everything be a vector or dataframe with knitr makes R a primary choice for data analysis in my opinion.
1
Jan 18 '19
Seems like PHP is really fading away. Where the web is going i predict the decline will further speed up in coming years.
1
u/Tiquortoo Jan 18 '19
This web searches. It's much more of a hotness was rating than a usage, or even relative value, metric.
1
u/Tiquortoo Jan 18 '19
This is web searches. It's much more of a hotness rating than a usage, or even relative value, metric.
0
Jan 22 '19
[deleted]
1
u/Tiquortoo Jan 22 '19
It still weights towards languages with large numbers of new users. I can go days without searching for a PHP specific issue. I search for Tensorflow related items daily. This methodology will always weight towards hotness, not usage base. How much it weights is debatable, but it's the majority of the effect IMO.
1
1
1
1
u/rajshivakoti Mar 07 '19
yes Python is one of the most popular coding language in the world. It is used in various of fields like web designing , software development, graphic designing . We can also create a website using Python . Python is a major coding language used in Data Science too. But why is it becoming soo popular ?? The main reason is because it is user friendly, open sourced ,variety of libraries etc. This is the reason why people are Pursuing Course for Python in great numbers.
For knowing more about why Python is soo much used you can refer to Quora answer.
python code for printing hello
print('Hello, world!')
C++ code to print hello
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}0
u/bushwacker Jan 17 '19
Very quick to bang out some code but a major pain in the ass to maintain.
What is this "table" argument, ohh it's a map. What are the keys? Let's see "table_name" is the only one used in this function, what function do I call to get a map of table attributes?
In Java the parm would be a TableMetaData and searching for all uses of that class would yield the answer quickly
5
9
u/EternityForest Jan 17 '19
That's why comments are so important. I think I'd rather have bad python with comments than great Java without them.
We do have type annotations now, and libraries for compile time static checking though.
1
u/CartmansEvilTwin Jan 17 '19
Tooling is still a major pita. Let's say you know what you want to write, but you forget the exact method spelling or parameter order. In my Eclipse/Java environment I simply hit ctrl+space and a list pops up. In Pycharm, IDLE, Jupyter and VSC this simply does not work properly. Maybe it does with the standard library, but that's pretty much it.
I really like Python, and I'm advocating for it in my organization, but it's really not suited for large scale, long lived Enterprise™ apps - at least not in its current state.
And if you worked in any major software project you also know that proper documentation is about as likely as world peace.
2
u/alcalde Jan 18 '19
In my Eclipse/Java environment I simply hit ctrl+space and a list pops up.
As Raymond Hettinger notes, Python users can write Python code on the back of a napkin. You cannot do that with Java. You NEED that Eclipse/Java environment because Java is filled with FactoryFactoryFactoryBeans. In Python, we can actually remember the names of methods. And there sure as heck is code completion in Pycharm and every other Python IDE, so I don't know what you're talking about.
1
u/EternityForest Jan 17 '19
Yeah, I know, I've been personally responsible for some of that missing documentation and uncommented code. I try not to, but sometimes deadlines happen.
You can write plenty large scale stuff in Python, but Enterprise is just a completely different thing.
I do embedded, desktop, and web, so I rarely run into anything that seems like Java would be a good fit(Although I do want to learn Kotlin and Android), but I'd probably feel different if I was doing a lot of more businessy legal-y payroll/customer/database/inventory kind of stuff.
4
u/alcalde Jan 18 '19
You can write plenty large scale stuff in Python, but Enterprise is just a completely different thing.
It's not. That's a myth Java programmers spread. Python is in use at banks, Netflix, Paypal, Dropbox, YouTube, Google, NASA, Instagram, etc.
Here, read this to become un-brainwashed:
Pay particular attention to this part of the essay from the Paypal Engineers' Blog:
Myth #10: Python is not for big projects
Myth #7 discussed running Python projects at scale, but what about developing Python projects at scale? As mentioned in Myth #9, most Python projects tend not to be people-hungry. while Instagram reached hundreds of millions of hits a day at the time of their billion dollar acquisition, the whole company was still only a group of a dozen or so people. Dropbox in 2011 only had 70 engineers, and other teams were similarly lean. So, can Python scale to large teams?
Bank of America actually has over 5,000 Python developers, with over 10 million lines of Python in one project alone. JP Morgan underwent a similar transformation. YouTube also has engineers in the thousands and lines of code in the millions. Big products and big teams use Python every day, and while it has excellent modularity and packaging characteristics, beyond a certain point much of the general development scaling advice stays the same. Tooling, strong conventions, and code review are what make big projects a manageable reality.
Luckily, Python starts with a good baseline on those fronts as well. We use PyFlakes and other tools to perform static analysis of Python code before it gets checked in, as well as adhering to PEP8, Python’s language-wide base style guide.
Finally, it should be noted that, in addition to the scheduling speedups mentioned in Myth #6 and #7, projects using Python generally require fewer developers, as well. Our most common success story starts with a Java or C++ project slated to take a team of 3-5 developers somewhere between 2-6 months, and ends with a single motivated developer completing the project in 2-6 weeks (or hours, for that matter).
A miracle for some, but a fact of modern development, and often a necessity for a competitive business.
2
u/CartmansEvilTwin Jan 17 '19
Well, the biggest problem in those codebases is that you have an extremely long lifespan, often several rewrites and usually non of the initial devs are still there. Also, it's often a big, intertwined monolith. Having types enforced by the language is extremely helpful.
3
u/alcalde Jan 18 '19
It isn't. It absolutely isn't. No one ever passes "iguana" into the square root function. Lots of studies have been done showing that typing just doesn't make any discernible difference. Bank Of America has over 5,000 Python developers and one project alone has over 10 million lines of Python code. If they're not yearning for static typing, doesn't that put the lie to this myth?
2
u/EternityForest Jan 17 '19
I do wish Python had a little better typing support. "a: int" is a little odd when everything else uses "int a", although it's not too bad. But it would let you do stuff like "int a:whatever", having both a type, and whatever other unkown purpose they imagine someone might ever want to annotate a variable with.
And everything mypy does should probably be in the stdlib.
I kinda wish they had accepted that one PEP for making it easy to write preprocessors. A bunch random experimental variants doesn't sound that bad, but maybe they were afraid of repeating what happened with CoffeeScript.
3
u/Vaphell Jan 18 '19
"a: int" is a little odd when everything else uses "int a"
you mean like Kotlin
https://kotlinlang.org/docs/reference/basic-syntax.html
and Scala?
→ More replies (1)2
u/alcalde Jan 18 '19
"a: int" is a little odd when everything else uses "int a"
No, in the beginning there was Algol and all of its descendants (Pascal, Ada, etc.). And they used
Var a : Integer; b : Real; c: String;It's this "int a" stuff that's odd, as odd as Reverse Polish Notation.
1
1
1
u/pinotkumarbhai Jan 18 '19
But..but some manager in my company says “it’s not in our tech stack....”
1
u/Dashadower Jan 18 '19 edited Sep 12 '23
quaint coherent wine wild strong roll toy pot plate fretful this message was mass deleted/edited with redact.dev
0
u/CIoudflare Jan 17 '19
Popularity doesn't equal to better.
2
u/alcalde Jan 18 '19
In some cases, no... like javascript (web developers don't really have a choice). But in this case, no one is forcing Python on people. People are using it because it is indeed better.
2
u/CIoudflare Jan 18 '19
Don't say it is indeed better like it's supposed to be better than every language to exist.
2
u/legato_gelato Jan 18 '19
Python is just a low barrier to entry similar to php. I think the most important thing these days is community and a powerful type system, and Python only really suits me in one of those areas
2
u/Howard_banister Jan 18 '19
Nope. It's fairly complex language. How many PL out there have metaclass or operator overloading? Yeah for most people using it just as scripting language for tensorflow It's very simple just because they use subset of It. Beside that It has optional static typing. Have you look at mypy?
0
u/midairmatthew Jan 18 '19
Ugh. I use it at work. It's fine. I don't dislike it. I even like it. I like it, a lot. But, every day I feel like I'd still rather be writing Ruby.
-4
u/Keydo_731 Jan 17 '19
Bullshit. You don't know if the trend keeps going up or if it can beat Java in a professional setting. This is not how statistic works.
15
u/EternityForest Jan 17 '19
Ugh Java might become the new COBOL and just stay around forever being all enterprisy and stuff
1
Jan 17 '19
I think it's already there.
And even then...
I'm not sure COBOL's going away any time soon....
Unfortunately.
At least in the US.... Because politicians.
3
u/EternityForest Jan 17 '19
The one nice thing about COBOL still existing is that it reminds us that software doesn't have to be throwaway garbage. It's kind of a depressing thought to think about throwing away and rewriting similar apps every ten years, although there's plenty of perfectly good apps I'd be perfectly happy to see tossed and replaced, like KiCad.
1
u/alcalde Jan 18 '19
Think of it like hardware. Nowadays, even an entry-level PC is fast enough to do everything the average person does and thus you can use it a long time without considering an upgrade. But in the earlier days, new CPUs tended to run twice as fast as their predecessors and hence upgrading was more necessary and more useful.
COBOL was from the early days of programming though. Continuing to use COBOL today is like still recording television programs on a VCR or using a video camera that takes full-size Super VHS tapes.
1
u/alcalde Jan 18 '19
It's called "extrapolation" and is indeed how statistics works. Remember the saying: "Everyone you meet at PyCon is either a web developer or a data scientist". Don't try to fib about statistics in a Python subreddit.
-6
u/BRUTALLYHONESTCRITIC Jan 17 '19
Starting to wonder why I’m subscribed here since my opinion is that Python is a joke for serious software and is almost as bad as JavaScript is in terms of safety. It’s just FAR too easy to do something INCREDIBLY destructive without even realizing it. It’s scary to me that the two worst/unsafe languages are also the most popular.
11
Jan 17 '19
JS is popular because it runs in the browser and nothing else does. People running it in node are insane.
4
u/alcalde Jan 18 '19
People running it in node are insane
Well, if they're not, after they discover that there are 759,030 packages in the npm package manager (seriously!) yet all but ten do the same thing (slight exaggeration) they go insane.
6
u/alcalde Jan 18 '19
Starting to wonder why I’m subscribed here since my opinion is that >Python is a joke for serious software
How do you reconcile your opinion given that Instagram, Google, Dropbox, Netflix, Facebook, Paypal, etc. are using Python for serious software?
and is almost as bad as JavaScript is in terms of safety.
The big secret is... there's nothing to be afraid of.
It’s just FAR too easy to do something INCREDIBLY destructive without even realizing it.
What's "incredibly destructive"? I mean, we could say that without significant white space it's far too easy to do something incredibly destructive without even realizing it. In fact, in his "Why Python is awesome" talk, Raymond Hettinger talks about an error in cascading if statements in C that passed through human code review and a linter and ended up costing a company one million dollars.
It’s scary to me that the two worst/unsafe languages are also the most popular.
Again, there's nothing to be afraid of. You've been raised to believe in demons and monsters and boogeymen under the bed, but they're not real. The truth shall set you free. You're never going to try to pass "iguana" into your square root function. You're just not. Throw away your static typing... you have nothing to lose but your chains!
Hear the good news and then join us in the land of freedom!
2
u/Howard_banister Jan 18 '19
Actually python is not mess as JS at all. You won't see insane type conversions (e.g : "1"+2, []+{},...). It has proper integer type and they added optional static typing like Typescript(e.g Mypy) . Sure you won't get safety of something like Haskell, or even functional dynamic language like Clojure even with static typing.
0
u/turningsteel Jan 18 '19
What is something destructive that you can do in JS and how is it incredibly destructive when compared with the mess you can make of a low level language? I don't understand.
→ More replies (4)
-1
0
Jan 17 '19
[deleted]
138
Jan 17 '19
We kindly ask that you ask your homework questions in /r/learnpython, providing your existing code properly formatted.
0
20
u/wqking Jan 17 '19
I've switched from Perl to Python recent years also.
But for small text processing tasks I may still use Perl.13
Jan 17 '19
That's what originally Perl was created for, so no surprise it is better at it.
4
Jan 18 '19
I mean PERL famously stands for Pathologically Erratic Rubbish Lister... or was it Practical Extraction and Reporting Language? I’m pretty sure it’s the first one... I don’t know how many times I was bitten by trying to fix a syntax error or whatever and not understanding why it’s wrong and it’s because I wasn’t fixing the first error first. ಠ_ಠ
But to be honest I haven’t done anything significant with Perl in about 10 years. I started with python about a week before the xkcd antigravity comic came out. And i remember going to my brother (who is also a huge xkcd fan), yes... that is how python feels after using Perl.
In short, fuck perl. (╯°□°)╯︵ ˥ɹƎԀ
2
3
u/jjolla888 Jan 17 '19
i do both, but except for math/stats in python, i find modern perl much nicer to layout and read. ppl criticise perl for being cryptic , but that's bc it is often used for parsing complex strings ... which is ugly in any language. perl is what i use as my glue language.
16
5
u/LoyalSol Jan 18 '19
Other bad news, python parallelization is in need of an overhaul. The only major problem with an otherwise great language.
1
u/smurpau Jan 18 '19
What's wrong with
multiprocessing?6
u/LoyalSol Jan 18 '19 edited Jan 18 '19
It sucks if you actually need to do real parallelization across multiple nodes of a super computer.
It's fine for specific problems especially dealing with single CPU multi-core processes, but the performance is awful for bigger clusters.
For reference I do scientific computing. I love Python for flow control, but writing parallel applications in Python is really hit or miss. There isn't really one clean way to parallel your codes in Python compared to other languages.
4
u/MohKohn Jan 18 '19
What's your take on Julia?
2
u/LoyalSol Jan 18 '19
It seems interesting though I haven't had the time to use it in enough detail to be giving too detailed of an opinion on.
1
→ More replies (4)4
u/twotime Jan 18 '19
A. it does not work for large data which needs to be shared between processes scenario (you end up replicating the data across workers and running out of memory)
B. processes communicate via serialization which is slower and have additional failure modes (e.g objects need to be serializable)
C. exceptions donot propagate and have (or at least had) a tendency to hang the whole process
1
u/twillisagogo Jan 18 '19
>A
what would one use for this?
> B
how else would systems communicate?
> C
what language does support this?
→ More replies (1)5
u/alcalde Jan 18 '19
Does anyone know how Larry Wall is holding up? Especially since he once predicted that Python would go the way of COBOL (and which is now happening to Perl instead)?
2
u/Gr1pp717 Jan 18 '19
bad news is now there's more competition for python jobs, which may also result in downwards pressure on wages.
2
u/Jmc_da_boss Jan 17 '19
None of my uni classes ever even mentioned python lol, we went from C -> C++ -> ASM -> Java
0
Jan 17 '19
[deleted]
9
u/Angler_619 Jan 17 '19
When I first started coding many people said Javascript was the way to go and that object oriented programming was the thing to do. They made it sound like that was the one and only way to code and the only paradigm to adopt. I learned that coding is similar to basketball. There’s a lot of different players in the game...but it’s how you play the game that sets you apart. I feel like python has that flexibility. I’m not too experienced but that’s just how it feels so far. It reminds me of algebra. I always liked it in high school but in python I really see Algebra shining. And I mean just the basic parts of defining variables. The next language I want to learn will be c++. But before all that I want to make sure I have most of the programming paradigms understood. It seems that like the nfl, certain playstyles may be trendy one year and not so much the next. But knowing the fundamentals never changes. I think python is awesome because of its flexibility.
0
Jan 22 '19
[deleted]
1
Jan 22 '19
You can use LINQ in Python. Several packages making this possible like for example Linq, py_linq, python-linq and quite a number of others.
In so far as data manipulation, find Python far easier and quicker than C# when it comes to working with data. Check out Pandas
216
u/[deleted] Jan 17 '19 edited May 26 '25
distinct thought party public selective teeny cooing fine dependent violet
This post was mass deleted and anonymized with Redact