5 ms·
The thing with Go is that I find the syntax very ugly to look at however it is so convenient to install, run, deploy, make performant applications.
by nassimsoftware 5y ago
The thing with Go is that I find the syntax very ugly to look at however it is so convenient to install, run, deploy, make performant applications.
- yannoninator 5y agowhy do you find it ugly?
- joshxyz 5y agoOne for me is the "if err" everywhere lol, but i like how it has great ecosystem like nodejs
- lokar 5y agoI have mixed feelings about the error handling. It is kind of boilerplatey, but I find myself stopping to consider how best to manage an error vs languages with exceptions.
- angelzen 5y agoTry Result + combinators + ? operator. https://learning-rust.github.io/docs/e6.combinators.html https://learning-rust.github.io/docs/e6.combinators.html https://learning-rust.github.io/docs/e5.error_and_none_propagation.html https://learning-rust.github.io/docs/e5.error_and_none_propa...
- ohCh6zos 5y agoI find the ecosystem lacking. The Go community seems to have settled on "Use the standard library" which is pretty unsatisfying unless you're engaged in a specific range of web-related tasks. Edit: I left out "engaged in" previously.
- nassimsoftware 5y agoAn example : for _, a := range albums { if a.ID == id { c.IndentedJSON(http.StatusOK, a) return } } is ugly compared to a much more readable : for a in albums: if a.ID == id: // the rest of the code or albums = append(albums, newAlbum) is ugly compared to albums.append(newAlbum) Edit : I have trouble formatting the code. How do you do this on HN ?` doesn't seem to work. Edit 2 : Fixed the formatting issue.
- fshee 5y agoSuperficial. You prefer no braces, no underscores, and no colon. Typing is cheap. I don't mind 'em. Your second example has more implied than syntactical gripes. albums = append(albums, newAlbum) implies immutability. I like that. The latter does not. I don't like that. Beauty is in the eye of the beholder.
- stolen_biscuit 5y agoCorrect, they were asked their opinion about why they think it's ugly, they gave it
- fshee 5y agoTrue. I seemed to have missed that and came off a tad rude doing so. Part of my opinion is now in the mix. :-)
- deepsun 5y ago> implies immutability. Except that implication is incorrect -- slices are mutable.
- Someone 5y agohttps://news.ycombinator.com/newsfaq.html https://news.ycombinator.com/newsfaq.html: What kind of formatting can you use in comments? http://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc: Text after a blank line that is indented by two or more spaces is reproduced verbatim. (This is intended for code.)
- rtoway 5y agoI'm not a Go fan but the language to me looks very readable and clean. However in my opinion syntax is usually not that important, you can and will get used to anything
- ronnier 5y agoThe thing that gets me is how time is handled, enums, no sets, no way to make variables final, the "make" syntax, could probably go on