3 ms·
Named parameters came from Smalltalk, and no explanation I give can equal the sheet beauty of reading smalltalk code. I'm not sure I could devise a full explan
by flerovium 5y ago
Named parameters came from Smalltalk, and no explanation I give can equal the sheet beauty of reading smalltalk code.
I'm not sure I could devise a full explanation, but a concise example is in scientific libraries for functions like, `run_simulation(data, optimizer = "Lebesque", shearing_algorithm = "Neue", spline_intensity = "Forrester")`. The number of options can be very large.
- cfcosta 5y agoOh, smalltalk is neat, indeed, but would need both optional and named arguments at the same time to get the same effect, right? Would still make sense to you to get one without the other? I think optional is much more possible than named :P