Skip to content

u/Select_Prior_2506

In this archive from Jul 2022 to Sep 2024

0
posts
38
comments
0
media
109
score

Top comments

I use them when it goes over two arguments sometimes. It helps the code review for me. Jetbrains doesn't have issues with renaming arguments appropriately so named calls don't break.

I like having each named argument on a separate line. It looks neat, readable, and I haven't had a misordered argument recently.

The feature is rather new; so don't quote me on this. I might run into some problems at some point. So far it's been good.

12 points

I acknowledge your work, and here are some things to look into:

  1. Line 21: The iterable is mixed? And then iterablity is checked loosely as an assertion? It probably could have been a bit more type strict.
  2. Line 21: Would be nice to use a generic phpdoc for T of iterable in arg, and then generator T type.
  3. Line 26: Usage of md5 is highly questionable. Md5 is not a cheap function.
  4. Line 63: I personally would use sprintf instead of multiple echos
  5. IO(or rather output) buffering is not considered. Meaning if you print progress on a low-computation loop, your output might introduce significant lag to your main loop.
  6. Line 12: I'd use phpstan array shape for $stack
  7. Line 28: Missing consistent style: I see a sneaky space missing near the end.
  8. Missing tests: Tests not only tell the users that your package works, but also acts as an extensive documentation for your use cases.
  9. You might wanna refactor your main wrap function and Extract Method to reduce the cognitive load of the code in that section.

If I missed something, pardon.

10 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.