4 ms·
Python is great glue. But it's huge. Packed full of features. Has all sorts of syntactic sugar. It's the C++ of scripting languages. Great for an intermedi
by retrac 6y ago
Python is great glue. But it's huge. Packed full of features. Has all sorts of syntactic sugar. It's the C++ of scripting languages. Great for an intermediate programmer who just needs to slap something together. But at the very beginning, these can actually be drawbacks because there's so very much to learn.
I would suggest something small, that you can realistically fit all in your head. I honestly believe Pascal is still an excellent choice. For something a little less low-level and more scripting-like, Lua seems nice. The JavaScript ecosystem is awkward, and there are things to criticize (no integers?) but by itself, it's a nice small language as well.
- echelon 6y ago> It's the C++ of scripting languages. This is such a fantastic analogy. Thank you! C++ tries to be all the paradigms, even if they're bolted on. Python is similar in that regard. Complex OO, functional, exceptions, decorators, lots of container types, iterators, generators, operator overloads... The only thing it's missing is a macro language. Python's "batteries included" standard library stance takes it even beyond the C++ analogy in terms of sheer volume of out of the box capabilities you get.
- pansa2 6y agoBut Python still has a reputation of being a simple language for beginners. I’m not sure how that reputation endures. Is it just because of the lightweight syntax?
- type0 6y agoIt is deceptively simple. The Python learning curve looks like a snake - https://fabienmaussion.info/acinn_python_workshop/figures/xkcd_learning_curve_wa.png https://fabienmaussion.info/acinn_python_workshop/figures/xk...
- chriszhang 6y agoDoes this curve really represent everyone's experience? I never experienced the "I hate Python" phase. I think I went straight from "So exciting" to "productive" phase with Python.
- pjmlp 6y agoMy only hate Python is how hard it is to push for JIT adoption versus other dynamic language communities.
- prionassembly 6y agoI hated Python 2 because it did the Wrong Thing with integer division (it didn't cast to floats), so my attempts at simple scripts just didn't work. I reencountered Python at a data science course that was somehow mandatory for my masters in ODE numerics. It has a HUGE availability of standard and third-party packages, so you can be INSANELY productive. I'd write in Brainfuck if it was the only way to have like Pytorch and giotto-tda and networkx and fastapi in the same room.
- Too 6y agoBack to the original question, is there any other language that doesn't look like this?
- pjmlp 6y agoBecause Python is easier to start programming with, BASIC like, but a large majority fails to actually read the official documentation. If they would do that, then they would realize Python is as powerful as Common Lisp, Ada, C++,.... with similar doc size in pages.
- BerislavLopac 6y agoPython has a built-in macro language. It's called Python.
- prionassembly 6y agoCheckout Hylang, a Lispish language that compiles to Python, or maybe a Lispish syntax for Python? You can write pieces of code in .hy files and import them from .py files and vice-versa. And then you have macros like in macros that traverse and transform code.
- doliveira 6y agoPascal is nice to teach the basics, but I would be very discouraged if I had started learning something that's so rarely used in the "real world".
- retrac 6y agoThat's a fair point. Pascal is no longer a commercially significant language. Still, I do run into solid little projects that are written in FreePascal from time to time. Sometimes not so little. https://wiki.freepascal.org/Projects_using_Free_Pascal https://wiki.freepascal.org/Projects_using_Free_Pascal
- pjmlp 6y ago> It's the C++ of scripting languages. Sorry, but Perl still wins there.
- sideshowb 6y agoWhy the requirement for a beginner to know their entire language? Writing code is fundamentally about making changes to a system with incomplete knowledge - abstraction, encapsulation etc. Working in the presence of unknown language features is another facet of the same thing.
- retrac 6y agoSo you don't get bogged down in details. There are many programmers out there who can glue libraries together but have no understanding of algorithms. If you want to focus on the CS side of it, remove all distractions. My first CS professor insisted the first year be done all on the whiteboard. And this wasn't back in the dark ages. It was long after every student had a personal computer on their desk. Everything was done in a low-level pseudocode somewhere between Algol and C. She felt that computers and actual programming languages would get in the way of learning the principles. I'm not quite that hardcore. But she was on to something. I learned more from that class than any other.
- sideshowb 6y agoYou can avoid getting bogged down by learning a limited subset of a language, though. e.g. in Python you could teach most algorithms with just conditionals and functions, and keep things pure functional using only tuples for storage. Introduce assignment, lists and loops whenever it suits you.
- sideshowb 6y agoCoincidentally well timed - the new PEP on pattern matching would be great to include in the limited subset for teaching: https://www.python.org/dev/peps/pep-0636/ https://www.python.org/dev/peps/pep-0636/ The above tutorial is based on user input but to my mind this mechanism seems equally good for teaching recursion on data structures as you would in say, ML.