Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Knowing your way around the ecosystem of one programming language does not build up the intuition necessary for identifying O(n²) (or worse!) algorithms and choosing/writing O(log(n)) (or better!) ones instead.

I'll disagree with this, at least in terms of Scheme versus Python.

Python is visually close enough to other languages that the skills you develop to quickly see O(n²) algorithms easily transfer to many other languages. Scheme is very different visually, and so the intuition doesn't transfer as well. Sure, it's possible your intuition is wrong, but when scanning a program intuition can help in the first pass.



Scheme has (trace), at least most interpreters (and his cousing Common Lisp) have some tracing and pretty-printing features. Far more powerful than anything Python could offer.

Oh, and of course it has functions like sdraw or draw-cons-tree when you can print the contents of a list in seconds as an ASCII-ART chart:

https://www.t3x.org/s9fes/draw-tree.scm.html

The file it's in the public domain.

Try that with Python.


Python has the pprint module, which takes care of this for you, and for more datatypes than are done here. (I don't see how this would handle a hashmap in a sensible way.)

But I'm not sure how this addresses what I was saying, which is that the intuitions about algorithms you get working on Python are easier to transfer to popular languages like C++, Java, Javascript, Rust, etc..




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: