Frivolous Gravitas Extras - Live Session #2: Introduction to Javascript Functions (in plain English)

Опубликовано: 30 Октябрь 2024
на канале: Frivolous Gravitas
26
3

Commented video session file for "Introduction to Functions": https://github.com/paxdriver/html-too...

Hi, Kris here. I had a really hard time breaking into the computer science field when I was first trying to figure out where to start learning to write code. I knew it was useful and something I would want to know how to do, it was near impossible to know where to start without complicated instructions and risking bricking my only working computer...

If you're like me back then, then this will probably help you today. I had the advantage learning bits and pieces but starting very young. I remember vividly where my learning progression got stuck as a consequence because 'stuck' meant 6 months working on figuring out the same problem, only to have already lost interest in the project I was working on for fun.

Functions were the hardest things for me to wrap my head around, but once it clicked then everything became clear. Depending on your background you can consider a function in different ways to analogize how to conceptually consider a function and its usefulness in your code. In other words, if you're a painter you can think of the idea of comparing the jobs you did to one another on the basis of their size (say, the square-footage of each job), then it's easy to answer the question "what are functions for and how are they used". Comparing SF-age is a function of width length x height, the equation for area.

Another example of functions is percentages. 'Per' means 'for' and 'cent' means 'hundred'. Per-hundred is literally 1/100 aka "one in one hundred", etc. That's a function. Lambda calculus, tables, graphs and charts, image processing, motion detection, sensations and everything we feel are complex functions comprised of smaller, lesser embedded function. Biology and engineering are 2 very visible examples of this reality, right down to the atom.

You use percentages in your mind and rational on a regular basis almost every single day. You didn't realise how much you already know how to use functions, so all you need to learn is how to represent that in code so we can manipulate them in cool ways like graphics, neural networks, web app development, and gaming.

All you need is a text editor and a browser and you can learn it all in one video. Be sure to check out the first part of this series called "Primitive Recursion: " something, something. This will be the prequel to that one, since learning how to write functions is probably step 1 to writing recursive functions.

Meh, enjoy.

#FrivolousGravitas Links:
Channel:    / @frivolousgravitas  
FB:   / frivolous-gravitas-podcast-109356198202987  
Twitter:   / frivolousgravi1  

If you like this kind of content and want to see more, be sure to like, share and subscribe to help keep this channel going.