this post was submitted on 29 Aug 2023
17 points (94.7% liked)
General Programming Discussion
7789 readers
7 users here now
A general programming discussion community.
Rules:
- Be civil.
- Please start discussions that spark conversation
Other communities
Systems
Functional Programming
Also related
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Oh yeah all the time. Its what taught me to RTFM because in higher languages like JS or Python there typically already is a built-in function to manipulate basic types like arrays and strings, so my goal is usually to exhaust the API reference for a certain object and google around before committing to writing my own for-loop to iterate over an array.
But props on your code! It is very legible which is always the best place to start at before optimizing. Write legible code and when you're sure there are no more features you need to add then start optimizing.
Problem with RTFM for me is I always forget what I had read the next day, how do you remember what you read?
I look up the exact behavior of some basic Kotlin collection lambdas all the time. Does filter return elements with true or false lambda return value? I'll just Google it instead of relying on my memory.
That's the neat part, you don't! Don't have to remember shit, just look it up again.
Facts, you made a good point.
You have to try and remember the primitive operations available. Say you want to check if any array element matches a predicate. This is a basic operation that's abstracted for almost every language. If we look for "JS array any", we'll get the right function as an MDM result (
some
). And this works for almost anything. Just try to describe the operation in simple terms and google - you'll quickly find the function you need, and after some time it will become easier and easier :)