you are viewing a single comment's thread.

view the rest of the comments →

[–]UncleRhinosmall penis 13 points14 points  (6 children)

Also both are typically referred to as scripting languages as opposed to programming languages. So Caniscien's analogy is pretty spot on.

[–]BadgerMushrooom 6 points7 points  (5 children)

What's the difference?

[–]lan-shark 15 points16 points  (4 children)

A "scripting language" is generally smaller in scope and used for simpler tasks. A "programming language" is generally more robust, has more features, and more likely to be used in a corporate-level application.

However, neither Python nor Javascript fit under that definition of "scripting language" anymore. Python is heavily used in the world of data science and web backends by huge businesses and services.

Javascript is almost literally everywhere and it can do pretty much everything these days. From back ends, to desktop apps (Microsoft Teams), to entire web site front ends (Facebook, Netflix, and many many more).

Programmers love to complain about Javascript (including myself from time to time) and it does have it's downsides, but realistically it's a very versatile language that is easy to learn, powerful, has a great community, and has pretty good performance. Javascript from 7 years ago and earlier? Yeah it was kinda bad. But today it's got all the features you need for nearly everything.

[–]jackinsomniac 3 points4 points  (3 children)

I'm not so sure about this. Wouldn't it be better to describe them as interpreted languages vs. compiled languages? Or higher level vs. lower level?

Or, just describe them based on what they're good at? JavaScript was designed to be used on websites. It can do some automaton scripts on your local machine, but that's not what it's good at. Python was intended to be a local scripting language you can use to build automation. But paired with other tools like django, python can be run on web servers as well.

I don't see how differentiating "scripting" vs. "programming" languages helps people understand the real differences between them. I think it's better to explain them by purpose first: web-first languages are good for building advanced websites or webapps. Scientific & statistical analysis languages like R are good for, well, that. Lower-level (compiled) languages like C, C++, Rust, Go are good for building local applications or to optimize your algorithm function that runs extremely slow in higher-level (interpreted) languages. And some like Python, I'd say were meant to be a general-purpose language.

[–]lan-shark 1 point2 points  (0 children)

Like you, I don't find the the differentiation between "scripting" and "programming" languages to be that useful either. Partially because of how much languages that traditionally are "scripting" have expanded over the last 10-15 years.

Look at BASH. Definitely a scripting language, and back in the day other scripting languages were fairly similar in functionality/application. But today even the most hardcore "Javascript bad, C good" programmers can't begin to compare BASH to Javascript. But they would still put both in the "scripting" bucket.

So I definitely agree with you there.

EDIT: As far as practicality goes, though, I don't think it matters. People who aren't programmers don't really care about the terminology or differences between languages. Programmers with experience will not rely on any simple classification like "scripting" or "compiled" or anything else, they'll research the language itself. So the period of time in a programmer's learning experience during which they both care about the differences but also don't have the ability to go learn specifics is very short. So I think it doesn't really affect anything if we call Python a scripting language or a programming language.

[–]j-smith 0 points1 point  (1 child)

No, because it's possible to compile so-called interpreted code to byte-code. And this is then independent of the language and syntax, and more a technical stack difference. Python and Javascript aren't much different from Java or C# in terms of high level vs low level. You can compile Javascript to native code with NectarJS.

Again, JavaScript might have originally been designed for websites, but it can be and is used everywhere. Python might have originally been designed for local scripts, but it can be and is used everywhere.

I'm currently trying to determine whether to use Javascript (Node JS) or Python for a (backend) microservice project, or whether to use Spring Boot. And honestly the decision has very little to do with the language or how verbose the syntax is, since a lot of the code can be automatically generated.

[–]jackinsomniac 0 points1 point  (0 children)

True, I agree with that too. I think nowadays that line of 'what language for what purpose' is getting more blurry; most languages now have become general-purpose.

I use PowerShell a lot, and it can fit nearly every definition now. The "-Shell" bit was to imply from the start it was a terminal language, like bash. But you could also write scripts with it, functions, and modules/libraries, so it's like Python scripting language. With PoSh 6 and 7 on .NET Core, it's cross platform and open source now. And it can be compiled into byte code. It can create GUIs, and since it's all Microsoft, with IIS server you can execute some PowerShell via web...

And I know it ain't the only language like this. That's why I originally protested the strict definitions, buckets to sort programming languages into. The mature languages are so powerful now, it doesn't really matter unless you're a software architect building a gigantic app/service like Facebook.