God
7,176 POSTS & 5,662 LIKES
|
Post by iNCY on May 20, 2020 6:10:55 GMT
Essentially what is happening is that filter is a list method/function (I don't know the Javascript lingo) that takes a function (let's call it F) as a parameter. Filter then applies F to every item in the list. is just shorthand for a declaration of a simple function, in this case: function f(x) { if x < 25 { return true; } };
The above two code snippets are equivalent and define the same function. Functions that take functions as arguments is a confusing, mindbending concept when first encountered (the introduction of the shorthand arrow doesn't help), but when you get used to it, it's very easy to read and saves you typing out lots of function definitions and curly braces. Yeah, I have a feeling my struggles are more the fast and glaze-over approach the module is taking. Granted, had I known JavaScript was going to be this much exponentially more difficult to grasp than HTML/CSS going in... I probably would've made more of a point about having paper and pen on hand for note-taking. Functions as arguments is one thing. Arrow notation as shorthand is another. I feel like I might've been better served learning functions as arguments alone first, even if it meant a lot of extra typing. Then introduce shorthand later as my "reward" so that I can then go back and re-practice what I've just learned but now applying the shorthand to see how much better/easier/quicker life can be. Oh well, fuck me. Steaming with frustration right now! The FAQ discussion prompt from other frustrated students did lead to an interesting outside article about using the .reduce method in a real world application to generate something for some back-end API after scrubbing the HTML of a form. Even if I barely understood what they were talking about, learning about a real world application was re-inspiring. Can't wait for this course to be done. Then I want to spend some time just practicing and fucking around, and going back and refreshing what I've already learned. All you need to know how to do is look up the function you require on stack overflow and someone elses github, then stitch it all together. If you saw the documentation of most code you would have heart failure. I remember reading how Windows is still using the same kernel from 1993 and nobody wants to rewrite it because it is such a frankenstein nobody knows how it works. I also have my glorious new keyboard, a Filco Majetouch with Cherry browns. I had one before and lent it to my wife and she claimed it so I had been making do on a Ducky, but there is no comparison, I love this keyboard so much.
|
|
Legend
23,184 POSTS & 12,594 LIKES
|
Post by 🤯 on May 20, 2020 11:40:08 GMT
Yeah, I have a feeling my struggles are more the fast and glaze-over approach the module is taking. Granted, had I known JavaScript was going to be this much exponentially more difficult to grasp than HTML/CSS going in... I probably would've made more of a point about having paper and pen on hand for note-taking. Functions as arguments is one thing. Arrow notation as shorthand is another. I feel like I might've been better served learning functions as arguments alone first, even if it meant a lot of extra typing. Then introduce shorthand later as my "reward" so that I can then go back and re-practice what I've just learned but now applying the shorthand to see how much better/easier/quicker life can be. Oh well, fuck me. Steaming with frustration right now! The FAQ discussion prompt from other frustrated students did lead to an interesting outside article about using the .reduce method in a real world application to generate something for some back-end API after scrubbing the HTML of a form. Even if I barely understood what they were talking about, learning about a real world application was re-inspiring. Can't wait for this course to be done. Then I want to spend some time just practicing and fucking around, and going back and refreshing what I've already learned. All you need to know how to do is look up the function you require on stack overflow and someone elses github, then stitch it all together. If you saw the documentation of most code you would have heart failure. I remember reading how Windows is still using the same kernel from 1993 and nobody wants to rewrite it because it is such a frankenstein nobody knows how it works. I also have my glorious new keyboard, a Filco Majetouch with Cherry browns. I had one before and lent it to my wife and she claimed it so I had been making do on a Ducky, but there is no comparison, I love this keyboard so much. Feel like I need pics of this keyboard. I didn't know computer keyboard connoisseurism was a thing. After spilling coffee on mine though and having to deal with hammering sticky keys and waiting for them to unstick WHILE getting pwned by JavaScript... I'm now way more intrigued and understanding of the importance.
|
|
Strong Style Mod
USER IS OFFLINE
Years Old
Male
11,417 POSTS & 11,540 LIKES
|
Post by Emperor on May 20, 2020 12:03:36 GMT
I def prefer the the larger syntax as it is far more readable. Shorthand in general is faster to write at the cost of readability. With a good IDE it is only a few letters more you will be typing to make the code far more readable. Eh, I think the arrow syntax is very readable. I can immediately tell what it is doing, but that's because I know this concept well, it exists in some form or other in pretty much every modern programming language. For 🤯, better to stick with the longer notation.
|
|
Strong Style Mod
USER IS OFFLINE
Years Old
Male
11,417 POSTS & 11,540 LIKES
|
Post by Emperor on May 20, 2020 12:05:57 GMT
All you need to know how to do is look up the function you require on stack overflow and someone elses github, then stitch it all together. Programming for chumps who don't know how to really program. You can rise above that, pee eye.
|
|
God
7,176 POSTS & 5,662 LIKES
|
Post by iNCY on May 20, 2020 12:07:41 GMT
All you need to know how to do is look up the function you require on stack overflow and someone elses github, then stitch it all together. If you saw the documentation of most code you would have heart failure. I remember reading how Windows is still using the same kernel from 1993 and nobody wants to rewrite it because it is such a frankenstein nobody knows how it works. I also have my glorious new keyboard, a Filco Majetouch with Cherry browns. I had one before and lent it to my wife and she claimed it so I had been making do on a Ducky, but there is no comparison, I love this keyboard so much. Feel like I need pics of this keyboard. I didn't know computer keyboard connoisseurism was a thing. After spilling coffee on mine though and having to deal with hammering sticky keys and waiting for them to unstick WHILE getting pwned by JavaScript... I'm now way more intrigued and understanding of the importance. www.diatec.co.jp/en/det.php?prod_c=757It is absolutely an extravagance, but it brings me Joy in the Marie Condo sense.
|
|
Legend
23,184 POSTS & 12,594 LIKES
|
Post by 🤯 on May 20, 2020 12:09:26 GMT
All you need to know how to do is look up the function you require on stack overflow and someone elses github, then stitch it all together. Programming for chumps who don't know how to really program. You can rise above that, pee eye. Oh yeah! I meant to reply to this... I get so disappointed when I feel so defeated I have to look at the hints or solution. And I derive joy from the puzzle solving of troubleshooting when I am able to do that. Plus, I feel like if I don't get the fundamentals under my belt, I'll have no idea what I'm looking at when browsing Mozilla Developer Network or Stack Overflow or whatever other resources are out there.
|
|
Strong Style Mod
USER IS OFFLINE
Years Old
Male
11,417 POSTS & 11,540 LIKES
|
Post by Emperor on May 20, 2020 12:11:10 GMT
I def prefer the the larger syntax as it is far more readable. Shorthand in general is faster to write at the cost of readability. With a good IDE it is only a few letters more you will be typing to make the code far more readable. IDE? Integrated Development Environment. The most famous example is Visual Studio, and is tied to a specific language, or family of languages. Can do autocomplete and other nice things.
|
|
Strong Style Mod
USER IS OFFLINE
Years Old
Male
11,417 POSTS & 11,540 LIKES
|
Post by Emperor on May 20, 2020 12:13:17 GMT
Programming for chumps who don't know how to really program. You can rise above that, pee eye. Oh yeah! I meant to reply to this... I get so disappointed when I feel so defeated I have to look at the hints or solution. And I derive joy from the puzzle solving of troubleshooting when I am able to do that. Plus, I feel like if I don't get the fundamentals under my belt, I'll have no idea what I'm looking at when browsing Mozilla Developer Network or Stack Overflow or whatever other resources are out there. Nothing wrong with that. If you give it your best shot, and try really hard to find a solution before looking it up, there's no shame to be had. Stackoverflow is an amazing programming resource, and should be used when appropriate, but don't make the mistake of using Stackoverflow for everything, as a substitute for actual knowledge and understanding.
|
|
Legend
23,184 POSTS & 12,594 LIKES
|
Post by 🤯 on May 20, 2020 12:24:27 GMT
Feel like I need pics of this keyboard. I didn't know computer keyboard connoisseurism was a thing. After spilling coffee on mine though and having to deal with hammering sticky keys and waiting for them to unstick WHILE getting pwned by JavaScript... I'm now way more intrigued and understanding of the importance. www.diatec.co.jp/en/det.php?prod_c=757It is absolutely an extravagance, but it brings me Joy in the Marie Condo sense. Looks like a normal keyboard. What am I missing? Just that there's no coffee in the cracks?
|
|
God
7,176 POSTS & 5,662 LIKES
|
Post by iNCY on May 20, 2020 12:35:13 GMT
Looks like a normal keyboard. What am I missing? Just that there's no coffee in the cracks? It's a mechanical keyboard, a little click but not too clicky Look up mechanical keyboard on youtube, I think they make typing feel complete different. Keyboards was a big part of how I chose my laptop. It's a Lenovo Thinkpad X1 Extreme
|
|
Legend
IS OFFLINE
Years Old
Undisputed 2020 Poster of the Year
33,663 POSTS & 10,429 LIKES
|
Post by c on May 20, 2020 14:20:12 GMT
I got a Razer Blackwidow and love it. Bound the macro keys to open the programs I use most often, with alts for functions when I code. Lighted keys are great for working in the dark. Keys are clicky as fuck which I love. Bummed the new versions got rid of the 5 macro keys.
|
|
Legend
IS OFFLINE
Years Old
Undisputed 2020 Poster of the Year
33,663 POSTS & 10,429 LIKES
|
Post by c on May 20, 2020 14:42:35 GMT
For those interested, redragon has budget models now. Cherry MX-Blue switches for 40 bucks. Good way to see if a mech is right for you without going all in.
But yeah once you use a mech keyboard you will not want to go back. Moreso if you get used to one with reprogrammable or macro keys. Things like one key quick saving, opening programs with a key or even pasting code blocks with a key are pretty lifechanging IMO.
|
|
God
7,176 POSTS & 5,662 LIKES
|
Post by iNCY on May 20, 2020 16:05:53 GMT
For those interested, redragon has budget models now. Cherry MX-Blue switches for 40 bucks. Good way to see if a mech is right for you without going all in. But yeah once you use a mech keyboard you will not want to go back. Moreso if you get used to one with reprogrammable or macro keys. Things like one key quick saving, opening programs with a key or even pasting code blocks with a key are pretty lifechanging IMO. Cherry blues are noise machines. Any keyboard can record macros really. For my windows needs I downloaded Beeftext and it is life changing.
|
|
Strong Style Mod
USER IS OFFLINE
Years Old
Male
11,417 POSTS & 11,540 LIKES
|
Post by Emperor on May 20, 2020 16:32:49 GMT
Don't understand the appeal of mechanical keyboards and the clackety clack clack.
That said, I've never used one, but I have no objections to the feel of my normal keyboard, so don't have any particular desire to change.
|
|
Legend
IS OFFLINE
Years Old
Undisputed 2020 Poster of the Year
33,663 POSTS & 10,429 LIKES
|
Post by c on May 20, 2020 17:15:17 GMT
Some people like the clicks. But most mechs have silent options. The thing with mechs is they are super responsive and the keys have a much nicer feel to them, clicky or not.
And any keyboard use record macros, I prefer to have buttons I can bind that no program uses by default though to avoid having to use multikeys or overwrite something. But yeah, I also use autohotkey at times for macros and automation stuff in games. For gaming though I use a numberpad mouse and bind most stuff to the numberpad though so I do extensive remapping in games. Or when I program I remap the mouse keys to macros, then use the macros to call paste in the functions I commonly use.
|
|