Exactly. The world figured out long ago that OO and it’s principles are a 
better way to go. The fact that Go is not OO doesn’t make it bad or not useful 
- but the proponents of that state doesn’t make it better. 

> On Sep 22, 2022, at 7:58 PM, burak serdar <bser...@computer.org> wrote:
> 
> 
> 
> 
>> On Thu, Sep 22, 2022 at 6:30 PM Robert Engels <reng...@ix.netcom.com> wrote:
>> I would like to understand the reason to type assert but not cast? That is 
>> an OO design flaw.
> 
> You can only type-assert an interface. With type-assertion, you are either 
> checking if the underlying value of an interface is a specific type, or if 
> the value underlying the interface also implements a different set of methods.
> 
> And Go isn't OO.
>  
>> 
>>>> On Sep 22, 2022, at 7:24 PM, burak serdar <bser...@computer.org> wrote:
>>>> 
>>> 
>>> 
>>> 
>>>> On Thu, Sep 22, 2022 at 6:08 PM Robert Engels <reng...@ix.netcom.com> 
>>>> wrote:
>>>> 100% true. The difficulty when examining a “large” system is that it 
>>>> becomes very difficult to understand the relationships. Documentation can 
>>>> help but it is not a great substitute for automated tools. 
>>>> 
>>>> In Java - actually all of OO - type casting is severely frowned upon - but 
>>>> it seems a lot of Go code does it liberally. 
>>>> 
>>>> If I designed a language today I would prohibit any type casts.  It is a 
>>>> huge problem and points to insufficient design skills.
>>> 
>>> Type-assertion is not exactly type-casting, though. And Go isn't exactly 
>>> OO. 
>>>  
>>>> 
>>>> 
>>>> > On Sep 22, 2022, at 6:57 PM, Ian Davis <m...@iandavis.com> wrote:
>>>> > 
>>>> > On Thu, 22 Sep 2022, at 11:27 PM, Rory Campbell-Lange wrote:
>>>> > 
>>>> > I just wanted to respond to this part:
>>>> > 
>>>> >> I suppose my question is (and forgive me if this is a terrifically 
>>>> >> naive), how can one negotiate the go landscape of commonly used modules 
>>>> >> to re-utilise, where possible, a more commonly named interface 
>>>> >> implementing "Speak()" or convertible to provide "Speak()"?
>>>> >> 
>>>> > 
>>>> > Generally, when writing Go, the consumer of the object defines the 
>>>> > interface it requires. So rather than you looking for interfaces that 
>>>> > might exist in the wild, it's better to focus on your application and 
>>>> > its needs. If you have a component that uses the Speak method on objects 
>>>> > then define that as an interface that your component can accept. Any 
>>>> > other user of your component can see that interface is needed and 
>>>> > provide a suitable object that implements it or create a shim to adapt 
>>>> > one.
>>>> > 
>>>> > 
>>>> > -- 
>>>> > 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/1fb8a3c4-b135-4ab1-b969-d6f4c239b7d9%40www.fastmail.com.
>>>> 
>>>> -- 
>>>> 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/C0D7D21F-AC72-40E3-9DB9-A8678886CDF3%40ix.netcom.com.
>>> 
>>> -- 
>>> 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/CAMV2RqooGmOaXCGmriJ%2BDryYSSLNRmcrc9hfSTcWG-qPGAonxw%40mail.gmail.com.
> 
> -- 
> 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/CAMV2RqrouRZrUMPxwu16xCjS_L_0SQYgS8AaWJKEZ6JWwpFGUg%40mail.gmail.com.

-- 
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/FDB3BDAB-F536-4B67-98B9-4ECAFA7B10FC%40ix.netcom.com.

Reply via email to