3 ms·
>There's maybe some complexity inherent in vectorized manipulation of many-dimensional tensors, but I'm not aware of many languages/libraries that handle this m
by zahlman 2y ago
>There's maybe some complexity inherent in vectorized manipulation of many-dimensional tensors, but I'm not aware of many languages/libraries that handle this more naturally than Python with NumPy does; maybe MatLab? Would be interested to see code sample comparisons on this.
Not to mention: if the the goal is to teach programming, then it's grossly unnecessary to involve libraries like NumPy or Pandas, because it's grossly unnecessary to set the kinds of problems where they're helpful.
>...the available list, which is: O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREATE, O_EXCL, O_SYNC, O_TRUNC - similar to Python.
Is that not just a property of the common file API we've all settled on (popularized by C), which is how it's done in essentially every language now?
It's not clear to me why specifying a file mode should be counted as a different "way" of calling `open`.
>I'm not sure what the author means by this.
The author presumably doesn't have a proper mental model that distinguishes mutation from assignment, or which properly accounts for variables having reference semantics.
My personal sense is that Python made a huge mistake in pedagogy (for the sake of convenience) by using such similar syntax for certain common mutations ("index/key/slice assignment") as for ordinary assignment. They're really not the same thing at all - unless, of course, you think in terms of the global namespace as an object, but....
>Python having just `for` and `while` for loop statements is relatively frugal
FWIW, the lack of an explicit syntax for "just loop a specific number of times" (one must either maintain a counter or establish a proxy iterable to iterate) has annoyed a lot of people over the years. The idiom of iterating over a `range` has produced a lot of beginners who don't properly understand what `range` actually is or means.
>but not necessarily a better pedagogical tool - because inheritance is still present in many other popular languages
It's often pedagogically useful to teach how to simulate a feature. But this can be reserved for later lessons.