Replies: 3 comments 4 replies
-
In Go, it's a more complex thing, as you have to define the fields of the struct before you assign values. The V example does both in one step, defining the fields and their values at once. I don't see this as any more confusing than using anonymous structs in the first place. |
Beta Was this translation helpful? Give feedback.
-
I like the direction vlang is taking. Unlike golang, vlang is establishing itself as a concise language, and that is what front-end developers, like me, need. I would love to be able to use vlang on the web in the future, just like I do now with TypeScript. |
Beta Was this translation helpful? Give feedback.
-
@gchumillas exactly, V is more concise than Go. @Wajinn like @JalonSolov said, anonymous structs are already in the language, and this just makes using them less verbose. |
Beta Was this translation helpful? Give feedback.
-
The announcement and example on twitter (X), creates obvious questions (see below for example). Of course the type can be inferred (V convenience), but a function of no known type was given in the example. Why was that presented? This seems to create unnecessary confusion.
Comparatively, a Go example was given, showing how they are explicit. Arguably, that's done to avoid sloppy coding and mistakes, as those reading the code would be clear on what's being done. However, the Go way is arguably redundant and possibly less convenient.
Interested in the views of others on this.
Beta Was this translation helpful? Give feedback.
All reactions