Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: How do you transfer the knowledge from HtDP to ReactJS?
7 points by juniusfree 5 months ago | hide | past | web | favorite | 4 comments
Hi,

I'm currently taking the course "How to Code: Simple Data" (https://www.edx.org/course/how-code-simple-data-ubcx-htc1x) which is based on the book "How to Design Programs" (https://htdp.org/2018-01-06/Book/).

If you have taken this course (or read the book), can you share how you used the recipes in designing a React program? A concrete example will be very helpful.

TIA.




I looked up both as I am not a professional programmer and don't work with any developer tools of trade. It looks like HtDP teaches you the basics of computer science ideas in a Scheme-like language . Presumably, this book teaches you how to write simple algorithms. For example, suppose you want to write an algorithm about growing a coconut palm tree. It might start off something like "go to a grocery store, pick up a certain kind of coconut, buy it, bring it home, get a bucket, fill it with warm water, put the coconut in it, leave it in a warm place, yada, yada, yada...". The libraries like ReactJS are supposed to have these algorithms already written for you. You just have to know their name. I am not sure if ReactJs has a function called how_to_grow_a_coconut_palm_tree(), but if it does you can just call the above function and ReactJS should do that for you without you having to write the whole algorithm. It lets you combine such functions into bigger ones and the whole nine yards.

Assumptions:

* I have no idea how functions are denoted in ReactJS or called

* Obviously, ReactJS can't manipulate physical reality, so you have to adjust your expectations accordingly. It probably can do some nice things like opening a new tab in Chrome. Although, I am not sure.


thanks.


Try working through something like the official React tutorial, but try to incorporate how you would have accomplished the steps by using the Design Recipe at every step.

I would wait until after you have worked through HtDP, though. And if you haven't learned vanilla Javascript yet, I would work through Eloquent Javascript after finishing HtDP, incorporating the Design Recipe in the same way.


Thanks you!

I actually started with vanilla JS and also tried react. But there seem to be a big gap in my skills when it comes to actually building a program. I'm still in the first week of the course but I'm more enlightened already. But I'm still trying to make sense how I can apply it to JS/React. I think I'll just wait until I finish the course.




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

Search: