News for hackers. Stuff that matters.
Re:I want off Mr. Golang’s Wild Ride (2020) by Jyaif on Thursday April 28, 2022 @02:31PM (#31196349)
Can you see the value in being able to create software more quickly, at the expense of the software's stability?
Re:I want off Mr. Golang’s Wild Ride (2020) by kaba0 on Thursday April 28, 2022 @02:42PM (#31196501)
Yes, but that is definitely not achieved by checking for errors every second line.
Re:I want off Mr. Golang’s Wild Ride (2020) by philosopher1234 on Thursday April 28, 2022 @02:49PM (#31196619)
I think checking for errors every line makes my go programs easier and faster to produce at a higher level of quality.
Re:I want off Mr. Golang’s Wild Ride (2020) by valand on Thursday April 28, 2022 @10:48PM (#31200815)
Some languages achieve error checking by type transforms and pattern matching, which are much more effective and efficient than error checks after every function call
Re:I want off Mr. Golang’s Wild Ride (2020) by chrisoverzero on Friday April 29, 2022 @10:20AM (#31205479)
Sure, but is writing the error check by hand what creates the benefit? Or is it having the error check?
Re:I want off Mr. Golang’s Wild Ride (2020) by lanstin on Saturday April 30, 2022 @03:10PM (#31218397)
It is thinking about what to do for each operation that can fail. This thought is what separates the applications that recover when the network glitch is over vs. the applications that need to be restarted.
Re:I want off Mr. Golang’s Wild Ride (2020) by lanstin on Saturday April 30, 2022 @03:09PM (#31218386)
The value here is the few seconds of human attention given to the error at hand. The thought is irreplaceable. Like others mention, 90% of the, end up if err != nil { return nil, err } but thinking about it will, in my experience, make the system more robust to failure. At the very Least for your process you will decide on a goal of carrying on in the face of failures and repairing when things work again vs. just bailing out and letting something else worry about it.
Re:I want off Mr. Golang’s Wild Ride (2020) by kaba0 on Saturday April 30, 2022 @04:46PM (#31219160)
What if the return nil, err was the sane choice at the time of writing but there are changes downstream that mandate a new error handling mode there? Also, there are plenty of “writing this code at 3AM” where I would question the validity of such thoughts.
Re:I want off Mr. Golang’s Wild Ride (2020) by sph on Thursday April 28, 2022 @03:07PM (#31196834)
No, the compiler needs to save us from ourselves. What if we get a runtime nil? Oh God, the horror!

I understand correctness, I do not understand why we're making languages a nanny state where if we're not completely focused on correctness and zero copy interfaces it's not worth using.

I don't want to always care about memory allocation strategies when I want to have some fun on a project. I don't understand why a vocal group tends to dismiss some languages because they're not always doing the PERFECT thing.

Re:I want off Mr. Golang’s Wild Ride (2020) by jokethrowaway on Thursday April 28, 2022 @04:02PM (#31197503)
I used to prototype in PHP and nowadays I prototype in JS.

I also ship JS in production and it's a painful experience compared to rust or haskell.