Click here to Skip to main content
16,004,535 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralWordle 1,190 Pin
OriginalGriff11mins ago
mveOriginalGriff11mins ago 
GeneralI like questions Pin
honey the codewitch1 hr 59mins ago
mvahoney the codewitch1 hr 59mins ago 
Generaltest Pin
charlieg9hrs 54mins ago
charlieg9hrs 54mins ago 
GeneralRe: test Pin
charlieg9hrs 54mins ago
charlieg9hrs 54mins ago 
GeneralRe: test Pin
charlieg9hrs 52mins ago
charlieg9hrs 52mins ago 
GeneralRe: test Pin
OriginalGriff26mins ago
mveOriginalGriff26mins ago 
GeneralRe: test Pin
OriginalGriff25mins ago
mveOriginalGriff25mins ago 
GeneralRe: test Pin
Mike Hankey9hrs 40mins ago
mveMike Hankey9hrs 40mins ago 
GeneralRe: test Pin
charlieg3hrs 31mins ago
charlieg3hrs 31mins ago 
GeneralRe: test Pin
Mike Hankey3hrs 19mins ago
mveMike Hankey3hrs 19mins ago 
RantRe: test Pin
OriginalGriff23mins ago
mveOriginalGriff23mins ago 
GeneralI'm accidentally learning Zig Pin
honey the codewitch11hrs 7mins ago
mvahoney the codewitch11hrs 7mins ago 
GeneralRe: I'm accidentally learning Zig Pin
Mike Hankey10hrs 37mins ago
mveMike Hankey10hrs 37mins ago 
GeneralRe: I'm accidentally learning Zig Pin
honey the codewitch10hrs 36mins ago
mvahoney the codewitch10hrs 36mins ago 
GeneralRe: I'm accidentally learning Zig Pin
Mike Hankey10hrs 25mins ago
mveMike Hankey10hrs 25mins ago 
GeneralRe: I'm accidentally learning Zig Pin
honey the codewitch10hrs 21mins ago
mvahoney the codewitch10hrs 21mins ago 
GeneralRe: I'm accidentally learning Zig Pin
Mike Hankey9hrs 41mins ago
mveMike Hankey9hrs 41mins ago 
GeneralRe: I'm accidentally learning Zig Pin
honey the codewitch3hrs 9mins ago
mvahoney the codewitch3hrs 9mins ago 
GeneralRe: I'm accidentally learning Zig Pin
Ryan Peden9hrs 51mins ago
professionalRyan Peden9hrs 51mins ago 
To me, Zig is to C as Rust is to C++.

The thing with Zig's exception handling is that it doesn't really have exception handling. IMO Zig having try and catch keywords just makes things confusing. I like the idea behind what they do in Zig. They give you a nice way to do Golang-style error handling without needing to write if err != nil everywhere. But calling them try and catch can add confusion given what those keywords do in other languages. Having said said, I find Zig's try, catch, defer, and errdefer are a decent but not perfect way to deal with errors.

As for what's wrong with traditional try-catch exceptions, I imagine Zig's creator would argue they violate the language's "No hidden control flow" principle. Kind of the same argument Joel Spolsky made here 20ish years ago. As a member of the Golang dev team put it: "The reason we didn't include exceptions in Go is not because of expense. It's because exceptions thread an invisible second control flow through your programs making them less readable and harder to reason about."

It's really a matter opinion, of course. It's fine to prefer traditional exceptions, too.

As for why use Zig instead of something else: I suspect that's personal to the developer. Maybe they liked the simplicity and flexibility of C, but wanted more sophisticated metaprogramming and fewer footguns. It might be that Zig gave them the little bit of extra joy that was the difference between creating and not creating the project.

I've been there. Sometimes when you're feeling a bit burned out and jaded, trying a new language brings back that little spark of joy that reminds you of why you started programming in the first place, and inspires you to take on an ambitious project you might not have been otherwise been able to muster the energy for.
GeneralRe: I'm accidentally learning Zig Pin
honey the codewitch3hrs 14mins ago
mvahoney the codewitch3hrs 14mins ago 
GeneralBuilding a new desk and looking for a new mouse pad... Pin
Mike Hankey16hrs 34mins ago
mveMike Hankey16hrs 34mins ago 
GeneralRe: Building a new desk and looking for a new mouse pad... Pin
MarkTJohnson16hrs 29mins ago
professionalMarkTJohnson16hrs 29mins ago 
GeneralRe: Building a new desk and looking for a new mouse pad... Pin
Jeremy Falcon16hrs 18mins ago
professionalJeremy Falcon16hrs 18mins ago 
GeneralRe: Building a new desk and looking for a new mouse pad... Pin
Mike Hankey16hrs 1 min ago
mveMike Hankey16hrs 1 min ago 
GeneralRe: Building a new desk and looking for a new mouse pad... Pin
Jeremy Falcon15hrs 50mins ago
professionalJeremy Falcon15hrs 50mins ago 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.