3 ms·
> 1. CPAN was great 20 years ago, but it's a joke compared to modern dependency management systems. How so? I use npm/yarn daily and think they are mostly gian
by deckard1 7y ago
> 1. CPAN was great 20 years ago, but it's a joke compared to modern dependency management systems.
How so? I use npm/yarn daily and think they are mostly giant insecure playgrounds for teenagers with too much time on their hands. Browsing through node_modules on a large project is enough to make you give up software development and take up heavy drinking. Half the code I see in node_modules wouldn't pass a PR review at my own company. Yet we still depend on it daily.
> 2. Functions don't have explicit parameters, and still shift off of @_.
Never been a problem in my experience. The expected arguments are generally at the top of the sub. You must really not like functional programming then, with heavy use of curried functions and whatnot.
The bigger problem is with passing around an %options hash, and this is true of JavaScript as well, is that the keys can be easily mistyped leading to bugs. Not even TypeScript fixes this (because developers are generally horrible about defining types, which have to be defined perfectly).
- Grinnz 7y agoTo the second point, named parameters as implemented by Function::Parameters do provide this checking if you want it to. Named parameters was a planned feature for core signatures and hopefully it will have similar functionality.
- daotoad 7y ago1. Absolutely my experience. NPM is pain. 2. Whether you go positional or use an options hash, you still need to carefully unpack your args at the top of the subroutine. And do it consistently. There are a ton of libraries to help with this, too. The most important thing is to pick a house style and do it everywhere that doesn't need to be different.