7 ms·
When I studied at the University of British Columbia, racket was taught in the intro to CS course. I thought it was a great language, and put everyone on an eve
by captainkrtek 2y ago
When I studied at the University of British Columbia, racket was taught in the intro to CS course. I thought it was a great language, and put everyone on an even playing field (eg: students with prior programming experience hadn’t worked with lisp). Also was impressed by the libraries which made it easy to produce simple games or visuals.
- czhu12 2y agoI also was at UBC for that class and left with a totally different impression. I thought it was awful and set up introductory students very poorly for subsequent CS classes, especially data structures and algorithms that were taught in imperative languages. When I TAed, a lot of incoming 2nd year students didn’t know how to do for loops yet, which really set them back for basic algorithms. I had a much deeper appreciation for functional languages after theory of computation classes in my senior / 4th year.
- IIsi50MHz 2y ago> When I TAed, a lot of incoming 2nd year students didn’t know how to do for loops yet, which really set them back for basic algorithms. I'm surprised anew on the rare occasions I come across statements like this. The first time was when I applied for my first programming elective class. The teacher actively tried to dissuade me from it, saying that by the end of term they'd be lucky if they even got to for-next or do-while loops. I was shocked, having first understood these from BASIC code listings in the back of magazines, with only one or two weeks per year having a few hours of access to an Apple II on which to actually run anything. I tend to fall into the trap of feeling that loop constructs should be so trivial, that understanding should come from a tiny fraction of one class session plus maybe a few minutes tracing the code by hand. So, I thank you for being my irregularly scheduled reminder that people's first exposures to such things can be very different.
- cess11 2y ago"When I TAed, a lot of incoming 2nd year students didn’t know how to do for loops yet, which really set them back for basic algorithms." They hadn't done simple recursive functions over lists? What had they been doing? Been a while since I had to read introductory material for Racket (or any similar language), but as I recall functions with a base case exit and recursion is usually among the first things they teach.
- spencerchubb 2y agoLisp variants only really have linked lists. So yes you can do recursion over them, but for someone who has never done a C-like language before, the arrays and for loops will take getting used to
- reikonomusha 2y agoLisp "variants" have lists, hash tables, multi-dimensional arrays, strings, bit sequences, streams, etc.
- aeonik 2y agoIs it the case that all the cons cells at the base of the language are compiled into more efficient structures?
- lispm 2y agocons cells are not the base for vectors, strings and a bunch of other datastructures. Cons cells are mostly only used for nested lists or similar.
- aeonik 2y agoI guess I'm curious how the implementation of Vector works in Lisps. I thought it would be some sort of combination of Atoms and Cons cells. I looked into the Racket Repo to find something, but had a hard time finding the code.
- Bogdanp 2y agoIn Racket, a vector is a fixed-size contiguous array of memory. The values in each slot of a vector are tagged pointers so values like fixnums don't require any indirection to reach (i.e. they're unboxed). Racket also has specialized vector types for storing fixnums (fxvector), floats (flvector), strings (string) and bytes (bytes). Other Schemes and Common Lisp have similar constructs. Just because a language is a lisp doesn't mean its primitives have to be implemented using cons cells.
- lavp 2y agoI also TA'd 110 and I firmly disagree. CPSC110 teaches you to view a particular problem as a series of different possible states, and solving for those states (while placing an emphasis on seeing base cases and working up from there). Students learn about data structures like binary trees by the fifth week, and the ninth week they're already able to solve sudoku puzzles using generative recursion. We even touched on the n-queens problem towards the end of the course. Racket serves its purpose well as a simple and fast to learn educational language; it's easy to see and understand recursion. It's also easy to see what the execution order of statements in your program. I will say though that some problem sets were a bit brutal in terms of time taken to complete them.
- ie878 2y agoAgreed. My main observations from students in my cohort were that those who viewed programming as a set of instructions struggled, whereas those who viewed the course material as a series of manipulations on mathematical objects grasped the material much quicker. In general, the course focused a lot on learning from first principles, which I appreciate much more nowadays.
- zelphirkalt 2y agoMost data structures taught with imperative languages are just that, data structures for imperative languages, which run on a single CPU core and do not utilize multiple cores well, or at least not without locking mechanisms. One can usually find one of them and copy paste the code, when needed. Much more interesting are purely functional data structures, that can be easily parallelized. That is what universities should teach. I feel like we are quite backward in education with data structures. I can watch a whole data structures lecture/class at no cost besides my own time on YouTube, for famous professors, but when I want to apply it in an FP setting, I will still be dumbfounded and looking for other solutions, which I do not know how to arrive at.
- t4ng0pwn3d 2y agoSICP doesn't teach assignment till chapter 3 if I recall correctly, and that was used for years at MIT. I don't think it set CS back there, so maybe it was more a teaching issue?
- lavp 2y agoGood ol' Gregory Kiczales
- api_or_ipa 2y agoTrust in the recursion