IEEE Spectrum Declares Python The #1 Programming Language (ieee.org) 372
An anonymous reader quotes IEEE Spectrum's annual report on the top programming languages:
As with all attempts to rank the usage of different languages, we have to rely on various proxies for popularity. In our case, this means having data journalist Nick Diakopoulos mine and combine 12 metrics from 10 carefully chosen online sources to rank 48 languages. But where we really differ from other rankings is that our interactive allows you choose how those metrics are weighted when they are combined, letting you personalize the rankings to your needs. We have a few preset weightings -- a default setting that's designed with the typical Spectrum reader in mind, as well as settings that emphasize emerging languages, what employers are looking for, and what's hot in open source...
Python has continued its upward trajectory from last year and jumped two places to the No. 1 slot, though the top four -- Python, C, Java, and C++ -- all remain very close in popularity. Indeed, in Diakopoulos's analysis of what the underlying metrics have to say about the languages currently in demand by recruiting companies, C comes out ahead of Python by a good margin... Ruby has fallen all the way down to 12th position, but in doing so it has given Apple's Swift the chance to join Google's Go in the Top Ten... Outside the Top Ten, Apple's Objective-C mirrors the ascent of Swift, dropping down to 26th place. However, for the second year in a row, no new languages have entered the rankings. We seem to have entered a period of consolidation in coding as programmers digest the tools created to cater to the explosion of cloud, mobile, and big data applications.
"Speaking of stabilized programming tools and languages," the article concludes, "it's worth noting Fortran's continued presence right in the middle of the rankings (sitting still in 28th place), along with Lisp in 35th place and Cobol hanging in at 40th."
Python has continued its upward trajectory from last year and jumped two places to the No. 1 slot, though the top four -- Python, C, Java, and C++ -- all remain very close in popularity. Indeed, in Diakopoulos's analysis of what the underlying metrics have to say about the languages currently in demand by recruiting companies, C comes out ahead of Python by a good margin... Ruby has fallen all the way down to 12th position, but in doing so it has given Apple's Swift the chance to join Google's Go in the Top Ten... Outside the Top Ten, Apple's Objective-C mirrors the ascent of Swift, dropping down to 26th place. However, for the second year in a row, no new languages have entered the rankings. We seem to have entered a period of consolidation in coding as programmers digest the tools created to cater to the explosion of cloud, mobile, and big data applications.
"Speaking of stabilized programming tools and languages," the article concludes, "it's worth noting Fortran's continued presence right in the middle of the rankings (sitting still in 28th place), along with Lisp in 35th place and Cobol hanging in at 40th."
Lingua Franca (Score:5, Insightful)
Python has hit critical mass in both popularity and tools available. C, C++, Java, Perl and anything else the average /.er is going to complain about going anywhere just like FORTRAN and COLBOL haven't.
XKCD [xkcd.com] hit the nail on the head. It's something easy enough for middle schoolers to grock and powerful enough to use with TensorFlow. It's our office's go-to language for "I need this task done". It's basically BASIC where you can import math (numpy), plotting (matplotlib), neuralnetwork (TensorFlow) and other packages.
Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.".
You can knock out something in 30 minutes in Python that would take longer in anything else and the performance difference isn't worth doing it in something else.
Re: Lingua Franca (Score:5, Insightful)
You can knock out something in 30 minutes in Python that would take longer in anything else and the performance difference isn't worth doing it in something else.
In reality this could be said of most scripting languages, including PHP, JavaScript, Bash, etc.
Re: Lingua Franca (Score:4, Interesting)
And until I hopped over to Python I did use PHP as that when I wanted something a bit better than Bash.
But PHP, JavaScript and Bash aren't as easy to install on Windows. They certainly don't have the number of packages available.
"How to ____ in Python" will turn up results for almost anything. I would be interested in seeing a CUDA backed neural network in Bash.
Re: Lingua Franca (Score:2)
I still prefer PHP for quick and dirty. If I need it reliable I generally use bash.
I don't use Windows, so I guess there's that. :-)
Re: (Score:2, Interesting)
Did you even try to install NodeJS on Windows? Click click done. And npm happens to have the biggest number of packages of all package managers. And yes, it includes packages to do a CUDA backed neural network. As if anyone who has meaningful volumes of data to process in a neural net would use Python or JavaScript anyways.
Don't Bash things you don't know (pun intended).
Re: (Score:2)
Did you even try to install NodeJS on Windows?
Have they fixed the fact that NPM dies when running into MAX_PATH on Windows?
Re: (Score:2)
Dunno, never ran into that (alleged) problem.
But just a quick look at your username and it's immediately obvious that typing long strings is something you enjoy, so I could see how someone like you would stumble upon edge cases like hitting a MAX_PATH limit.
Re: (Score:3)
Re: (Score:2)
Did you even try to install NodeJS on Windows? Click click done. And npm happens to have the biggest number of packages of all package managers. And yes, it includes packages to do a CUDA backed neural network. As if anyone who has meaningful volumes of data to process in a neural net would use Python or JavaScript anyways.
Don't Bash things you don't know (pun intended).
This is 2017 and you can virtualize if your employer sticks you with Windows or you want to do things without breaking your Linux host OS as not all of us are neckbeared sys administrators who know init.
Windows 10 pro even comes with hyper-V! It beats the snot out of VMWare Workstation as hyper-V is a type one hypervisor so no extra license needed. There is KMS for free for Linux loyalists that is type 1 as well and ssds and quad core CPUs galore in 2017.
Windows does suck outside of python and .NET which is
Re: (Score:2)
Those two examples are apples and oranges. You're the one adding needless stuff.
Why don't you try again without the exception management and without using the "fs" variable? And if you want to have similar code you'd have to use the sync version of readFile and this becomes a one-liner.
Re: (Score:2)
Only partly true. Python does so many things right that languages Perl or Bash are just ugly in comparison, and are thus often slower to write medium-sized programs. And PHP and Javascript have limited applications ouside the web.
Re: (Score:2)
Re: (Score:2)
It is also very nice as glue-code, as it has a pretty good interface for embedding C code.
Re: (Score:2)
But if you're building your business on it,
You can't and you won't.
Unless you don't drive a car and don't fly. dSpace [dspace.com] is one of the few Hardware In The Loop vendors. Good chance something you rode in, flew in, or built the road you're driving on was tested on it. Scripted in Python (2.7, but that's an improvement from what was 2.5).
They are migrating to a .NET API that you can access though Python.NET.
any significant scale
I think most developers don't understand how many niche industries there are out there. If Caterpillar sells 100 of it's largest mining truck in a yea
Re: (Score:2)
You mean like docker or yum?
Re: (Score:2)
It's depressing that so called 'programmers' lose their mind at different syntax. I can stomp my feet and pout at Spanish vs English word order but if I want to communicate in either I just suck it up and deal with it.
Re: (Score:2)
Relevance? (Score:2)
Python is a nice language. So are C,C++,C#,Swift,PHP,Powershell,Java,JavaScript,Typescript, etc... heck I even like COBOL. But what is the relevance of rating what the most used language?
I think programming methodology is more interesting. Is purely functional, MVVM, object oriented, structural, etc... the best.
What are they? (Score:4, Insightful)
combine 12 metrics from 10 carefully chosen online sources to rank 48 languages
What metrics are they and which online sources were used? If you're going to make such an assertion then why not explain or link to the details?
To me, it sure sounds like a list of the most problematic languages combined with the number of people who use them.
Re: (Score:2)
To me, it sure sounds like a list of the most problematic languages combined with the number of people who use them.
Exactly. That's like saying: GM cars are the most popular because you can find a lot of GM spare parts in junkyards.
Perl (Score:5, Insightful)
Re: (Score:2)
AT least Python has PCRE. Even if the interface is not nearly as nice as in Perl. One of my few gripes with Python.
Re: (Score:2)
Perl was all the rage in the 90s. Then we had Ruby and now Python. In five years some other language is going to be hot.
Re: (Score:2)
I /really/ like Perl. It was the first scripting language I ever learned.
I still use perl on a daily basis. From web interfaces to batch data processing to realtime hardware data collection (using good old RS485 busses).
The RS485 control part even has multi-threading, as well as converting https Server Side Events to RS485 data streams.
One of the best programs I ever wrote :)
Understood (Score:4, Insightful)
tldr; Python is a great language with one huge fucking hole. When tabs vs spaces change the way a program runs, something is wrong. Yeah, I know you can tell your editor to change tabs to some random spaces, but still.
When I find code for SomethingIReallyWouldLike, and it Doesn'tFuckingWork, and I find out FuckwitUsed2CharacterTabs, then something is broken. Broken hard. Broken bad.
Re: (Score:2)
using spaces for block definition is brain dead
It is. Just the fact that there's a keyword (pass) that does nothing except prevent the indentation from falling apart says it all.
However there's many things that are even more retarded in Python:
- package management
- text encoding
- the whole import thing which makes it impossible to use sibling modules without dirty hacks
- mutable default arguments
- the abuse of underscore, such as the lovely __main__
- the "ternary operator", which is basically a drunk if statement
I think at this point PHP have got their
Re: Understood (Score:3)
Re: (Score:2)
Very much this. A competent coder understands that tabs are not defined the same everywhere and just cause problems, and hence just disables them in the editor used. It is also extremely easy to replace them with proper spaces if you know how wide they are supposed to be in a piece of code.
Anybody that really has a problem with this should not be let near program code as they are just incompetent.
Re: (Score:3)
Yes .... The idiot who used tabs is broken. Python allows tabs, it doesn't encourage it. Competent programmers don't use tabs unless they are writing a makefile.
I disagree. If one action in a language is always idiotic then it is not the idiot who is at fault, but the language. C lets you run over the end of an array which is awful, but the counterpoint is that it's faster to not do the checks so it ultimately allows a very skilled programmer to write more efficient code. There's a tradeoff .
What's the tra
Re: (Score:3)
MathWorks should be concerned (Score:3)
I know a few EE faculty who have moved from using Matlab to using Python. Some of the grad students think the department should take a more active role in encouraging students to do the same - or to eliminate Matlab from courses entirely.
Re: (Score:3)
Simulink Embedded Coder. (There's a reason they won't put it on the cheap home use license).
Mathworks is going to be fine.
Re: (Score:2)
Octave replaces Matlab, and scilab/xcos is a simulink replacement.
http://www.scilab.org/scilab/g... [scilab.org]
Re: (Score:2)
What hardware support does it have?
I have yet to see a job opening for model based design using scilab/xcos embedded design.
kind of a silly comparison (Score:2)
node.js: 304
Spring: 180
Rails: 172
ASP.NET: 111
django: 80
In that particular context Python is more-or-less last place. Thing is, Python is used for plenty more than just web application back-ends. Much like Java. But there's a big difference from
Re: (Score:2)
Yeah, but then we wouldn't be having a clickbait discussion.
Never! (Score:3)
My religion asks me to use C.
When I'll reach the enlightenment, then I'll move to assembler.
#1 in POPULARITY (Score:4, Insightful)
"Popular" != "Best"
Also, one should choose the right language for the task. The right language for a small office task is not usually the right language for a scalable microservice. E.g., Google discovered long ago that if an app written in Ruby or Python requires 100 servers to meet demand, but the same app written in C++ or Go requires only ten servers, then there is a substantial cost difference. (Although Go is quite terrible for maintainability - do a Google search for "Go gotchas".)
Ignore popularity. Make your own choices.
Re:I tried Python (Score:5, Insightful)
After using it, it is eh, not a big deal. You indent the same amount for everything in the block, which you are probably doing most of the time anyways. It is their little cheat around not having block delimiters.
If you need to a pick a reason to not like Python, this is not it.
Re: (Score:2, Insightful)
But it causes confusion when cut and pasting. You cannot audo-indent like you can in a { } bounded language, because there is no semantic information from the syntax, only from the spacing.
Re: (Score:2)
Re: (Score:2)
Apart from the fact that Python is used FAR MORE than Lisp is.
Re: I tried Python (Score:2)
Re: (Score:2)
Get an editor that can indent and un-indent blocks and you are fine.
Re: I tried Python (Score:2)
Re: (Score:3)
I love Python. It's this generation's perl: Ubiquitous installation on nix systems, and plenty of libraries, and even easier to learn.
BUT whitespace significance does cause issues with reformatting code, or managing long lines (I know you can) and in general, I kind of (kind of) wish it had a scope delimiter.
Re:I tried Python (Score:5, Informative)
Semantic whitespace isn't a terrible idea, but like almost everything in Python it's let down by the implementation. Tabs are a variable-width character, spaces are not. Mixing the two in an environment that treats the amount of whitespace as having semantic importance is a recipe for disaster. Python treats a tab as a fixed number of spaces and so the indent that your editor displays is not necessarily the same as what the interpreter picks (I've had to fix a bug in someone else's Python resulting from this[1]). The only sane thing to do is for the interpreter to reject any inputs that mix tabs and spaces at the start of a line as invalid input. I believe that Python now has an option to do that, but it took 20 years to add and it's still an option. This pretty much sums up Python: the obviously sane thing takes 20 years to add to the language and is then optional.
That said, it doesn't bother me nearly as much as a language claiming to support functional programming but not doing tail-call optimisation (1000 recursive calls and your program dies) or else clauses on while loops (another bug in someone else's code that I had to fix was caused by the fact that there are two plausibly sane meanings for this. Python chose the third and the developer assumed they chose one of the others).
[1] My irrational hatred of Python is largely caused by the fact that every time I am given the release version of a Python program I end up finding a bug that I have to fix before I can use it for its intended purpose. No other language manages to be quite this reliable in allowing people to ship completely broken crap that they believe to be working.
Re: (Score:3)
With a good code editor you can configure display of whitespace characters. I usually have tab characters visible, tho only a slight shade lighter than the background color, even when using C#, as it shows the outline of the code blocks that way.
Personally I don't recall having problems using tabs in my code, when copying and pasting etc, and it is a few years now since I last coded in Python, but I didn't have much of a problem with it then.
Re: (Score:2)
Indeed. It does take a bit to get used to, but not excessively so and I do like that it makes code compacter vertically.
Re: (Score:3)
It's basically DLL hell all over again, where some application/script needs a certain version of a library, which requires a certain version of Python, and you have another application/script that needs a newer version of Python which that library won't work with, and needs a certain version of some other library, which breaks some of application/script, and so on. If you're on Windows then you may also run into 32bit/64bit issues (like for example, if you want to use Python in Matlab, then you need 64-bit
Easy to read code (Score:2, Insightful)
The number of spaces preceding a statement determines the scope of that statement? Wow. That seems totally nonsensical to me.
Any more than the presence of a curly bracket 42 lines earlier determines the scope of a statement in C++? I agree it seems strange at first but it is actually really easy to adapt to and by forcing correct indentation it actually makes code easier to read.
Re: (Score:2)
where should be the next line indentation be? C++ allows You to unambiguously decide that
You got that entirely the wrong way round. C++ is utterly ambiguous with the indentation - you can make it anything you want it to be. It's python where the indentation is entirely non-ambiguous. If the indentation is the same as the line above the statement is in the if statement. If it is less then it is in the loop. Most auto-indenters will start with the indentation the same and all you have to do is press delete once so if you are really pedantic enough to worry about key presses it's marginally easie
Re: (Score:2)
You focusing on a cosmetic detail? Wow, that means you really had an in-dept look and give a qualified opinion!
If you cannot deal with such a minor quirk (and yes, it is somewhat quirky), then you should probably stay away from coding altogether.
Re: (Score:2)
The number of spaces preceding a statement determines the scope of that statement? Wow. That seems totally nonsensical to me.
And there's absolutely no reason for it except hubris by the language designer.
Re: (Score:2)
Also, I never used it but RPG might have been actually dangerous for you.
Only if you're low on HP. Or if you pick the wrong Datacenter Master.
Re: (Score:2)
Oh god, Cobol had that sort of thing as well. First job, back in the early 90s maintaining shitty old mainframe cobol on a Vax. Various positions in the line had different meanings,such as line numbwea, labels, etc and depending on which section of the code you are in (storage division, procedure division, i/o sections e
Re: (Score:3, Interesting)
Re:I tried Python (Score:4, Insightful)
These surveys are strictly for idiots. For example (to use one of the data sources in the article), information drawn from what recruiting companies say they are looking for are complete garbage, as anyone who has spent much time here knows. Some recruiters are just trolling for new applicants to add to their slushpile, some are adding stuff that's totally irrelevant to the underlying job so that their candidate will look more well-rounded, some are bogus posts to supply HR with practice interviews, some are just posted as a way to be able to say "we looked for expertise in x and y before we hired an H1B (who doesn't know x or y, but it's rarely investigated) ".10 years experience in Java 9 or Windows 10? 5 years experience with Red Hat linux 7.3? We've all seen these shit listings, the same as we've seen the same job suddenly pop up from a dozen different recruiters. It doesn't mean they're looking for 12 people with that experience.
GIGO still applies.
It still is relevant. As much as WE HATE HR they are the gatekeepers. Actually they are nto the gatekeepers. Taleo is the gatekeeper and SEO in LinkedIn and abunch of software programs are. They do the work so companies can be lazy and not have to do their job.
If you do not have that experience you will not be interviewed. That is a fact as your score will be below X and the application will be rejected and HR won't even know you applied.
Part of the problem isn't that they are bogus. It just that HR is incompetent and fall for the salespeople in Taleo who tell them software picks candidates for YOU, not it is there to assist you. Scenario one you need a SAP jr financial analyst assistant who can run reports?
They ask the IT manager and finance manager. IT manager says yeah it uses SQL Server on the backend etc ... BOOM 5 years of SQL Server administration is now required. HR wants to make sure you know office ... BOOM 5 years Excel macro programming experience required. Now add a shitty HR filter app like Taleo and it generates a job description:
-5 years SQL Server administration experience
-3 to 5 years of Excel financial analysis programming in VBA
- 3 to 5 years of actually doing SAP reports (part of the job that is important)
- Mentions $15/hr because that is net worth of a college kid in accounting as it is a JR. level assistant.
Taleo reports none are q ualified. CEO lobbies senator. They important an Indian H1B1 visa who meets these requirements as no American can do the job and whines how could this happen? etc.
So my guess is some positions do prototyping in python. The HR software now requires 5 years of python coding and you get filtered out if you do not have it even if the position is really a java developer etc.
Anyway done with rant :-)
Re: (Score:2)
Re: (Score:3)
What does any of that have to do with the fact that the survey is based on bullshit data because recruiters lie?
It's not that recruiters lie Barbara. I believe what it is that Python is used heavily for prototyping and scripting even if it is not part of the main job. When they hear a term that means "+5 years experience" as a requirement. Many are very serious about a lack of qualified applicants and are not making it up for fake job postings.
So if let's say one job requires Python then it is counted. Then another job required java but also some prototyping in python then the survey counts it twice. For sysadmins it
Re: (Score:3)
Even for educated adults, intuition is does not necessarily correspond to anything useful.
A body in motion at a constant velocity will remain in motion in a straight line unless acted upon by an outside force is not intuitive to most people. Yet it is an undeniable fact and man would not have gone to the moon ignoring it.
Re:I tried Python (Score:5, Informative)
Re:Ugh. (Score:4, Insightful)
* It's a scripting language.
And Michaelangelo just had a brush.
Lets compete to complete the average task in most offices. You do it in Assembly, I'll do it in Python and we'll see who is done first and gets the most work done in a year.
It's a massive leg up from VBA and just Excel equations while being as easy as BASIC to learn.
Re: (Score:2)
It's a massive leg up from VBA
Not sure about that. VBA has switch statements (case). Python has "if'.
Re: (Score:2)
Re: (Score:2)
No. Just plain no.
The switch statement is a valid construct present in many languages that also have first class functions (such as JavaScript or PHP). And if you think that functions are a less clunky way of doing something that in other languages can be done with a switch, I can only hope I'll never have to maintain your code.
Re: (Score:2)
What does this do that Java does not? (Score:2)
What does Python do for you that Java does not do better?
Java is the new COBOL? No, Java is the new Turbo Pascal. Yes, it is compiled, but it is incrementally compiled inside Eclipse or NetBeans so the compile step is nearly instantaneous. You say C++ IDEs point out your errors, but you have to run a time-consuming compile step to see all of your errors -- not so with Java.
Java is the new statically-typed bondage-and-discipline language like Pascal? No, Java has Reflection. You can call any method
Re:What does this do that Java does not? (Score:5, Insightful)
Not be owned by Oracle.
Re: (Score:2)
Java is the new statically-typed bondage-and-discipline language like Pascal? No, Java has Reflection.
Pascal has reflection [embarcadero.com] as well.
Re: (Score:2)
Beyond that, Java has proper Garbage Collection rather than reference-counted garbage
Neither the Python nor Java language defines a GC algorithm, ref-counting or otherwise, and different implementations of each use different GC methods. PyPy, for instance (which is the Python JIT implementation that most people who care about performance use) has no ref counting but uses an incremental hybrid mark-sweep GC.
Even the CPython implementation, which does use ref-counting, combines it with a generational GC to d
Re:What does this do that Java does not? (Score:4, Insightful)
He is talking about junk languages like C++, which can only handle crude reference counting.
Nope. There have been "proper" GC solutions for C++ for ages, like the Bohem collector which do work. You can also write GC in C++: I watch a talk (Herb Sutter?) on writing a GC smart pointer type. So if you really really need GC, you can have it.
OTHO it's rarely necessary because C++ produces very little garbage. About the only situation poorly handled by smart pointers is mutable general graphs. I've never actually had cause to use one of those.
Re: (Score:3)
What does Python do for you that Java does not do better?
Obviously all the things Java does not have:
o dynamic typing
o modules/functions
o string template expansion with dictionaries
Should I go on?
statically-typed bondage-and-discipline language like Pascal? No, Java has Reflection ....
What is that supposed to mean? Reflection has nothing to do with static typed or not
Re: (Score:2)
* It's a scripting language.
And Michaelangelo just had a brush.
Lets compete to complete the average task in most offices. You do it in Assembly, I'll do it in Python and we'll see who is done first and gets the most work done in a year.
It's a massive leg up from VBA and just Excel equations while being as easy as BASIC to learn.
Kind of off-topic. Most offices don't have a bullpen of programmers. Selection bias much?
Re: (Score:2)
Most offices don't have a bullpen of programmers.
Many offices have people writing Excel macros, Quickbooks plug-ins, VBA scripts, and web forms. That is programming, even if programming isn't their main job.
Python has a gentle learning curve. It is a good language for beginners.
Re: (Score:2)
Many is not most. And in this study, they're classifying HTML as a programming language. Seriously (yes, I read the article. Yes, I know it's bad form on slashdot). The study kind of sucks, same as all such studies. Have you ever seen a valid one?
Re: (Score:2)
Your post and your signature are classic gatekeeping.
Re: (Score:2)
I don't understand how so many Slashdotters don't see that there is 'programming' outside of doing programming full time. It's like claiming that casual phone gamers don't count as gamers.
My boss and his boss's boss don't care how I get a job done as long as it gets done. Sometimes it was as simple as removing duplicate lines from an excel file. I've worked with people that did it by hand. We had a set of VBA scripts to do 1 & 2D linear interpolation because we did it a lot.
Some of our engineering apps
Re: (Score:2)
Most offices don't have a bullpen of programmers.
Ding ding ding. You get it. We don't have a bullpen of programmers to throw at every problem and develop a program in C. We have Mechanical, Electrical, Industrial, Aerospace engineers that know engineering and maybe VBA, probably Matlab and now more often than not Python.
We have Marketing, HR, and PR majors that are given a task that they're doing over and over again and knocking out a script to automate some TPS reports that used to take them a day to generate. Aggregating data from some excel spreadsheet
Re: (Score:3)
It's not the language, it's the coder.
I am reminded that Wozniak used to hand-assemble his assembly code. And he would still have coded circles around you.
Re: (Score:2)
Current task from the boss: Classify these engineering plots using neural networks.
I bought myself a head start with TensorFlow. How portable is your code going to be?
Coding and programming is a means to an end for most professions. The farmer that fixes his tractor isn't a mechanic. Doesn't make his money being a mechanic and just knows how to fix tractors because it is a tool they use to get what they're really after.
No doubt Woz could code circles around me for what he was coding for. That's not why I or
Re: (Score:2)
No doubt Woz could code circles around me for what he was coding for. That's not why I or any of my peers write code. It's a tool to get a job done and move on to the next job.
Woz would get done and move on to the next job faster than you in any language.
Re: (Score:2)
I bought myself a head start with TensorFlow. How portable is your code going to be?
btw of course assembly isn't portable. That is definitely an advantage of Python.
Re: Ugh. (Score:2)
Re: (Score:2)
A misspelling on the LHS of an '=' operator goes unnoticed?
That's exactly why it's best to put values on the LHS when you do a compare in Python; it catches bad variables as well as using = instead of ==.
Of course if it's two variables then it's not as bullet proof but it's still a good approach.
Re: (Score:2)
Re: Ugh. (Score:2)
Re: (Score:3)
Scripting languages are:
1. Interpreted
"Interpreted" is not a language feature, it's an implementation detail. There are C interpreters like EiC (and even assembly interpreters used in things like Bochs) and Python JIT compilers like PyPy.
2. Run directly from source
Even CPython compiles to bytecode, which is a tad more efficient that running directly from source.
Re: (Score:3)
Why use what is essentially a giant abstraction layer for another language?
Eric Raymond’s 17 Unix Rules covers this:
Rule of Generation
Developers should avoid writing code by hand and instead write abstract high-level programs that generate code. This rule aims to reduce human errors and save time.
Rule of Economy
Developers should value developer time over machine time, because machine cycles today are relatively inexpensive compared to prices in the 1970s. This rule aims to reduce development costs of projects.
Rule of Optimization
Developers should prototype software before po
Re:What is the interpreter written in? (Score:5, Informative)
There are no Python to machine code compilers out there.
Interestingly, you are incorrect. There is one: PyPy. It's Python written in Python. And it's fast!
http://pypy.org/ [pypy.org]
Re: (Score:2)
I keep seeing these articles that proudly proclaim some shiny language as being #1, and the interpreter (or a large amount of the support libraries) are inevitably written in C or C++
...unless the language is Common Lisp, Chez Scheme, Pharo/Squeak, or any other mature environment that is written in itself? Well of course CPython is a joke, but let's not generalize unfairly. Not everyone made the big C mistake.
Re:What is the interpreter written in? (Score:5, Informative)
Even the Python folks tell you to write your high performance code in C or C++.
True, but one of the smartest things Guido van Rossum did early on was to make it easy to interface C and C++ code to Python. It's why SciPy is winning so big in the sciences; it's the convenience of Python with the performance of Fortran. The libraries that do the work for SciPy are old numerical libraries that are very well optimized, very well debugged, very well understood, and very very useful. So, you can work in Fortran... or you can work in Python, enjoying the much friendlier interpreted language, and barely give up any performance vs. the pure Fortran. The hard work is done in Fortran, and the overhead of using Python to set up your calculations is trivial compared to the work of the calculations themselves.
https://www.scipy.org/ [scipy.org]
Python also provides a "lab notebook" environment through the Jupyter project. Nobody is going to try to use Fortran or C directly in the notebook.
http://jupyter.org/ [jupyter.org]
https://www.datacamp.com/community/tutorials/tutorial-jupyter-notebook [datacamp.com]
And pretty much every library you might want to use has already been glued into Python by someone. Computer vision? Running code on a GPU? Signal processing? Solving equations? Whatever you need to do, you can do it conveniently in Python and it will be fast.
So yeah, if you write your own matrix multiply in pure Python it will be roughly 50x slower than compiled C. But nobody does that, and in the real world Python is fast enough to do real work.
Re: (Score:3)
> the interpreter (or a large amount of the support libraries) are inevitably written in C or C++.
Whether a language bootstraps itself is super important when choosing a language for a project. /s
"Well, gee boss. I realize you want us to build a web API for this internal data, and yeah we have this team of node developers, but JAVASCRIPT ISN'T SELF-BOOTSTRAPPING!!!! We must do it in C."
> essentially a giant abstraction layer for another language?
All computer languages are giant abstraction layers for
Re: (Score:2)
Python fails because it's bitch to import code from SomeUnknownD00d into yours, hoping SUD was kind enough to convert tabs to spaces. And to logical spaces. If my code has tabstops of 4, and SUD has tabstops of 2, all bets are off.
Re: (Score:2)
Python fails because it's bitch to import code from SomeUnknownD00d into yours, hoping SUD was kind enough to convert tabs to spaces. And to logical spaces. If my code has tabstops of 4, and SUD has tabstops of 2, all bets are off.
This is wrong. SomeUnknownD00d can use whatever tab stop and mix of spaces/tabs that he wants and you can import from your code no problem, even if your tab stop is different or you use all spaces or whatever. Spacing only has to be consistent within a single block, there's no i
Re: (Score:2)
Sure, if you're writing printer drivers it's probably not for you, but for people who have to solve business problems, not technology problems, it's a good tool that allow them to do their job quickly. There's plenty of high quality math packages and it's one of the languages that is the easiest to use for database access.
Re: (Score:2)
1. It does not catch entire classes of problems that compile time checked languages do. 2. It is dynamically typed.
What I've actually noticed is that different classes of languages catch different entire classes of problems, not that one class of languages avoids one or more classes of problems while not introducing no other problems relative to some other class of languages. So it's always a trade-off with respect to what problems you perceive as the most painful and for what other problems you're willing to trade them. There's no programming environment at the moment that is superior at absolutely everything. For some
Re: (Score:2)
That comment just shows you have no clue. Statically typed languages are not superior to dynamically typed ones ones. Statically typed is a bit better for beginners, but then it stands in your way. Static type safety is just an older hype from the "lets make a language that any moron can code in" crowd, and it basically never delivered on most of its promises.
Re: (Score:2)
Kind of tells you whether you should use it now. And kind of makes checking all the fantastic statements made by the fanbois pretty hard. (Not that it is unclear that most are alternate facts....)
Re: (Score:2)
You probably have not looked right. There are basically no "C coder" jobs, but there are a lot of "expert in xyz and can also code c". Jobs that primarily ask for coding skills in one language are just for code-monkeys that will go unemployed in the not-too-distant future when the next hype comes along.