Better HN
topnewbestaskshowjobs
Log inSign up

acodingcow

6 karma · joined Mar 7, 2023 (3y ago) · 2 submissions

Submissions

comment 3y ago · link · parent

I feel like this type of task was already handled well by ChatGPT. I am a designer currently learning web development. When I am confused about something, I just add a prompt such as "explain it to a middle school student" to the question.

For example,

Q: "What is closure in javascript?"

GPT4.0: A closure in JavaScript is a function that has access to its own scope, the scope of the outer function, and the global scope. This feature enables the function to access variables from an enclosing scope even after that scope has finished execution, providing a sort of "memory" for the function.

Q: "What is closure in javascript? Your task is to explain it to a middle school student."

GPT4.0: "Imagine you're building a magical castle. Inside this castle, you have a special room where you keep all your secret treasures. Normally, once you leave the room, you can't see or use the treasures anymore.

But then, you invent a magical backpack. With this backpack, you can take any treasure from the room, and no matter where you go, you can always see and use the treasure you put into the backpack. Even if the room disappears, the treasures in your backpack stay with you.

In JavaScript land, the "castle" is like your program, the "room" is a function, and the "treasures" are variables or data that the function uses. A closure is like the magical backpack. It's a special kind of function that remembers the variables it saw when it was created, even after the function it was created inside is done running."

comment 3y ago · link · parent

For those who are starting to learn creative coding from p5js/Processing like me, this framework can appear quite challenging. P5js and Processing are designed to smooth the learning curve of programming for designers and artists without a CS background. Nannou looks more like it's designed for those who already have experience in creative coding but are looking to achieve higher performance with their sketches.

It's worth taking a look at OPENRNDR, which is a framework based on Kotlin. Personally, I think it achieves a good balance between performance and accessibility.

OPENRNDR: https://openrndr.org/