The net.dialer solution you mention uses a struct which does not simplify.
How does this get programmers out of the add another function mentality?
GOLANG and C/C++ programmers have the same solution because it's not
convenient to use a struct. Compare charts in C++ versus JavaScript. C++
solution chose to implement 1,000 functions instead of using the struct as
you suggest. JavaScript looked to the future and implemented it using the
method that I'm proposing for GOLANG. The method I'm suggesting is so easy
and convenient that people use it as seen with chartjs.

Ask yourself why os.open() has remained unchanged since the beginning
instead of expanding to include new features. Adding new features is
extremely inconvenient. Using a struct is inconvenient.  Let's just add
more functions.

On Wed, Aug 16, 2023 at 9:14 PM Axel Wagner <axel.wagner...@googlemail.com>
wrote:

> Have a look at net.Dialer <https://pkg.go.dev/net#Dialer>. It is
> essentially a struct that adds optional, keyword arguments to net.Dial
> <https://pkg.go.dev/net#Dial>.
>
> On Thu, Aug 17, 2023 at 3:44 AM Jon Perryman <jon.perry...@gmail.com>
> wrote:
>
>> Struct does not solve the basic problem. In what way are you suggesting
>> to solve the described os.open() changes? Should each API be seperate from
>> os.open where it must be used with every read/write?
>>
>> On Wed, Aug 16, 2023 at 6:14 PM Kurtis Rader <kra...@skepticism.us>
>> wrote:
>>
>>> Personally, and I say this as a happy user of Python, I dislike keyword
>>> parameters. Note that in Python keyword parameters are (or should be)
>>> seldom used for anything other than optional arguments. And if your API has
>>> so many parameters that they need names the API probably needs refactoring.
>>> Alternatively, pass a struct whose contents can be initialized using the
>>> struct member names.
>>>
>>> On Wed, Aug 16, 2023 at 6:04 PM Jon Perryman <jon.perry...@gmail.com>
>>> wrote:
>>>
>>>> Do you feel your GOLANG API implementations allows your API's
>>>> and functions to evolve and grow? Personally, positional args has pissed me
>>>> off for years when a proven simple solution has never been adopted by most
>>>> Unix programming languages (except Javascript). Most notably, it's missing
>>>> from GOLANG.
>>>>
>>>> Everyone here understands and uses os.open from the os package.  For
>>>> argument's sake, let's say os.open() is your responsibility to integrate
>>>> nosql, memory files, compression, encryption, btree, key indexed files and
>>>> more. How do you modify os.open( ) to integrate these file related
>>>> features? This was solved years ago in languages not used in Unix
>>>> using keyword arguments that also included positional. For example:
>>>>
>>>> func os.open(name string, memoryfile= bool, compress= bool, btree{
>>>> btree_optons string }, encrypt{ key= string }, nosql{ nosql_options string
>>>> } ) (*File, error)
>>>> os.open('myfile.txt', encrypt{ key='abc' }, compress=true)
>>>>
>>>> The os.open args 1, 3 and 5 would be set from the specified arguments.
>>>>
>>>>  Is this something that others need and I should pursue or should I
>>>> just forget it? Proposal https://github.com/golang/go/issues/62078 was
>>>> closed with "I don't see anything concrete being proposed here.". If I
>>>> should pursue this, should I reword it or reduce it to this Email?
>>>>
>>>> Thanks, Jon.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "golang-nuts" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to golang-nuts+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/golang-nuts/CAByJhJnkuai27VNiE6PraU9-5hoO85Hm__0UQJrT75a7KqD8uw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/golang-nuts/CAByJhJnkuai27VNiE6PraU9-5hoO85Hm__0UQJrT75a7KqD8uw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> Kurtis Rader
>>> Caretaker of the exceptional canines Junior and Hank
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/CAByJhJnTVs-gkQqnFtQ-kvJ%2Bqhnehij13hDh7yv4AoAXuxvKLg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/golang-nuts/CAByJhJnTVs-gkQqnFtQ-kvJ%2Bqhnehij13hDh7yv4AoAXuxvKLg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAByJhJ%3DLwohV72di0ybDsUQqtc_9WAOMTh9p%3Ds09q%2Bqnjy6eFg%40mail.gmail.com.

Reply via email to