5 useful features you won’t be seeing in Go
After 12-plus years in the wild, the Go language is now firmly established as a tool for professional programmers and for building large-scale systems. Although Go is deliberately spare, clean, and efficient, requests for certain features bubble up time and again, even if on closer inspection those features run counter to Go’s underlying philosophies or design goals.Here are five commonly requested features in Go, all of which you’re not likely to see, or which will only show up in a form that complements the rest what's in Go now. [ Also on InfoWorld: 6 Git mistakes you will make — and how to fix them ] Ternary operator Many languages have a construction that is essentially an if/then/else block in a single statement. For example, in Python we can write, x = 1 if condition else 0, or in JavaScript we can write, x = condition ? 1 : 0.To read this article in full, please click here
After 12-plus years in the wild, the Go language is now firmly established as a tool for professional programmers and for building large-scale systems. Although Go is deliberately spare, clean, and efficient, requests for certain features bubble up time and again, even if on closer inspection those features run counter to Go’s underlying philosophies or design goals.
Here are five commonly requested features in Go, all of which you’re not likely to see, or which will only show up in a form that complements the rest what's in Go now.
Ternary operator
Many languages have a construction that is essentially an if/then/else
block in a single statement. For example, in Python we can write, x = 1 if condition else 0
, or in JavaScript we can write, x = condition ? 1 : 0
.