4 ms·
My ex who wasn't from stem background was learning Python. Its very anecdotal, but few things I very well remember was: (1) Here getting confused with scopes.
by truncate 4y ago
My ex who wasn't from stem background was learning Python. Its very anecdotal, but few things I very well remember was:
(1) Here getting confused with scopes. E.g. assigning variable in one function and using it somewhere else, mixing global/local scope, assign/use order. Looking at that I was thinking a language that has more explicit and strict way to declare variables and look at scopes is probably better for beginners. The alternative with Python is that it can be somewhat confusing, and at times you see them only if they get executed. Racket definitely doesn't have that problem. It is as obvious as it can be.
(2) If your introduction is through some kind of project (data science, web app ...) you'll likely be using some object oriented features from very beginning. I saw her getting confused with `foo()` vs `foo.bar()` vs `foo.bar`. There was definitely a big gap in her understanding, but I think Racket's focus on functional paradigm and most libraries being that way -- is somewhat a nicer experience for beginners.
Overall, Racket is a simple language but can get fancy as far you'd want it to, so I think the barrier of entry is probably better than Python.
- AtlasBarfed 4y agoMuggles think in dynamic scope: they accumulate facts or locations and then refer back to them. Local/lexical scoping is really a code structure/management/scaling thing. A name management system if you like. As the joke goes, the two biggest problem in CS are naming and caching.
- messe 4y agoI always liked the variation that the two biggest problems in CS are naming, cache invalidation, and off by one errors.
- brundolf 4y agoThe problem is that Python doesn't make the explicit distinction between declaring a new (shadowed) variable, and assigning to an existing variable from an outer scope
- wodenokoto 4y ago> I saw her getting confused with `foo()` vs `foo.bar()` vs `foo.bar` I had the same problem when learning Python. Top that up with mutable and non-mutable structures and it can get very hard to make sense of Python as a beginner. I remember I had a theory that foo.bar() would change foo and bar(foo) would return a value while leaving foo unchanged ... that turned out to be very wrong. It also took me forever to realize that when you call foo.bar(), foo is the first argument of bar().
- srcreigh 4y agoWell, sometimes, other times foo is a module and foo.bar() calls a function bar with no arguments.