7 ms·
>It's called Pyret. How about just learning Python instead of learning a toy language and then having to learn Python anyway?
by ManlyBread 10y ago
>It's called Pyret.
How about just learning Python instead of learning a toy language and then having to learn Python anyway?
- deleted 10y ago[deleted]
- volkk 10y agoyeah i don't think i fully understand. my first language that got me introduced to programming was python and it taught me all the basics of OOP that were important to really get me going. it's a great language with little magic. after, i moved on to java and eventually functional languages.
- natec425 10y agoI do think Python is an acceptable language for beginners, but I wouldn't say it has little magic. It may feel intuitive at times, but Python's magic methods can be somewhat disorienting for students. This usually hits when students reach for-loops (and to some extent during branching due to __bool__). Also, Python may feel like a small language at times, but it is really quite large and complex. This can be seem by imagining a beginners perspective when Googling for help with a simple list operation. The inevitable Stack Overflow answer will almost certainly use a comprehension. I would argue that Pyret is actually fundamentally less complex than than Python. As always, the biggest issues are your goals, constraints, and resources. If you can afford to spend time in a language optimized for education, that is fantastic. If you can't afford that time, python starts to look like a good trade off relative to the languages with reasonable job prospects. * It doesn't make me an expert, but I do teach programming for a living. We use happily use python for introductory content and server-side web content, but I can easily see Pyret as a great option for an educational offering with different constraints than mine.
- volkk 10y agofair argument. this was in college, so i had a lot of resources available and very particularly picked curricula so i didn't bump into any of the magic methods until i graduated college and used python in production.
- jventura 10y agoI have to agree with you, Python does really have lots of magic things, such the for loop, list comprehensions and generators, to name a few. I also teach programming for a living, and, for instance, I usually have a hard time explaining to students what a for loop over a range() means for having a index. The problem is that there are a lot of things going on behind a for-each (which is what the for loop on Python does) and it is hard to explain that to newcomers. On the other hand, for loops in languages like C are simpler to explain to newcomers, as there isn't much hidden from you, and you don't have many alternatives for iterating on an array. I would say that the higher-level benefits of Python are best understood when you have some experience with lower-level languages such as C/C++ or Java. For students, if they have time, I would say that they would benefit pedagogically by learning a simpler language with less functionalities. If not, I would say learn Python, but expect to not understand everything at first.
- gr3yh47 10y agoEspecially when the python community is so incredibly helpful. there are no stupid questions on #python on freenode IRC, and many many helpful people to answer questions in realtime
- brudgers 10y agoPyret came out of the PLTgroup, the group of educators responsible for the Racket ecosystem and before that MzScheme. They have been studying and innovating on programming pedagogy for more than two decades. What sets the PLTgroup apart, in my mind, is that it tends to row in the same direction at the low level. This has allowed it to create a robust platform upon which tools (particularly in the form of languages) can be built. Pyret is an example of this. Adding a language with the offside rule to the ecosystem doesn't cause anyone offense or raging flame wars or fuck-you forking. Imagine a PEP to add Lisp syntax to Python. Instead, Pyret just gets rolled up into the pedagogy that is described in How To Design Programs because Pyret fits with the philosophy of building teaching languages for the purposes of teaching. Other PLTgroup languages range from Beginning Student Language (a simplified lisp) up through Racklog (a lisp implementation of Prolog's logic programming model) and pure insanity like Scribble which introduces a documentation phase to the compilation. Racket even ships with an Algol60 implementation. At the core, the important philosophical idea is that learning programming is not learning a language. In the age of Googling into StackOverflow, that's even more the case as far as I can see.
- Sean1708 10y agoWhat do you mean by the offside rule in this case? I presume you don't mean that Pyret can't shoot if it got the ball when it was behind all the other language's defenders.
- brudgers 10y agoOnly if the Pyret was already in an offside position when the ball was last played by a team mate and it was not a goal kick, throw-in, or corner kick and Pyret was involved in active play (receiving the ball, interfering with a defender, or obstructing the goalkeeper's view)...but I digress. Python's use of semantic white space in the form of indentation is sometimes referred to as the 'offside rule'.
- sigzero 10y agoInteresting, I have never heard that term used in relation to Python white space. TIL
- icholy 10y agoRight? The only reason I got hooked on coding was because I was making cool things. Good practice and CS fundamentals came later. If programming was introduced to me in this "bottom up" approach, I would have lost interest. Math education has the same problem.
- dwaynecrooks 10y agoI know exactly what you mean. I got interested in programming because I wanted to build cool things. I just dived right in trying to learn whatever was necessary to help me build games. Unfortunately, plenty people aren't coming to programming with that exploratory and playful mindset. I also agree with you that math, CS and science education is really messed up, especially in my country. Here's an old gem of a talk from a fantastic CS educator, https://www.youtube.com/watch?v=efhh0Cf6sT8 https://www.youtube.com/watch?v=efhh0Cf6sT8, that I found some years ago.
- jpolitz 10y agoPyret (and the Bootstrap curricula in particular, where we use both Scheme and Pyret [http://bootstrapworld.org/] http://bootstrapworld.org/]) really strives to avoid the purely "bottom up" approach. Curricula in Pyret focus on building games using concepts from math, or interactive simulations using concepts from physics, or data analyses using concepts from working with spreadsheets. I agree that a purely "CS concepts"-based approach is dry and ineffective for a huge portion of students. That's why applications are so critical, and why we build things like tables (https://twitter.com/PyretLang/status/773605473824145408 https://twitter.com/PyretLang/status/773605473824145408) into the language, so we can give students real-world tasks to do right away. We happen to also have carefully designed the language to allow us to teach these applications along with a rigorous programming style. Students write _examples_ that get them ready to understand automated testing, they write _contracts_ that teach them about type-based interfaces, they write _data definitions_ that teach them about structured data, and so on. But it's always in service of an application. So I very much agree that a purely "bottom up" CS-concepts-only approach has issues.
- dwaynecrooks 10y agoWell, first off it's just a suggestion so take it with a grain of salt and ultimately do what works for you. But I see your point and I did struggle with whether to include it or not. I think me wanting to share the great work I see Shriram Krishnamurthi (https://cs.brown.edu/~sk/ https://cs.brown.edu/~sk/) and others (Matthias Felleisen, http://www.ccs.neu.edu/home/matthias/ http://www.ccs.neu.edu/home/matthias/ for another example) are doing and have been doing for decades to advance Computer Science education and really tackle the tough problems pushed me to include it in the end. I'm just a fan of their work and this post felt like a great time to mention it. However, I do share your feelings that most people should just jump in and learn Python as their first language. It's easy to get started, batteries included and there's plenty of resources and people to help them if they get stuck.
- jerf 10y agoPython has gotten hard to learn. It's not too bad if learning it just to learn, or learning it in a classroom setting with a careful plan, but I've witnessed people trying to learn it professionally in the context of getting testing running, and it's hard to learn when trying to use a mature Python codebase that uses Python thoroughly. There's these decorators, and iterators vs. functions, and things using introspection to do invisible things, and on and on it goes. Python used to be easy to learn. It isn't anymore. It may be a better language for all the feature additions, but it isn't easy to learn anymore and I no longer recommend it for that purpose. (I don't have a recommendation at the moment.)
- lojack 10y agoMost people learning it professionally are doing it so they can work with an existing code base. How is learning a different language going to help them with that?
- VT_Drew 10y ago>Python used to be easy to learn. It isn't anymore. Compared to C++, C# and Java, Python is still MUCH easier to learn. Python and Ruby are the easier languages to learn. I have to agree with the other commenter, why learn a toy language only to later have to learn a real one? That is a waste of time.
- mangodrunk 10y agoWell, shouldn't it be about learning how to program. Not necessarily learning Python or Ruby? You will learn how to program with languages like Python, Ruby, Java, etc. but you will have to work with constructs/abstractions that might make sense in a professional setting but not so much in an academic setting.
- hueving 10y agoIt's only hard if you dig into the giant async/await mess. You can still handle tons of work without worrying about concurrency.