Anonymous
8/3/2025, 6:06:16 PM
No.106127609
[Report]
>>106127658
you can skip the error checking in go as well its the same everywhere.
>another thread by an underaged nocoder who doesn't like handling errors because it looks ugly so he thinks its not important
>>106127609
>>106127651
its 2025
i want the computer to take care of that shit for me
>>106127651
Anyone saying this unironically should be beheaded for criticizing Java's verbosity.
Anonymous
8/3/2025, 6:15:03 PM
No.106127693
[Report]
>>106132359
>>106127417 (OP)
This is a great feature of Go as it actually makes you think about how to handle error cases instead of just blowing up. The nice second order effect is that it filters low quality develops (jeets specifically).
Anonymous
8/3/2025, 6:15:54 PM
No.106127701
[Report]
>>106131594
>>106127686
java is just too verbose. whine about go's error handling all you want, at least i don't have to write a piece of scripture every time i want to make a new class.
No reason to use go when C# with AOT and channels exists
>>106127417 (OP)
The snippets for all the other languages are just ignoring errors, you can do that in Go too.
Anonymous
8/3/2025, 6:25:26 PM
No.106127797
[Report]
>>106127816
>>106127658
if the computer does it for you youre not programming
Anonymous
8/3/2025, 6:26:54 PM
No.106127815
[Report]
>>106127853
The difference is the Go code requires an explicit crash while the other examples will crash automatically due to the unhandled exceptions. Isn't there a way to map the JSON to a struct in Go anyway, skipping a lot of these checks, or is that inappropriate here?
Anonymous
8/3/2025, 6:26:57 PM
No.106127816
[Report]
>>106132134
>>106127797
yes i am
i am the creator
and if my shit has errors i want computer to catch them and tell me where they are so i can work on fixing them
Anonymous
8/3/2025, 6:27:23 PM
No.106127824
[Report]
>Go babies don't know about null aware syntax
Anonymous
8/3/2025, 6:27:41 PM
No.106127827
[Report]
That's why I love Go, I handle errors and wrap them with meta info and debugging is a breeze with a stack trace
>>106127783
Isn't panic(err) essentially just "throwing" the error?
Anonymous
8/3/2025, 6:29:44 PM
No.106127850
[Report]
>>106127867
>>106127831
no
panic is just for unexpected fatal shit
Anonymous
8/3/2025, 6:30:32 PM
No.106127853
[Report]
>>106127815
Yes it can, the stdlib json package can parse json for you using struct tags.
OP is a jeet and it shows, never use (((blogs))) instead visit the official go website for the one source of truth in how to use the language.
>>106127783
They aren't "ignoring" the error, they're propagating the error to the caller without modifying it. Yes, you can do that in go as well... as the code sample clearly shows.
Anonymous
8/3/2025, 6:31:43 PM
No.106127867
[Report]
>>106127850
Ah, so basically the same as letting a console program in an exception based language crash without catching anything
Anonymous
8/3/2025, 6:32:26 PM
No.106127871
[Report]
>>106127910
>>106127831
Yes but better handling would require the same amount of lines.
My point is that the other languages are just doing print(result) below the call, and you can make the Go snippet as short as the others by doing print(res, err) without an if
Anonymous
8/3/2025, 6:34:58 PM
No.106127903
[Report]
>>106130066
>>106127856
>they're propagating the error to the caller
Which will have to handle it by writing more code, that is not shown there.
Anonymous
8/3/2025, 6:35:22 PM
No.106127910
[Report]
>>106127871
or you could just _ blank the err and pretend like it doesnt exist
Anonymous
8/3/2025, 6:36:46 PM
No.106127923
[Report]
>>106130066
>>106127856
>they're propagating the error to the caller without modifying it.
What a crock of shit. They're throwing invisible exceptions. It only "propagates" if you bother to handle it. Or you crash.
Anonymous
8/3/2025, 6:37:32 PM
No.106127935
[Report]
>>106127417 (OP)
Go is bad because handling errors is bad?
>>106127417 (OP)
thanks for proving why Go is used in production cloud systems
We're currently hiring Gochads, remote USA.
https://job-boards.greenhouse.io/runpod/jobs/4142227008
Anonymous
8/3/2025, 7:59:21 PM
No.106128670
[Report]
>>106128550
nobody sane would want to work with americans
yes you pay more than europeans but its not worth it if the price is to deal with americans, american boss and american managers and soullessness
Anonymous
8/3/2025, 8:08:42 PM
No.106128766
[Report]
>>106130894
still makes more sense in most cases than try catch. try catch is generally faster when no errors are thrown, but it feels gross to write them. i write a lot of c++ and i wrote a templated container that
behaves a lot like go error handling. it behaves like an std::optional when it contains a value, but if it does not contain a value it contains an error which can be accessed with a method. it is essentially a wrapper for std::variant that cleans up the boiler plating.
Anonymous
8/3/2025, 8:30:01 PM
No.106128978
[Report]
>>106128984
>>106127658
so fork it and add the feature you want?
Anonymous
8/3/2025, 8:30:54 PM
No.106128984
[Report]
>>106128978
computer is not open source
Anonymous
8/3/2025, 10:03:15 PM
No.106129956
[Report]
>>106129126
desu there are a lot of autists here who would fit the personality required of a cloud infra/systems engineer
Anonymous
8/3/2025, 10:13:22 PM
No.106130066
[Report]
>>106137707
>>106127903
which can handle all the errors with a single try catch, which is roughly the same amount of code as a single go error check, or propagate it to their caller with zero additonal code, whereas go will need yet another if err != nil dance
>>106127923
>It only "propagates" if you bother to handle it. Or you crash.
you have a global exception handler in your main loop which reports the error. Same as what happens after the long chain of if err != nils in go.
Anonymous
8/3/2025, 10:21:17 PM
No.106130176
[Report]
>>106127417 (OP)
Go only looks more verbose when you're not properly handling every single error like you should. The equivalent would be putting each line inside a try catch block, what's wrong with err != nil instead?
Anonymous
8/3/2025, 11:02:07 PM
No.106130605
[Report]
>>106127417 (OP)
Go people care about error checking unlike everyone else (it seems) and you think this some kind of a dunk on them? lol
Anonymous
8/3/2025, 11:18:35 PM
No.106130773
[Report]
whats
if err != nil {
return nill, err;
}
wrong
if err != nil {
return nill, err;
}
with
if err != nil {
return nill, err;
}
that?
if err != nil {
return nill, err;
}
Anonymous
8/3/2025, 11:31:50 PM
No.106130894
[Report]
>>106134165
>>106128766
I have only one catch in my entire >100K LOC codebase. And my "error handling" code? I just repeat method call several times.
The main source of catches are transient IO errors like files being locked by other process (like in my case), or network errors.
Anonymous
8/4/2025, 12:23:47 AM
No.106131412
[Report]
>>106131878
>>106127417 (OP)
>every other example ignores errors
jeet or mental retardation
call it
Anonymous
8/4/2025, 12:44:22 AM
No.106131594
[Report]
>>106127701
Java itself isn't that verbose, the fucking culture around it is the issue
> NO U CAN NOT HAVE A PUBLIC FIELD IN A CLASS U HAVE TO MAKE IT PRIVATE AND CREATE GETTERS AND SETTERS FOR IT
why? Because in that one case...
also clean code mental illness
Anonymous
8/4/2025, 1:19:24 AM
No.106131878
[Report]
>>106132889
>>106131412
You can't ignore error in real programming language.
Anonymous
8/4/2025, 1:52:20 AM
No.106132134
[Report]
>>106127816
wow, a real AI artist in the wild
Anonymous
8/4/2025, 2:17:04 AM
No.106132334
[Report]
>>106127417 (OP)
SAAR DO NOT REDEEM THE IF ERR != NULL SAAAR YOU BLOODY BENCHOD *braaaaaaaaap*
Anonymous
8/4/2025, 2:20:16 AM
No.106132359
[Report]
>>106137548
>>106127693
If someone passes my program incorrect input, it's a skill problem on their part and not my responsibility
Anonymous
8/4/2025, 3:02:16 AM
No.106132707
[Report]
>>106133297
>>106127417 (OP)
is that... le hecking error handling? AAAA im going insane CHATGPT SAVE ME!
>>106127750
All this C# shilling made me want to test it out and fuck, it is beyond terrible. I've never seen such a botched ffi as the one C# has. Calling raylib functions from C# yields about the same performance as fucking Python using a jit. I can't think of a usecase for C# beyond generic web backend #30323912919291 and even then it doesn't stand out as particularly great. It is truly corporate slop.
Anonymous
8/4/2025, 3:17:15 AM
No.106132791
[Report]
>>106127417 (OP)
why is there no ruby in there, literally best DSL language
Anonymous
8/4/2025, 3:31:59 AM
No.106132889
[Report]
>>106131878
The only way to ignore an exception is to catch it ("to handle it" in go terms). Catching, "swallowing" exceptions is considered bad practice.
Anonymous
8/4/2025, 3:39:18 AM
No.106132946
[Report]
>>106133591
Anonymous
8/4/2025, 4:01:01 AM
No.106133075
[Report]
>>106133267
How come this guy wants to argue about Go all the time anyway? Is he gay?
Anonymous
8/4/2025, 4:32:48 AM
No.106133267
[Report]
>>106133075
probably some google shill, obviously their language is so shitty they need to do marketing for it
Anonymous
8/4/2025, 4:37:05 AM
No.106133297
[Report]
>>106133408
>>106132707
Are gojeets incapable of comprehending that other languages have sane ways of error handling, like checked exceptions and Result<T, E>, that don't involve checking err == nil every two lines?
Anonymous
8/4/2025, 4:55:59 AM
No.106133431
[Report]
>>106127417 (OP)
What happens if you just don't check for the error?
Anonymous
8/4/2025, 5:23:19 AM
No.106133591
[Report]
>>106132946
Tried the same test. got 2ns/call
Anonymous
8/4/2025, 6:24:02 AM
No.106133953
[Report]
>>106134153
>>106133408
Checked exceptions are superior to if err != nil in every way possible, but your tiny Indian brain could not possibly comprehend how. You get paid per line of code because you are a worthless jeet slave.
Anonymous
8/4/2025, 6:26:24 AM
No.106133963
[Report]
>>106132930
>overhead of between 10 and 30 x86 instructions per call
isn't this normal when you save all registers to stack?
Anonymous
8/4/2025, 7:09:03 AM
No.106134165
[Report]
>>106130894
that is mostly where i utilize this class. io operations are bound to be so fucked that you need verbose error handling, more than just a nullptr(std::optional). you can throw specific errors and handle them by unrolling the stack, or you can just return a valueless object with an error. also it looks much cleaner than the try catch(foo) catch(bar) catch(...)
Anonymous
8/4/2025, 7:11:41 AM
No.106134175
[Report]
>>106135603
>>106132780
I used it to code a proxy server for a game protocol which is very latency sensitive. That sounds more like a skill issue.
Anonymous
8/4/2025, 9:19:11 AM
No.106134862
[Report]
>>106127417 (OP)
Golang winning as usual, java and cshart saars are angry about it, grass is green and the sky is blue
Anonymous
8/4/2025, 9:21:56 AM
No.106134884
[Report]
>>106134949
>>106127417 (OP)
>redis
how are we all feeling about Valkey?
Anonymous
8/4/2025, 9:33:21 AM
No.106134949
[Report]
>>106135008
>>106134884
it's literally Redis without the retarded licensing
Anonymous
8/4/2025, 9:44:29 AM
No.106135008
[Report]
>>106134949
redis had all this shit about vector stores?
>>106127686
the java/C# equivalent would be to put every function in a
try {
function();
} catch (Exception e) {
exit(-1);
}
not nicer than go at all. the only difference is that with go you have to explicitly say i don't want to handle the error by using a discard result, _ = function() while in java/C# you have zero clue what can throw what kinds of exceptions. Did you know that anytime you use the new keyword it could fail with an OutOfMemory? do you put all new usages in try catch blocks? java/C# error handling is just selectively ignoring 3/4 of them.
Anonymous
8/4/2025, 11:35:24 AM
No.106135603
[Report]
>>106137922
>>106134175
>Webshitting where i/o the biggest limiting factor vs processing large amounts of raw data and using ffi where data structure implementations and raw compute is the biggest limiting factor.
I know you are brown but try harder. Even Python would be fine for your usecase. Webdevs are not human.
Anonymous
8/4/2025, 12:23:13 PM
No.106135867
[Report]
>>106127417 (OP)
It's hilarious how exceptions are literally superior to how go returns errors and as equally weakly typed as exceptions as well. I honestly don't understand what go heads were thinking when they designed their shit system.
Anonymous
8/4/2025, 3:03:33 PM
No.106136931
[Report]
>>106135422
the java/C# equivalent would be doing nothing, because you get this behavior for free
Anonymous
8/4/2025, 3:59:49 PM
No.106137389
[Report]
>>106137779
>>106135422
>java/C# you have zero clue what can throw what kinds of exceptions.
Have you heard of checked exceptions saar?
Anonymous
8/4/2025, 4:02:32 PM
No.106137414
[Report]
>>106137512
Microsoft wrote the TypeScript troonspiler in Go and not C# or C++ or Rust because Microshit has no white engineers anymore, only street shitting benchod pajeets who can only understand their benchod jeetlangs like Go. Do not redeem you bloody bitch bastard!
Anonymous
8/4/2025, 4:12:52 PM
No.106137512
[Report]
>>106137414
Microsoft is a hydra. don't attribute direction to a beast that moves in every direction simultaneously.
Anonymous
8/4/2025, 4:17:14 PM
No.106137548
[Report]
>>106137629
>>106132359
you reckon a program should just crash due to "skill" issues that you could have prevented?
Anonymous
8/4/2025, 4:26:15 PM
No.106137629
[Report]
>>106137548
dont argue with midwits and jeets
>>106130066
>you have a global exception handler in your main loop which reports the error
I'm looking forward to even more airplanes nosediving due to software bugs very soon
Anonymous
8/4/2025, 4:41:21 PM
No.106137763
[Report]
>>106138469
>>106137707
Go was literally invented to tard wrangle jeets from making buggy code in C++. Keep projecting Ranjeet.
Anonymous
8/4/2025, 4:42:47 PM
No.106137779
[Report]
>>106139335
>>106137389
The entire point of exceptions is that it's an open set of errors with types unknown at compilation time, which makes it easy to write modular software. If you expect something, it should be a part of result, like http status code.
Anonymous
8/4/2025, 4:49:13 PM
No.106137850
[Report]
>>106138469
>>106137707
god, imagine letting a bunch of gojeets write airplane software. at least java is halfway workable when it's white men programming it.
Anonymous
8/4/2025, 4:51:38 PM
No.106137872
[Report]
>>106138107
>>106127417 (OP)
why not add a single character syntactic sugar for panic(err), return err, and other common error handling?
Anonymous
8/4/2025, 4:54:52 PM
No.106137922
[Report]
>>106135603
>networking programming
>webshit
You just outted yourself as a no coder and by your response a retard, which proves my initial point.
Anonymous
8/4/2025, 5:09:35 PM
No.106138107
[Report]
>>106139335
>>106137872
odin does this with
FuncThatCouldError() or_return;
// and
FuncThatCouldError() or_else { //handle error }
Anonymous
8/4/2025, 5:34:37 PM
No.106138469
[Report]
>>106139335
>>106137763
>>106137850
the cope on this board from java jeets is really strange. nobody posted like this on /g/ ever until this year. how is college going bro?
Anonymous
8/4/2025, 6:45:21 PM
No.106139335
[Report]
>>106139362
>>106138107
>muh Odin
Buy an ad.
>>106137779
That is literally what a checked exceptions is, the exceptions a function can throw is literally part of its signature.
>>106138469
>The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt. – Rob Pike
DO NOT REDEEM YOU BLOODY BENCHOD!!!
Anonymous
8/4/2025, 6:50:38 PM
No.106139409
[Report]
>>106139447
>>106139362
No one mentioned functroon languages, Prajesh? Take your fucking meds.
Anonymous
8/4/2025, 6:53:30 PM
No.106139447
[Report]
>>106139467
>>106139409
I hope you're not retarded enough to seriously think that by "brilliant language" he meant Java.
Anonymous
8/4/2025, 6:54:52 PM
No.106139467
[Report]
>>106139447
No one claimed Java was a genius language? But at least Java is elegant and expressive in comparison to Go, and that is the only point I need to make.
Anonymous
8/4/2025, 6:55:37 PM
No.106139482
[Report]
>But at least Java is elegant and expressive in comparison to Go
holy fuck i can't even with these underaged newfags
Anonymous
8/4/2025, 7:00:47 PM
No.106139551
[Report]
Seen as there is no /wdg/ I'll ask ITT.
Has anyone built a music website and if so where can I download royalty free music from?
Only need like 4 or 5 albums but more would be good. Just want to make sure the music is 100% free to use because I'll be hosting it on netlify. Will obviously give links and credits to the artists.
>Java
>elegant
>expressive
>in comparison to Go
holy fuck my sides
Anonymous
8/4/2025, 7:07:33 PM
No.106139637
[Report]
>>106139744
>>106139557
>vibecoding gojeet uses vibecoding to prove xer point
do not fuckin redeem benchod
Anonymous
8/4/2025, 7:13:34 PM
No.106139716
[Report]
>>106139744
>>106139557
You forgot to check if err != nil at line 10, 11, 12, 14, 15, 17, 18, 19, and 22.
Anonymous
8/4/2025, 7:15:24 PM
No.106139744
[Report]
>>106139762
>>106139637
>retard
>>106139716
>schizo
The natue of the opposition reveals itself.
Anonymous
8/4/2025, 7:16:32 PM
No.106139762
[Report]
>>106139744
>no arguments
>no arguments
Behold, the smartest gojeet.
Anonymous
8/4/2025, 7:19:31 PM
No.106139806
[Report]
instance Monad (Either e)
Anonymous
8/4/2025, 7:21:34 PM
No.106139841
[Report]
>>106140102
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, World!")
}
func main() {
http.HandleFunc("/", handler)
fmt.Println("Server starting on :8080")
http.ListenAndServe(":8080", nil)
}
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
public class BasicHttpServer {
public static void main(String[] args) throws IOException {
HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
server.createContext("/", new MyHandler());
server.setExecutor(null);
System.out.println("Server starting on :8080");
server.start();
}
static class MyHandler implements HttpHandler {
@Override
public void handle(HttpExchange exchange) throws IOException {
String response = "Hello, World!";
exchange.sendResponseHeaders(200, response.length());
OutputStream os = exchange.getResponseBody();
os.write(response.getBytes());
os.close();
}
}
}
Anonymous
8/4/2025, 7:26:58 PM
No.106139907
[Report]
>>106139974
>even after shitting out vibecoded hallucinations the java implementation is still 100 times more readable and clean than the street shitted gojeet implementation
gojeets lost, again
Anonymous
8/4/2025, 7:32:39 PM
No.106139974
[Report]
>>106139907
nobody is actually this retarded
Anonymous
8/4/2025, 7:40:31 PM
No.106140065
[Report]
>>106140111
Oh wow, this thread that we literally have everyday.
Anonymous
8/4/2025, 7:43:15 PM
No.106140092
[Report]
>>106127417 (OP)
the issue is?
not having exception is actually a pro...
Anonymous
8/4/2025, 7:44:11 PM
No.106140102
[Report]
>>106139841
that's just different levels of abstraction. nothing prevents you from wrapping java code in few functions, exactly like in go example.
Anonymous
8/4/2025, 7:59:15 PM
No.106140269
[Report]
>>106140418
Java:
>readable like English
>simple and self-documenting
Go:
>verbose but not self-documenting
>unreadable due to if err != nil everywhere and obnoxious control flow
Anonymous
8/4/2025, 8:02:49 PM
No.106140306
[Report]
Funny how you can tell what % of /g/ is employed based on threads like these.
Anonymous
8/4/2025, 8:02:52 PM
No.106140307
[Report]
>>106135441
yes, given the disproportionate attention Go threads get here
Anonymous
8/4/2025, 8:12:56 PM
No.106140418
[Report]
>>106140269
Just introduce more abstractions through function soups like you do in Java
Anonymous
8/4/2025, 8:26:24 PM
No.106140569
[Report]
>>106140524
>wtf is this code
Bait for retards. They're pretty abundant here.