News for hackers. Stuff that matters.
Re:Git's list of banned C functions by maerF0x0 on Thursday March 04, 2021 @04:19PM (#26348498)
Not that I dont believe there are any, but I'd love to hear your perspective...

Go (golang)

Re:Git's list of banned C functions by boolemancer on Thursday March 04, 2021 @05:54PM (#26349652)
defer having function scope instead of, well, scope scope.

Using defer to unlock locks can lead to some fun deadlocks if you don't realize the issue with the scope, and it's completely unintuitive to someone with experience with other implementations of similar concepts.

Re:Git's list of banned C functions by crimper on Thursday March 04, 2021 @04:59PM (#26349016)
channel programming and the races caused by closing channels. channels seem nice and easy until they don’t.

the whole var/:=/= assignment combined with the error handling style and the shorthand is another one

Re:Git's list of banned C functions by dpatterbee on Thursday March 04, 2021 @05:28PM (#26349357)
Only close channels when trying to tell the receiver that you're not sending more data. Otherwise let the garbage collector deal with it. Channels seem easy until they don't until they do again in my experience.

Don't understand your second point.

Re:Git's list of banned C functions by maerF0x0 on Thursday March 04, 2021 @05:26PM (#26349334)
yeah the lack of determinism in selecting a channel can be tricky for causing bugs where order matters. Luckily in smaller cases you're likely to encounter them as flakey tests (eg 1/2 the time)

   select {

       case <-ch1:

       case <-ch2: 
    }
Re:Git's list of banned C functions by crimper on Friday March 05, 2021 @12:56PM (#26359761)
thanks for this, i couldn’t articulate it so clearly. Another gotcha is responding to closed channels, it makes sense in the grand scheme of things but when the program grows it gets tricky
Re:Git's list of banned C functions by SavantIdiot on Thursday March 04, 2021 @04:47PM (#26348862)
Well, shit. Got me there.