7 ms·
According to people who work with a lot of programmes teaching coding, the reason python is so appealing to new coders is the syntax. Particularly the lack of b
by randomsearch 7y ago
According to people who work with a lot of programmes teaching coding, the reason python is so appealing to new coders is the syntax. Particularly the lack of braces, the indents, the nice keywords, that make reading code much easier to a newcomer.
Having taught both python and JavaScript, I can tell you that the former is far far less confusing to newcomers than the latter. Imagine explaining the problem with equality comparison or prototypes in JS to someone who just learnt what an IF statement is.
The reason I agree that python will dominate programming for decades to come is the batteries included and pythonic approach that enables people to do cool things with just a few lines of code. As a result of the above, the ecosystem has reached critical mass. For most tasks there’s a library that does that, and it’s good, and it’s easy to use, and the developer of the library usually doesn’t expect you to understand their opinionated philosophy to use it.
I love the python convention of putting a minimal example on the homepage of a library.
You’re not going to get your average developer to appreciate the beauty of Lisp or the value of static typing. They want their ML to work, or their graphics to display, that’s all. Ends not means, almost entirely, for most people who aren’t full-time programmers.
Let’s not hate on a language that opens up programming to the world, unless we want to be gatekeepers. If you want to maintain an air of superiority, just learn Lisp or Haskell or C++ and write code that’s “deeper” into the tech labyrinth. Programming will probably specialise into “end user programming” and “Service and system programmers”. Embrace the democratisation of coding.
- reallydontask 7y ago> Particularly the lack of braces Since most of my professional experience is with C like syntax languages, I don't get how the lack of braces is an advantages, quite the opposite in my limited experience with Python. Braces define scope unequivocally, they are easy to visually parse and don't care whether you are using tabs or spaces or even if you, loud gasp, mix them. Furthermore, you can copy and paste, say for loop from a method to another method and it will work. In Python you might have to faff about with spaces (I'm sure there must be IDEs that solve this problem but it was no fun on vim or even notepad++)
- retube 7y agoAbsolutely agree. maybe its just cos I am coming from languages with braces (java) but yeah I find the lack of braces + whitespace having meaning (tabs versus spaces for example) _incredibly_ frustrating I also don't like the fact it is dynamically typed. It makes reading soure code so much harder. E.g What is the type of this thing that is being passed as a function arg?
- reallydontask 7y ago> I also don't like the fact it is dynamically typed. It makes reading soure code so much harder. E.g What is the type of this thing that is being passed as a function arg? I didn't want to get into that as it always seems to open a massive can of worms but agree 100% with you. I need all the help I can get when developing, to throw away all the type checking that the compiler does before runtime seems like developing with a hand tied behind one's back, but each to their own, far be it from me to try to convince somebody that they should switch languages: if Python works for you, then great, keep using it.
- abricot 7y agoTwo things: 1. For people not used to do programming, braces in text are usually significant - having them everywhere, and even start and end on different lines, are confusing. 2. For people not using standard US keyboard braces are often an SHIFT or ALT command, that makes it wildly different to program uninterrupted.
- reallydontask 7y ago> 2. For people not using standard US keyboard braces are often an SHIFT or ALT command, that makes it wildly different to program uninterrupted. I really depends on what you mean by wildly,but I've never programmed in a US keyboard (I use UK or Spanish) and it doesn't seem to be a big issue for me, clearly YMMV
- read_if_gay_ 7y ago> Braces define scope unequivocally So does whitespace, otherwise Python wouldn’t work as a programming language > they are easy to visually parse only if you indent properly > Furthermore, you can copy and paste, say for loop from a method to another method and it will work. In Python you might have to faff about with spaces (I'm sure there must be IDEs that solve this problem but it was no fun on vim or even notepad++) Shift+V } < or > Hit . as often as needed Too difficult? Not to mention you will run into exactly the same problem when copy pasting C unless you like randomly indented code
- bakery2k 7y ago> Ends not means, almost entirely, for most people who aren’t full-time programmers. And for many who are. Maybe not on our main projects, but at least for helper tools, side projects etc.
- michal-franc 7y agoThat's my case. I use python mostly for smaller scripts and 'leetcode' based coding katas.