[go-nuts] Re: scripting in Go

2022-01-27 Thread Christoph Berger
Thanks for adding a long-name variant! Indeed I feel the code is much more self-documenting this way. But in the end it is only a matter of getting used to an API. Power users of "sc" will certainly be able to read the original short-name variant without problems. On Thursday, January 27, 2022

[go-nuts] Re: scripting in Go

2022-01-26 Thread eko...@gmail.com
I made a second variant in a separate repo/module: https://pkg.go.dev/github.com/egonk/scr The function names are more descriptive, Printf wrappers were removed and it is not meant to be used as a dot import anymore. On Monday, January 24, 2022 at 12:32:48 PM UTC+1 eko...@gmail.com wrote: > sc

[go-nuts] Re: scripting in Go

2022-01-26 Thread eko...@gmail.com
Good ideas, I added explanations for the shorthands: https://github.com/egonk/sc/commit/257d48f5ba187082ffb6a9b8b9d326eca26cb787 W or Wrap comes from the classic errors.Wrap (https://github.com/pkg/errors) Long forms might be added in a different package in the future (like github.com/egonk/sc

[go-nuts] Re: scripting in Go

2022-01-25 Thread Corin Lawson
For my money, as a newcomer to the API, having both the long named function and the shorthand would be useful. I can see myself using M immediately, but some like W I'm not likely to remember as readily and longer names would help in adopting the library. (Also, what is the mnemonic for W?)

[go-nuts] Re: scripting in Go

2022-01-25 Thread eko...@gmail.com
Thanks for the feedback! I can't say I disagree and I half expected the points you mentioned. Out of all the wrappers, P and PE admittedly give the least value. I placed more weight on these factors: - compared to the deployed production code that I'm working with (basically carved in stone and

[go-nuts] Re: scripting in Go

2022-01-25 Thread Christoph Berger
Thanks for sharing your package. To me it seems that the functions are rather shallow wrappers around other single functions from the standard library (e.g., sc.P() maps 1:1 to fmt.Printf()). You certainly save a couple of keystrokes while *writing* a script this way, but on the other hand, *re