3 ms·
I feel this way about optional function parameters. They have a tendency to proliferate, because you don't break existing code by adding them, and they're alway
by lalaithion 7y ago
I feel this way about optional function parameters. They have a tendency to proliferate, because you don't break existing code by adding them, and they're always optional.... until you have https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC https://scikit-learn.org/stable/modules/generated/sklearn.sv..., where you have 15 optional parameters.
- dgritsko 7y agoRelevant XKCD: https://xkcd.com/1168/ https://xkcd.com/1168/
- chubot 7y agoThe way I remember tar syntax is to use it more like a "normal" command. That is, instead of the convenient but cryptic idiom: tar xvf foo.tar.gz # extract, verbose, file I use the longer but more readable stream idiom: tar -x -z < foo.tar.gz tar --verbose -x --xz < foo.tar.xz (It does force you to specify -z for gzip or --xz for .xz, but I'm OK with that redundancy in the name of readability.) This makes it easier to remember the syntax for create and list too: $ tar --create e.txt k.txt > out.tar $ tar --list < out.tar e.txt k.txt That's how I write the install instructions for Oil: https://www.oilshell.org/release/0.8.pre2/doc/INSTALL.html https://www.oilshell.org/release/0.8.pre2/doc/INSTALL.html ----- So basically tar can behave normally (at least GNU tar can) -- it's just that there's an ancient idiom that most people have in their fingers, and that's copied around in various instructions. The nice thing about the verbose way is that the hyphen prefix enables autocomplete.
- jcelerier 7y agoI prefer my mnemonics : tar caf foo.tar.gz foo/ bar/ # Compress As Fuck tar xaf foo.tar.gz # Xtract As Fuck
- blt 7y agoNone of those SVM parameters stick out as obviously unnecessary to me. What alternative do you propose for functions that have many minor variants with a large common core, and many hyperparameters?