
Ask HN: How do you transfer the knowledge from HtDP to ReactJS? - juniusfree
Hi,<p>I&#x27;m currently taking the course &quot;How to Code: Simple Data&quot; (https:&#x2F;&#x2F;www.edx.org&#x2F;course&#x2F;how-code-simple-data-ubcx-htc1x) which is based on the book &quot;How to Design Programs&quot; (https:&#x2F;&#x2F;htdp.org&#x2F;2018-01-06&#x2F;Book&#x2F;).<p>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.<p>TIA.
======
needagreencard
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.

~~~
juniusfree
thanks.

------
sn9
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.

~~~
juniusfree
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.

