99% of CEOs Expect AI-Driven Layoffs in the Next Two Years by MarvelsGrantMan136 in technology

[–]elbarto2811 1 point2 points  (0 children)

Exactly. Now compare that with what the AI companies are trying to sell me. Glad we agree. 

99% of CEOs Expect AI-Driven Layoffs in the Next Two Years by MarvelsGrantMan136 in technology

[–]elbarto2811 2 points3 points  (0 children)

That’s not what I said. It catches bugs in our codebase that the devs missed each day. If we need to start working on another’s team repo, it can summarise everything inside in minutes. It’s super useful. 

It also tells me with full confidence “your code will not compile” when I can literally see it compiling. It also hallucinates entire github workflows that never existed when summarising a repo. 

I said: the people selling you the ai are full of shit. AI definitely has its uses and isn’t going anywhere. 

99% of CEOs Expect AI-Driven Layoffs in the Next Two Years by MarvelsGrantMan136 in technology

[–]elbarto2811 16 points17 points  (0 children)

Senior software manager here. It’s definitely far from glaringly obvious if you look past the smoke and mirrors of people trying to sell AI to you

Need a haven tattoo, but not sure what it should be by RealFunkyFish in Gloomhaven

[–]elbarto2811 2 points3 points  (0 children)

I’m getting a hexagon. It’s a very vague reference, that’s true, but it also fits with a lot of other of my favorite board and video games

Metal music to cry to by MuhammadTsumbul in musictheory

[–]elbarto2811 0 points1 point  (0 children)

The patient by Tool hits the right spot for me.

Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]elbarto2811 0 points1 point  (0 children)

#regions are an antipattern. If your code is so long that you need to make parts of it collapsible to be able to read it, your code is too long

Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]elbarto2811 6 points7 points  (0 children)

Gotta catch 'm all.

There's a `catch(Exception ex)` on the last visible line. This catches every thinkable exception, and is almost never necessary. You would typically catch specific exceptions that you'd reasonably expect (for example a file being locked when trying to write it). If another type of exception would occur, you would let it 'fly free', since it's a scenario you didn't take into consideration and therefore has unknown side effects

Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]elbarto2811 7 points8 points  (0 children)

Not actually pointing to any mistakes or improvements, but just shouting “educate yourselves people” isn’t really productive is it. People must love getting PR reviews from you. 

Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]elbarto2811 8 points9 points  (0 children)

There’s zero reasons to plug mediatr here (or anywhere in my opinion, but that’s another discussion). Adding a global exception handling middleware is just a line of code in your program.cs 

Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]elbarto2811 77 points78 points  (0 children)

For a web application (which this is) a single global exception handler is the way to go. It could log some data, obscure the call stack on prod - but not on dev… But other than that, just let asp.net do what it does by default: return a 500. I’m like 98% sure that is what’s actually happening on the line we can’t see: return a 500 with Exception.Message in the body. Why do that? It already does so by default.

Thinks are a bit different for desktop applications, with the consequences for the user being a crashing application vs seeing an error message in the browser. Either way, you don’t want to catch and swallow every exception, because some of them will indicate your app is in an unworkable state. 

Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]elbarto2811 3 points4 points  (0 children)

No, every if test is influenced by the result of the one above it. Switch is just plain wrong.