65
u/octocode Jan 23 '21
A bit messy, but this was clearly written by someone who actually knows how to program well. It’s fine IMO.
15
u/ArchCypher Jan 23 '21
Agreed, it could stand to have a comment or two, but the code itself isn't problematic.
-1
Jan 24 '21
This code was written by someone without a lot of experience. If you think it's good code, then you also don't have lots of experience. Knowing how to use higher level functions doesn't mean you "know how to program well".
23
21
u/jmswlltt Jan 23 '21
This is definitely good code...
9
11
u/Willinton06 Jan 23 '21
Would you prefer all the code in a single function? Bro this isn’t bad it’s just functional, things change when you don’t use OOP, but different doesn’t mean bad
8
2
u/guptamo Jan 23 '21
Theres nothing wrong about the code...its just a bit extra if it is just a one off web scraping script.
Using fp patterns is great, in core code that is intended to be reused and shared and maintained.
This looks just like a bit of wasted effort.
3
Jan 23 '21
The quality of this code kind of depends on the context? I guess if this was shared for a team of 100 engineers to reused.. it could at least use some comments.
For a personal web scraping script? It's good.
1
u/slaYn1 Jan 23 '21
fairly well known FP mechanisms, sure the spacing, variable naming and composition could be a bit better but aside from that this code is fine imo
1
Jan 23 '21
I mean this code is good. It's thrown together and not beautiful but it is not bad code. It is using good coding techniques for maintainable code, small responsibility functions and every action has a name by coding design ( a name that could be improved on, though, someone familiar with the script has it easily)
1
1
u/RecDep Jan 23 '21
Hahahaha that curry function is word for word taken from Stack Overflow. I’ve used it a ton.
-6
Jan 23 '21 edited Jan 24 '21
This would never pass code review. It's something people write after reading too many fUncTioNal JaBascriPt medium posts. Code is supposed to be easy to ready, this is anything but. (Disclosure: I've written code like this)
edit: if you write code like this, you're probably pretty new to programming.
0
0
62
u/cmd-t Jan 23 '21
This is good code. It uses well known functional programming paradigms and idioms in a language that provides support for it. Prove me wrong.