elvlysh
Re:Good-bye core types; Hello Go as we know and love it
on Thursday March 27, 2025 @09:06PM (#43500226)
> You may as well use exception handlers if you're going to go there.
I didn't know about this trick, thanks for sharing.
Re:Good-bye core types; Hello Go as we know and love it
on Thursday March 27, 2025 @06:36PM (#43499015)
Yes, and all are equally offensive to the average Go hater, all of them have NULL, and all of them have terrible error handling. It's not "argument from popularity", it's "argument from success". Some things succeed. Other things don't. It would be worthwhile for you to investigate why things succeed despite all the hangups you have with their flaws instead of lamenting them because the things you like aren't succeeding.
Re:Good-bye core types; Hello Go as we know and love it
on Thursday March 27, 2025 @03:36PM (#43497246)
>Abstractions make large systems easier to understand, not harder.
I raise you AbstractSingletonFactoryProxyBean.
Re:Good-bye core types; Hello Go as we know and love it
on Thursday March 27, 2025 @03:31PM (#43497199)
You can do something like this:
type errHandler struct {
err error
}
func (eh *errHandler) getFirst() string {
// stuff
if err { eh.err = err }
return result
}
func (eh *errHandler) doWith(input string) string {
if eh.err != nil {
return ""
}
//stuff
if err { eh.err = err }
return result
}
func (eh *errHandler) doFinally(input string) string {
if eh.err != nil {
return ""
}
//stuff
if err { eh.err = err }
return result
}
func (eh *errHandler) Err() error {
return eh.err
}
func main() {
eh := &errHandler{}
first := eh.getFirst()
second := eh.doWith(first)
final := eh.doFinally(second)
if err := eh.Err(); err != nil {
panic(err)
}
}
Re:Good-bye core types; Hello Go as we know and love it
on Thursday March 27, 2025 @08:51AM (#43493071)
How come a reinvention of a 30 year old wheel is more successful and popular than pretty much every language that attempted to evolve the wheel during that time?
"It's because people who like Go are stupid and companies need stupid people to write stupid code" may have made you feel smug and secure during the last 15 years, but what about the next 15? Or the 15 after that? Are you still going to be complaining about the stupid 70 year old wheel made by that dumb guy Pike that you hate so much?
Re:Good-bye core types; Hello Go as we know and love it
on Thursday March 27, 2025 @08:28AM (#43492871)
Pretty much every reputable computer scientist has been saying for the last 70 years that the most important thing in the entire world is simplicity and ease of understanding.
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:58PM (#43489678)
Compactness is in the eye of your beholder. You might have the eyes of a spider, but I have the eyes of a large orc.
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:56PM (#43489665)
"bad" ideas? Really? Are you so sure? Are your ideas really any better? What language have you made that has seen more success than Go? Clearly if they did such a bad job it would be easy for you to fix it all up and tell everyone about it.
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:11PM (#43489408)
> Do this call
value, err := function()
> if there is an error return it
if err != nil { return err }
> otherwise give me the value
// rest of the code goes here
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:08PM (#43489389)
So you would prefer to write match result => error instead of if err != nil? Excuse me for not being convinced that this isn't just fussing over syntax.
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:07PM (#43489380)
More like you ignore the existing work that Go itself is built on.
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:03PM (#43489355)
More than one person designed the language than Pike, you know. He's retired. Maybe you can find another member of the devteam to pick on?
Re:Good-bye core types; Hello Go as we know and love it
on Wednesday March 26, 2025 @09:02PM (#43489342)
I don't really agree. I find Iota perfectly serviceable.