I like #Python. It was the first programming language I tried, it had a reputation of being easy to learn and yeah, it was. What I don't really understand is how it has become so popular (# 1 in the TIOBE index...) and pervasive (you find it in areas where it seems like logic for a scripting language, but in others where you wouldn't bet for it too). It shines where it shines, but aren't really there better options in some of the niches it is being used for?
Yes, #Python may be easier to learn at first, but when things get complicated, you may want to add a bit more boilerplate in exchange for static typing, for example. And performance... Python doesn't seem very good at that, even compared with other scripting languages, not to mention compiled ones. Is Python really a "silver bullet" for everything? With alternatives waiting to be explored like say #Nim or #CrystalLang indulge me in having my doubts. :P
There is great momentum in a community that already knows a language and wants to *do work* with that. (i.e. that is not primarily programming, but merely *using* programming to achieve some other goal.)
So, those people will reach for what they already know, which in this case is #Python; and if it is good enough, then other niche special-purpose tools don't even get investigated.
A special property of Python is impressive support for so many use cases; people try it, it just works!
@bignose "Yeah, this treatment just works -in most cases, just take it with a grain of salt and fingers crossed. I may have heard about other treatments which more efficiently could treat your specific illness, but what are you asking from me, I'm just a doctor, and a lazy one I'll admit!" XD
Yeah, I can understand *why*. I'm just not sure that is the better option. ;)
That's what I tried to clarify though @array; in your analogy, the person is a doctor, expected to have a great deal of knowledge about medical treatments.
But these people I'm talking about, don't have "programmer" as their profession; they're scientists, or they're financial experts, or they're trying to run a training website, or a bunch of other things. #Python is not their profession, it's a tool in their job.
And it works well! But they don't need to be expert in all the others.
@bignose You're very right, and that's actually part of my point. You wouldn't expect a scientist or financial expert or someone trying to just "run a training website" to prescribe your medical treatments, but nobody wonders why they write code? Just saying, but *maybe* an actual programmer could come up with better solutions... ;)
I would also add that there is no right or wrong programming language. At the end you can solve every software engineering problem in any programming language which is turing complete.
And in practice you usually don't have a choice either, because of an existing code base etc. etc. - it's quite rare to start a new project from the scratch.
Also don't be afraid of mixing multiple languages within a single larger project.
@folkerschamel @bignose Fair enough. But still, SQL may be Turing complete, but I guess it may not be the best choice if you want to write an OS from scratch. Same with using, say, C in full-stack web dev. ;)
Yet you're right, personal projects apart, in an actual ${job} one likely don't get to choose. I just cross fingers for the choosing made before I jump in were not just a mess, as it happens. XD
"Best tool for the job" seems like good advice, including mix and match. Thanks! :D
"SQL may be Turing complete, but I guess it may not be the best choice if you want to write an OS from scratch" -> you and me must be careful, you may trigger me to try to proof the opposite!
But seriously, yes, I agree definitely, especially with "best tool for the job"
We originally used mainly #cpp. But when we started a complete new tool application and chose #python. And then, starting major web development, we chose #java. Three times where we could choose.
@folkerschamel @bignose Haha, just reading again what I wrote I thought, "a full OS in SQL seems so, uh, "challenging", that maybe someone already tried that". XD
In an ideal world everybody would count with very good engineers, reaching for the less bloated, better and funnier to write, best performant, safer, more efficient tools for the job. And etc. Now we just have to wait for someone to write those tools. XD
@folkerschamel @bignose (I just remembered now... My professor for Databases made a Goat Race Simulator in SQL and prompted us to do something similar. Because, you know, what DBMS could run without a Goat Race Simulator? XD)
@array From a package maintainer's standpoint Python is comparable to a C project with a poorly written makefile though. The ecosystem is full of old setup.py configs that either make packaging difficult and niche or make the users resign to pip altogether.
@tranzystorek_io External packages are always a bit... Complicated, no matter the ecosystem, I guess. I've used node, composer, Maven, pip and others, and there's always pros and cons. The main point stands, Python doesn't really seem to make a big difference here... But to be fair, it has achieved a very huge ecosystem. Including for use in niches where it wouldn't seem the best first option, though. ;)
@array There really is very little you need to go outside python for, so people don't.
Scripts? Check.
Well-factored applications? Check.
Static type-checking? These days, check.
It really is a wide range, and while it is not too performant, most of the time your code is waiting for I/O or a human. When performance is actually needed, heavy calculations go into pandas and numpy and on the other end things like protocol parsing go into gunicorn and starlette.
Python's got you covered. Best language for almost nothing, good enough language for almost everything. More boring than Ruby, less line noise than Perl.
@clacke Yeah, it's really pervasive. And very good at what's good, as I said, I like it too. It's just the point that you raise, "best language for almost nothing", that brings me some doubt. As in, why not just use "the best tool for the job", when there are arguably better options in some domains? Using Python for *everything* sounds just a bit... Lazy, I guess? :P
@array *shrug*
I know 20+ languages. My colleagues don't. Or if they do, not the same ones. Except Python.
@clacke That puts a different problem then. A complicated one. ;)
There's quite the possibility I'll end up writing Java, which has been/is its own Swiss Army knife. Is it more performant than Python? I think so. Has its own trade-offs? Hell yeah. I'm still refusing a bit the idea of silver bullets, but I think I'll just keep my questions open. ;)
@clacke then judging by events to date I must be brilliant at the latter, so far all my applications and tools remain used almost exclusively by just myself.
(FWIW I still like them and use them a lot)
@clacke This is why I always write my prototypes in Julia!
@array I see two reasons for that:
* in those niches, people are mostly non developers (I worked as the IT guy in an Astronomy Research Institute), so languages that are easy to grasp are a boon for them.
* in those same niches, sometimes it takes just a head of a department to chose a tool and the rest will follow.
@mdione Yeah, I get *why*, and I can see things are good enough as they are. I was just asking myself if they could be better, and asking myself if using domain specific and arguably better suited alternatives could contribute to improve things a bit. Not that I have an answer or really strong opinions, though; I ask because I want to learn, and really appreciate opinions from people with experience and knowledge, so thanks. :)
@array TBF, people in that research institute were not using Python, but one of them was, and at some point I gave a short course to some 4-6 more (I think the institute was around 20-40 people in total). I don't remember what were they using, probably FORTRAN.
@mdione There's quite a long way from using Fortran to Python (with maybe some C-or-Fortran-written libraries), that's for sure. ;)
@array well, the ones they most used (at least this guy, as I remember it; it was ~15ya) already had python wrappers to their libs, and he was enthusiast on learning Python, so...