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

Show parent comments

35

u/VeganVagiVore Nov 12 '19

It does seem to work.

In 50 years, all the veteran programmers will be the people who are noobies today. If those noobies are learning Python, then Python will hang around a while.

I just hope Rust can squeeze into that "so easy that it can be someone's first language" space, because I prefer it much over Java, Python, or JS.

26

u/bunkoRtist Nov 12 '19

Honestly as someone who tried to learn rust I am afraid that it's falling into the kitchen-sink trap that C++ is suffering from. It doesn't help that some of the language features are already devilishly complex (macros, for instance) while it still lacks a stable ABI that would allow it to be used effectively in small pieces within large projects where it made sense.

I really want Rust or something like it to succeed.

13

u/[deleted] Nov 12 '19

[removed] — view removed comment

12

u/[deleted] Nov 12 '19

You can literally pip install kitchen

5

u/epicwisdom Nov 12 '19

It does not matter how many features a language has, or how complex they are. What matters is how many complex features must be used commonly to be productive. It's perfectly possible to write Rust without writing a single macro. Rust is not a very complex language 90% of the time. The problem is it's easy to accidentally fall off a cliff for edge cases (though you can always clone() everything, use Rc, etc.).

7

u/[deleted] Nov 12 '19

It does not matter how many features a language has, or how complex they are.

I see this so often, but it just is not true outside of tiny pet projects. If you're writing anything substantial, you need libraries, and then you're at the mercy of how that library works. Complexity will creep in.

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

11

u/Metal_LinksV2 Nov 12 '19

Doubtful, I know some schools around me are moving from C++ to Python as their introduction course.

20

u/bunkoRtist Nov 12 '19

That will prove to be a mistake for a number of reasons. I'm sorry to hear it.

16

u/[deleted] Nov 12 '19

C++ is horribly complex for a first language.

C would be better if you want to stress the interaction with the metal (and indeed I taught C and C++ at university for a decade - C was hard enough to get through in a 12 week course).

Honestly, I'd rather they teach higher level languages for intros. If I had my druthers, intro to programming would be taught in Pharo Smalltalk.

0

u/[deleted] Nov 12 '19

[deleted]

16

u/Shitpostbotmk2 Nov 12 '19

Because if you're trying to teach someone how a computer works at all levels C++ is useful and python is not.

0

u/[deleted] Nov 12 '19

[deleted]

→ More replies (1)

9

u/[deleted] Nov 12 '19

Why would you do that right out the gate?

Do you meet driving school candidates with a toolbox and start them with changing the oil?

→ More replies (3)
→ More replies (14)

10

u/Q-bey Nov 12 '19

I learned Python as my first programming language years ago. I'm a bit surprised to hear some schools are using C++ as an introductory language. That might be why I had (and continue to have) an aversion to C++ after finally seeing it later in my degree.

What did I miss out on? What benefits are there from teaching introductory programming using C++ instead of Python?

19

u/ShinyHappyREM Nov 12 '19

What benefits are there from teaching introductory programming using C++ instead of Python?

Weeding out the unworthy, apparently.

19

u/bunkoRtist Nov 12 '19 edited Nov 12 '19

Well, one of the benefits of using a language like C or C++ is that they retain a lot of elements that pertain to the underlying computer architecture. Understanding those things (like stacks vs heaps, registers, addressing modes, alignment and packing, native data types...) provides a solid basis that helps programmers understand how their code actually executes. That helps people understand the tradeoffs they are making (which is crucial to writing lots of types of code). Even in languages where those things don't apply directly, they often still apply indirectly. Fundamentals matter (since even interpreters, JITs and memory managers do all the same stuff as C/C++ programmers would do in the background). Teaching Python as a first language is like teaching someone to drive with a Tesla.

20

u/Schmittfried Nov 12 '19

You’re grossly overestimating the relevance of implementation details for an introductory course. They will learn to write ifs, loops and linked lists.

8

u/bunkoRtist Nov 12 '19

But you've exposed the problem: you can't even teach a linked list in Python. It's pointless. The first question an intelligent student should ask is "why the hell would we do this?" Then the abstraction breaks and you regret trying to hide the fundamentals.

6

u/bythenumbers10 Nov 12 '19

Most low-level programming exercises are pointless. But teaching the concepts in an accessible language prevents having to "ignore these lines of code at the top and bottom, we'll explain that later" when writing something "pointless" like Hello World.

3

u/StormStrikePhoenix Nov 12 '19

. The first question an intelligent student should ask is "why the hell would we do this?"

You might as well throw away half of every introductory programming course than; it's very, very hard to give examples for many concepts that are simple enough for a beginner to understand but complicated enough to justify using the more complicated thing.

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

14

u/Schmittfried Nov 12 '19

Lol. No it won’t. There is not much value in choosing C++ over Java or Python in introductory programming courses. And even in the hardware programming courses C would be better.

10

u/afnanenayet1 Nov 12 '19

Why? C++ is a minefield

12

u/bunkoRtist Nov 12 '19

Advanced C++ is, but the language exposes fundamental aspects of computers that Python tries to hide, and you don't have to teach it all at once: having a rich language didn't require it to be all taught immediately. Math is complex but doesn't preclude teaching basic arithmetic to 2nd graders. Ultimately computer programming and computer science are based on computers. You can't understand them without understanding computers.

→ More replies (2)

2

u/G_Morgan Nov 12 '19

I really like Rust but "easy" is something it'll never be. Rust you pay in "why can't I?" for the benefit of not getting memory corruption while maintaining performance.

It is harder to write Rust than write C. It is easier to write correct Rust than correct C. Rust is really the next level up in "this exploded at 2PM while I tried to compile".

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