2 ms·
The kind with objects that have methods. Look at the examples. They don't have a class hierarchy, but they have something very similar to Go where a data type
by alphazard 4y ago
The kind with objects that have methods.
Look at the examples. They don't have a class hierarchy, but they have something very similar to Go where a data type (object) "owns" a set of procedures (methods).
https://ziglang.org/learn/samples/ https://ziglang.org/learn/samples/
`try int_queue.enqueue(25);`
Go has a pretty sane approach to OOP, with methods forming the basis for interfaces (one of Go's most powerful concepts) very nicely. But Go is not really a C replacement. I know Rob Pike said they "started with C", but realistically Go replaced Java in its niche. It's not a C replacement in the way that Zig and Odin are.
- TUSF 4y agoI don't really see this as OOP. It's just sytax sugar.