Learn Functional Programming by Building a Spreadsheet
There are so many arrow functions in this course. Even though I can pass the steps after a few tries, I still don’t understand why it has to rely so much on arrow functions.
It’s really frustrating trying to read those compact, one-liner arrow functions. Right now, I’m on step 56, and I can’t help but wonder, “What’s the point of this?” It feels unnecessarily hard to follow.
Would it be better if I quit this course and switched to the JavaScript course in the Full Stack Development path instead? Does that one use more regular functions rather than cramming everything into arrow functions?
Note - arrow functions and traditional functions in most cases do the exact same thing. Its largely a style preference, with modern JS seeming to prefer arrow functions.
But is it really necessary to make functions so compact? Turning functions with longer processes into one-liners seems more confusing, especially for someone who’s still learning.
Arrow functions do not have to only be all on one line.
Yes, what I meant is that in this course, almost every function is turned into a one-liner, even when there are quite a few processes happening in each function. I want to solve each step by writing functions that aren’t crammed into one line — breaking down each process into separate lines to make it clearer — but the tutorial insists on making everything a one-liner.
Also, about the third paragraph in my original post — do you have any thoughts on that?
You should be able to write arrow functions that are spread across multiple lines just fine for most steps.
I have to admit I’m feeling more confused after this conversation. I’m trying my best to follow along, but the focus on compact functions makes it harder for me to understand what’s happening in the code.
Even if the code can be spread across multiple lines, it’s just adding line breaks to the same one-liner. It doesn’t actually separate the function’s processes to make it easier to understand. Besides, almost every step in the course asks for the solution to be written as a one-liner anyway.
Arrow functions are not always compact or on one line.
Can you give examples of steps where using multiple lines is forbidden?
It is teaching functional programming, so arrow functions are going to be used heavily.
Secondly, if a function returns a value, an arrow function can do so implicitly by not having a function body, which is also used a lot with FP, especially with higher order functions and function composition where small functions are composed, and their return values are passed into each other.
But I do agree that this challenge is kind of confusing and not all the code is super well explained. Which is a pity because some FP paradigms can be pretty handy. But the curriculum already teaches FP-ish code in different places.
1 Like
Yes, that’s the recommended curriculum now. It does explain things more and builds knowledge in different ways. Some labs are the same, but there will be more explainers, quizzes and reviews.
2 Likes
I don’t remember the exact steps, but I do remember there were quite a few that required using implicit return (without curly braces), even when the code being returned was pretty long~~~~~~~~~~~
I’ve actually finished that section — I only have one lesson and the final project left from this:
Aside from this lesson —I didn’t really have problems with the rest.