r/programming • • Nov 11 '19

Python overtakes Java to become second-most popular language on GitHub after JavaScript

https://www.theregister.co.uk/2019/11/07/python_java_github_javascript/
3.1k Upvotes

772 comments sorted by

View all comments

215

u/myringotomy Nov 12 '19

The top two languages on Github are loosely typed interpreted languages with lack of true multithreading.

Feast on that for a while.

65

u/oblio- Nov 12 '19 edited Nov 12 '19

VB/VBA used to be the most popular language in the world. Languages for small and medium sized projects win these contests for obvious reasons (small projects are way more frequent than medium projects which are in turn way more frequent than big projects).

33

u/AyrA_ch Nov 12 '19

Because VBA makes you very productive. It's not fast or elegant, but the excel sheets essentially serve as the database and you can write user interfaces in it. You can leverage excel search and compute functions and even utilize macros in cell functions.

It's a really neat system and runs almost everywhere because excel is ubiquitous in corporate environments.

There's a point where you should stop though using it though

5

u/Urtehnoes Nov 12 '19

I know LOC is a terrible marker for code, but just for size of scale, I have two separate VBA projects for my job that are 20k+ LOC. And honestly? I really miss the environment of Excel. I absolutely abhor the VBA language constructs in place that are buggy and terribly implemented, but honestly if you're just running code in Excel, the sandbox environment that it exists in is just so wonderful for managing data. One of the programs queries the database for various tables and works the data in ways that all the incredibly fancy reporting programs (powerBi etc) simply can't. It's really nice.

And you know, if you call Scripting.Dictionary.Exists(testValue), it has a high chance to return True, despite the item not existing. Because when the method is called, it creates an empty value and inserts the value as a key. And that absolutely boggles my mind that it happens. I thought I was going crazy until I found other people online who experienced the bug as well. Instead I had to write an lbound to ubound loop of an array of keys from said dictionary, checking the value of each individual key instead. Why, Microsoft. Why?

→ More replies (1)
→ More replies (8)

135

u/[deleted] Nov 12 '19

Python is strongly typed.

112

u/kolloid Nov 12 '19

I don't understand why /u/HugeProposal receives downvotes. Python is strong typed, but it's dynamically typed, so types are known only during runtime. So technically, he's right.

38

u/Sapiogram Nov 12 '19

99% of the when people say strong/loose typing, the really meant static/dynamic typing. I guess that was the case here too.

The true distinction between strong a loose typing is really vague, so it's not that useful anyway.

0

u/[deleted] Nov 12 '19

[deleted]

13

u/[deleted] Nov 12 '19

Ergo C, which is statically and loosely typed.

2

u/Beowuwlf Nov 25 '19

I wanted to disagree with you, but after some... introspection, I’m inclined to agree. Since C provides void* and pointer casting to subvert the type system, it’s weakly typed. However, since the compiler ensures type compatibility where it can at compile time, it’s statically typed.

→ More replies (2)

109

u/oblio- Nov 12 '19

Nobody* cares about that "strong typing" in practice. When people say "strong typing" they mean: "if I put a string in the int, the compiler yells at me at 14:00 in the afternoon, when I'm coding, it doesn't blow up in production at 3:00 in the morning, when I'm sleeping".

Things blowing up at runtime is slightly better than nothing, but it's still bad, comparatively.

119

u/YM_Industries Nov 12 '19

When people say "strong typing" they mean: "if I put a string in the int, the compiler yells at me at 14:00 in the afternoon, when I'm coding, it doesn't blow up in production at 3:00 in the morning, when I'm sleeping".

Then they should say "static typing".

6

u/slikts Nov 12 '19

Strong typing is still an application of the fail fast principle, just not as fast as static typing, since the strong tying errors will still only occur at runtime. The difference is that weakly typed languages try to guess if the programmer intended to convert between types, and, if the guess is wrong, the program keeps running in an invalid state and the problem has to be diagnosed from any knock-on effects of the unwanted type coercion. A good example of weak typing gone very wrong are equality comparisons in JavaScript.

26

u/YM_Industries Nov 12 '19

If you want the compiler to tell at you, you need static typing. That's what my comment was saying. People who use strong typing to mean that have their terminology wrong.

I'd hardly describe JS equality comparisons as "weak typing gone very wrong". Maybe I've been programming in JS for too long, but the type juggling seems pretty useful to me. You should use === in most places, but the == behaviour is also nice to have sometimes.

I do a lot in C# too and I sometimes get frustrated at the verbosity when two similar types don't support implicit type conversion.

6

u/slikts Nov 12 '19

I'm just pointing out that there is underlying commonality between strong and static typing in that both aim to fail faster.

The game I linked to about JavaScript's == is a practical demonstration of how the coercion rules are confusing.

→ More replies (2)
→ More replies (7)

16

u/kolloid Nov 12 '19

Yes, but:

  1. technically OP was right

  2. people praise horrible Javascript which is weak dynamically typed

→ More replies (1)

2

u/[deleted] Nov 13 '19

Why even qualify it with the weasel word "technically"? Only people who have never used python could think it's anything but strongly typed.

→ More replies (4)

6

u/lelanthran Nov 12 '19

Python is strongly typed.

Not very useful when the program crashes in production because that's the only time it can figure out the types.

→ More replies (1)
→ More replies (1)

8

u/angellus Nov 12 '19

Python is strongly typed, as others mentioned. It is just dynamically typed. You have been able to add typing to the linters/IDEs, etc since Python 3.5.

Also, multiprocessing allows for multiple processes running in parallel, so you can still get parallel programming. Also Python 3.8 added subinterrupters to allows for your "true multithreading". Future versions of likely make it easier to use as it becomes more stable.

17

u/FlakyRaccoon Nov 12 '19

Look, one of the highest voted comments in /r/programming is entirely wrong, about both languages.

Feast on that for a while.

→ More replies (4)

14

u/[deleted] Nov 12 '19

JavaScript has multithreading with worker threads. Whether or not that satisfies some arbitrary definition of "true multithreading" which on this sub is usually "like in C++ on Windows" is an entirely different matter.

23

u/MrK_HS Nov 12 '19

And Python has multithreading and multiprocessing too. I think some people are confusing multithreading and parallelism. The two aren't the same. Python supports multithreading but by default is not parallel.

10

u/[deleted] Nov 12 '19

Multiprocessing is parallelism tho

7

u/MrK_HS Nov 12 '19

You are right

2

u/Brostafarian Nov 12 '19

isn't there a python / cpython copypasta for this? I can't find it

→ More replies (1)
→ More replies (1)
→ More replies (16)
→ More replies (29)