Thread 106167245 - /g/ [Archived: 7 hours ago]

Anonymous
8/6/2025, 11:13:54 PM No.106167245
gogo
gogo
md5: b46011ce4101310fd2a90d1e7fbfb183๐Ÿ”
Explain what's wrong with it without sounding mad.
Replies: >>106167354 >>106167359 >>106167378 >>106167453 >>106167490 >>106167512 >>106167563 >>106167575 >>106167720 >>106167742 >>106167890 >>106168119 >>106168348 >>106168390 >>106168407 >>106168754 >>106169206 >>106169360 >>106169702 >>106169765 >>106169774 >>106170536 >>106170690 >>106170713 >>106170865 >>106171248 >>106172221 >>106172576 >>106173199 >>106173274 >>106173748 >>106173771 >>106174845 >>106177007 >>106182221 >>106182664
Anonymous
8/6/2025, 11:16:18 PM No.106167267
nothing, some midwit college teacher/prof told someone that it's one of the >le bad programming practices and that they should clean their code and wash their penis and clean their room (if you know you know)
aside from that there's nothing wrong with it and people who criticize it are either unemployed or have never written a signifanct piece of software, ever
Replies: >>106167693 >>106173844 >>106179018 >>106181971
Anonymous
8/6/2025, 11:20:25 PM No.106167315
because there are zero conditions to it. it doesn't matter what the scope is, or what's being done. it will immediately shift control. you could be initializing a constructor and it will shift control. you could be allocating memory and it will shift control. you could be rearranging the stack and it will shift control. all immediately when the previous instruction is sent, not after it's done.
Replies: >>106167353 >>106167399 >>106167708 >>106170305 >>106173300 >>106173844 >>106182685
Anonymous
8/6/2025, 11:20:57 PM No.106167326
It makes the code harder to read. You will forget what the code does a week later.
Replies: >>106167353 >>106173844
Anonymous
8/6/2025, 11:23:56 PM No.106167353
1543775
1543775
md5: 1fdc22d1514ad4d88cacdfdf8e91343b๐Ÿ”
>>106167315
>>106167326
Anonymous
8/6/2025, 11:24:00 PM No.106167354
>>106167245 (OP)
Isn't this just like a JMP instruction?
>Assembly is problematic
Replies: >>106169622 >>106171638
Anonymous
8/6/2025, 11:24:29 PM No.106167359
Screenshot from 2025-08-06 23-24-01
Screenshot from 2025-08-06 23-24-01
md5: c1c81701ee6ede8eb3f3c9e561465c48๐Ÿ”
>>106167245 (OP)
its easy to turn your code into spaghetti with it
its not something wrong with the statement per se, just that it has a barrier of entry to it
Replies: >>106167421 >>106170079 >>106172698 >>106173844
Anonymous
8/6/2025, 11:26:40 PM No.106167378
>>106167245 (OP)
It makes encapsulation and complexity management impossible. People who advocate for its use outside of specific low-level contexts are universally retarded junior no-coders who have never touched anything more complicated than a cli calculator tutorial.
Replies: >>106167394 >>106167394 >>106167421 >>106173811
Anonymous
8/6/2025, 11:27:44 PM No.106167392
the entire point of using a programming language is to give some sort of meaningful structure to your program, as soon as you start gotoing all over the place the structure imposed by the language is destroyed
Replies: >>106167923
Anonymous
8/6/2025, 11:27:57 PM No.106167394
>>106167378
>impossible
no

>>106167378
>retarded
ad hominim

everyone misses the mark

goto makes code hard to read. that's it. the actual problem.
Replies: >>106167421 >>106167425 >>106167740 >>106167966 >>106173017
Anonymous
8/6/2025, 11:28:40 PM No.106167399
>>106167315
goto in modern languages is a structured concept. Its perfectly safe. You cannot jump out of a function. Goto is no worse than break or continue.
Anonymous
8/6/2025, 11:30:45 PM No.106167421
>>106167378
>oop concerns
>in c
...
>>106167394
>goto makes code hard to read. that's it. the actual problem.
it doesnt and it prevents code duplication when used wisely >>106167359
it just has a barrier of entry to it
but so does C
Anonymous
8/6/2025, 11:31:25 PM No.106167425
>>106167394
> goto makes code hard to read
Goto a tool that has its uses. What is more unreadable than goto is the contortions people make to avoid using it.
Anonymous
8/6/2025, 11:34:07 PM No.106167453
>>106167245 (OP)
The only time I have ever used it is for error handling, I don't know what any other practical use case would be for it.
Replies: >>106167516
Anonymous
8/6/2025, 11:38:13 PM No.106167490
>>106167245 (OP)
Nothing if you have a legitimate reason to use it, like any other code features.
Historically it's been an aggravating factor in sloppy code, giving it a bad reputation, but the code would've been bad regardless of if it used goto or not.
Anonymous
8/6/2025, 11:41:13 PM No.106167512
>>106167245 (OP)
nothing

>but you can complicate flow control and make code impossible to maintain
you can do that anyway, you donโ€™t need goto to make a fucked up mess. like any other tool, when you donโ€™t abuse it there is no issue
Anonymous
8/6/2025, 11:41:33 PM No.106167516
>>106167453
i had one instance when i used it in a convoluted control flow situation, to short out of a loop. in ~300 klocs of code.
so i would expect to see it in optimization too
otherwise yeah, error handling
Anonymous
8/6/2025, 11:41:37 PM No.106167517
It's shit
Anonymous
8/6/2025, 11:46:57 PM No.106167563
modern goto
modern goto
md5: 57bbad98d30a1b1cdb627545e32d0c16๐Ÿ”
>>106167245 (OP)
It's no longer necessary
Replies: >>106167636 >>106167945
Anonymous
8/6/2025, 11:49:10 PM No.106167575
>>106167245 (OP)
https://www.youtube.com/watch?v=mrY6xrWp3Gs
Anonymous
8/6/2025, 11:55:48 PM No.106167636
>>106167563
while(1) {
while(1) {
if (condition) {
goto exit;
}
}
}
exit:
Now what?
Replies: >>106167699 >>106167748 >>106173844 >>106175518
Anonymous
8/6/2025, 11:57:27 PM No.106167656
goto is an unconditional branch. in high level languages they break the flow of a program and makes it challenging to read. i think the only okay example is breaking both loops of a nested loop. they can be avoided, and any performance they provide is negligible.
Replies: >>106167678 >>106173844
Anonymous
8/7/2025, 12:00:03 AM No.106167678
>>106167656
>in high level languages they break the flow of a program and makes it challenging to read
high level languages do that all the time anyway with things like destructors and exceptions
Anonymous
8/7/2025, 12:01:32 AM No.106167693
>>106167267
>wash their penis
they would never say this, they would push circumcision instead because they are jewish
Replies: >>106173927
Anonymous
8/7/2025, 12:02:32 AM No.106167699
>>106167636
More languages should be like java.
outer:
while(true) {
while(true) {
if (condition) {
break outer;
}
}
}
Replies: >>106168386 >>106168465 >>106172226 >>106173872 >>106175518
Anonymous
8/7/2025, 12:03:49 AM No.106167708
>>106167315
don't use it like a retard then?
Replies: >>106167752 >>106175763
Anonymous
8/7/2025, 12:04:47 AM No.106167716
C_User
C_User
md5: 53c7d1220ad8941493556c7fe06b2c0e๐Ÿ”
There is ABSOLUTELY NOTHING WRONG with forward goto jumps. You can't even create spaghetti with forward goto jumps. Very useful for error handling, or the inverse, skipping an error placed right after a search-loop.
Jumping back though? That we don't do. Can anyone even come up with something that's not just a bad version of some other control primitive? I'm genuinely curious.
Replies: >>106170569 >>106170684 >>106173844 >>106174156 >>106175112
Anonymous
8/7/2025, 12:05:03 AM No.106167720
>>106167245 (OP)
djkstra did real damage to programming, he wasn't even a real dev himself as he hated anything non-theorical, why the fuck are we still haunted by his retarded ghost...
Anonymous
8/7/2025, 12:06:57 AM No.106167740
>>106167394
>goto makes code hard to read. that's it. the actual problem.
how is it any different from a function call? you'll need to jump to it to read the code anyways except it's usually a few lines later and not in another file or in some .so you don't have the sources for
Replies: >>106167801 >>106168052
Anonymous
8/7/2025, 12:07:09 AM No.106167742
>>106167245 (OP)
Perfectly acceptable, Dijkstra was well known flame languages, including the ones he was involved in.
Like a PHD paper, the professors pretended to know their stuff by using references and harmful goto, spread across the academic world.
Anonymous
8/7/2025, 12:07:33 AM No.106167748
>>106167636
>while(1) {
> while(1) {
the code of goto proponents, everyone
Replies: >>106167858
Anonymous
8/7/2025, 12:08:25 AM No.106167752
>>106167708
how about i use you like a faggot?
Anonymous
8/7/2025, 12:11:29 AM No.106167801
>>106167740
>how is it any different from a function call?
a function returns to where it was called from. when reading code, you can skip over functions you don't need to inspect
goto is a one-way indirection - you *have* to inspect where the code jumps to if it gets executed
Replies: >>106167925 >>106168085
Anonymous
8/7/2025, 12:17:01 AM No.106167858
open-ai
open-ai
md5: 1d9577cfff03f0bec6fe6fea8aa8b3ae๐Ÿ”
>>106167748
>program loop
>event loop
>goto is for when you want to close the program
makes sense to me
Replies: >>106168016 >>106168647
Anonymous
8/7/2025, 12:19:26 AM No.106167890
>>106167245 (OP)
goto is good for breaking out of nested loops
can be used as alternative to early return technique or when the language forces single return functions
can be used to directly go to cleanup section and might be or not a cleaner than a function call
can be used as more flexible switch using more than one variable for dispatch
there is nothing wrong with goto and people that do say so are just clueless cargo cult sheeps
Replies: >>106167973
Anonymous
8/7/2025, 12:22:08 AM No.106167923
>>106167392
RUUFF RUUUFFFF RUFF WOOOFF WOOF
RUFF
Anonymous
8/7/2025, 12:22:09 AM No.106167925
>>106167801
>goto is a one-way indirection - you *have* to inspect where the code jumps to if it gets executed
so? the goto is scoped local to the function, itโ€™s not a long jump. if youโ€™re reading the function youโ€™re reading the function
Replies: >>106168069
Anonymous
8/7/2025, 12:24:10 AM No.106167945
>>106167563
>Be Sundar Pichai
>A walking piece of shit
>Best practice exists
>It's no longer necessary
Anonymous
8/7/2025, 12:25:24 AM No.106167966
>>106167394
>ad hominim
sigh... NTA, but that was an insult, not ad hominem.
Insults aren't necessarily ad hominem. It only becomes ad hominem when it's used as an excuse to dismiss a point someone is making.
Which the other poster wasn't doing.
Pet peeve of mine.
https://laurencetennant.com/bonds/adhominem.html
Anonymous
8/7/2025, 12:26:01 AM No.106167973
>>106167890
They're useful for breaking out of search loops too like this on success:
u32 i = 0;
for (; i < LENGTH(haystack); i++) {
if (needle == haystack[i]) goto found;
}
panic("Not found");
found:
// haystack[i] is our needle
Replies: >>106167984 >>106168119 >>106168349 >>106168761
Anonymous
8/7/2025, 12:27:05 AM No.106167984
>>106167973
NO, STOP THIS IS TOO HARD FOR ME TO READ โ€ฆ.UGH UH THE CONTROL FLOW, ITS ALL WRONG
Replies: >>106168037
Anonymous
8/7/2025, 12:27:31 AM No.106167988
if(teacher.type == poo)
goto toilet;
else
return;

toilet:
flush();
Anonymous
8/7/2025, 12:28:40 AM No.106167999
Number 1 wipe away, number 2 flush your poo.
Always flush your poos.
Anonymous
8/7/2025, 12:30:38 AM No.106168016
>>106167858
>program loop and event loop in a single function
it's either fizzbuzz-tier trivial, or severely unstructured and technically indebted
Replies: >>106168271
Anonymous
8/7/2025, 12:31:23 AM No.106168022
Test
Anonymous
8/7/2025, 12:33:31 AM No.106168037
>>106167984
What's wrong with it?
Anonymous
8/7/2025, 12:33:43 AM No.106168041
>um it's bad because you have to jump around in the code and that's bad
oh yeah? where are your functions? where are your methods stored? YOU ARE ALREADY JUMPING
YOU ARE ALREADY A JUMPER
Replies: >>106174010
Anonymous
8/7/2025, 12:34:28 AM No.106168052
>>106167740
You can write unit tests for a function, can't do that with a goto.
Replies: >>106168085 >>106169839
Anonymous
8/7/2025, 12:36:09 AM No.106168069
>>106167925
>if youโ€™re reading the function youโ€™re reading the function
no, because the linearity of reading line after line is still ruined
Replies: >>106171474 >>106172136 >>106173844
Anonymous
8/7/2025, 12:37:43 AM No.106168085
>>106167801
>you can skip over functions you don't need to inspect
same as goto then, why would you need to read the goto but not hte function if you want to read the code, it's the same fucking thing
>>106168052
lmao why would you write a unit test for a sugar coated if?
Replies: >>106168118 >>106168380
Anonymous
8/7/2025, 12:40:47 AM No.106168118
>>106168085
Because I'm assuming this is a real code-base and there's 500 lines of code between the goto and the label.
Anonymous
8/7/2025, 12:40:49 AM No.106168119
>>106167973
>>106167245 (OP)
you guys are retarded
you are using the specific cases where it's acceptable by EVERYONE to use goto and pretend you are so special for using it

but 99% of the times there are cleaner alternatives

and the fucking reason why profs say goto is le bad, is not for your 1 specific case which is good, but for the other 99% cases where programmers OF THE PAST heavily used it because there were no better alternatives

and they were trying to convince THEM that it was bad and to switch to stuff like loops, break, continue try catch etc.

but today these things are common knowledge, and profs are just pretty much parroting what their profs told them, and it is kind of useless cause your average programmer today hasn't even heard of goto
Replies: >>106172132 >>106173844
Anonymous
8/7/2025, 12:58:01 AM No.106168271
>>106168016
>how to tell someone youre a fizzbuzzer without actually saying it
every gui program has an event loop
that event loop can be a while (1)
it often is. its cleaner to call an exit function than breaking the loop.
but one could use a break or even a goto

if you have a program that doesnt need a window to be open at all times, you will have a while 1 loop for your program
and you will have a while 1 loop for your event loop
again, i would have used an exit function because i find it cleaner
but someone else might use a goto
and its not the only case where you could have a double inifnite loop

and infinite loops arent the only case where you might want to short out of a loop without further conditionals
if you want to go fast, you also might want to use a goto to short out of nested loops
and sometimes it just doesnt fucking make sense to fiddle around with the "usual" flow control statements
admittedly, i remember one such instance in my whole c programming "career", ~300 klocs
but such situations do exist.
Replies: >>106168491
Anonymous
8/7/2025, 1:05:34 AM No.106168348
>>106167245 (OP)
it's for retards without tail-call optimized recursion
Replies: >>106170316
Anonymous
8/7/2025, 1:05:36 AM No.106168349
>>106167973
That code is atrocious.
for(int i = 0; i < haystack.size(); i++) {
if (needle == haystack[i]) return true;
}
return false;
Replies: >>106168531 >>106174010
Anonymous
8/7/2025, 1:08:17 AM No.106168380
>>106168085
>same as goto then, why would you need to read the goto but not hte function if you want to read the code, it's the same fucking thing

a = "niggers tongue my anus";
a = uppercase(a);
a = censor(a);
a = add_punctuation(a);
print(a);
I can read this piece of code line after line because functions always return to the point where they were called from. I don't need to inspect the functions if I don't have doubts about their implementation.

a = "niggers tongue my anus";
goto uppercase;
print:
print(a);

I *have* to follow the goto to learn the sequence of instructions - I can't just skip over it because there's nothing in this piece of code saying when (if ever) it will return there
Replies: >>106174010
Anonymous
8/7/2025, 1:08:54 AM No.106168386
>>106167699
I don't see how that's better, you just dislike the word goto because you were told to and because the herd dislikes it.
Replies: >>106168467 >>106172197
Anonymous
8/7/2025, 1:09:14 AM No.106168390
>>106167245 (OP)
At best, it's an ad hoc implementation of other structured control flow constructs. At worst, it isn't.
Anonymous
8/7/2025, 1:11:21 AM No.106168407
>>106167245 (OP)
You made a "without sounding mad" post about it. People who are right don't have to do weak things like that.
Anonymous
8/7/2025, 1:16:37 AM No.106168465
>>106167699
Maybe I'm retarded but I'd like to see something like break(n) to break n nested loops
Replies: >>106168499 >>106168516 >>106174010 >>106182184
Anonymous
8/7/2025, 1:16:53 AM No.106168467
>>106168386
Sometimes the herd is right, anon.
Replies: >>106168843 >>106174445
Anonymous
8/7/2025, 1:19:05 AM No.106168491
>>106168271
>its cleaner to call an exit function than breaking the loop
>would have used an exit function because i find it cleaner
guess that makes you a fizzbuzzer too, then
Anonymous
8/7/2025, 1:19:43 AM No.106168499
1753982517081437
1753982517081437
md5: a1f5446386fe731ba3ee1a9c9b603ee7๐Ÿ”
>>106168465
>refactor code by removing or adding nested loop
>cause bug
Anonymous
8/7/2025, 1:21:17 AM No.106168516
>>106168465
show code where the number of nested loops is a variable
otherwise, you can just count the loops yourself, label the one you want to break on, and break on label
Anonymous
8/7/2025, 1:22:46 AM No.106168531
>>106168349
Nocoder moment. What if we want to do something with the needle?
Replies: >>106168546 >>106168613 >>106168624
Anonymous
8/7/2025, 1:23:50 AM No.106168546
>>106168531
call a lambda
Anonymous
8/7/2025, 1:31:03 AM No.106168613
>>106168531
Depends on what you want to do.
Anonymous
8/7/2025, 1:31:59 AM No.106168624
>>106168531
for(int i = 0; i < haystack.size(); i++) {
if (needle == haystack[i]) return i;
}
return -1;
Replies: >>106168630 >>106168637 >>106168673 >>106168694 >>106169435 >>106174010
Anonymous
8/7/2025, 1:32:30 AM No.106168630
>>106168624
I don't want to make it a function.
Anonymous
8/7/2025, 1:33:18 AM No.106168637
>>106168624
the state of Cniles
Anonymous
8/7/2025, 1:34:02 AM No.106168647
>>106167858
>return on investment: 25 years
what's wrong with this?
Replies: >>106168891
Anonymous
8/7/2025, 1:36:15 AM No.106168673
>>106168624
The -1 is arbitrary here.
https://en.cppreference.com/w/cpp/algorithm/find.html
Anonymous
8/7/2025, 1:37:20 AM No.106168694
>>106168624
this sucks
Anonymous
8/7/2025, 1:41:46 AM No.106168754
>>106167245 (OP)
When Dijkstra was badmouthing goto, structural programming was appearing.
Meaning: goto was not used to exit loops or structure function flow, goto was used to jump from inside a function, somewhere else, without cleaning the stack, or keeping it constant. You started with variables x and y that had 2 and 2 and suddenly you were somewhere else with no new stack frame and then you somehow returned, or maybe not even returned to the function, and x and y were now 256 each and who knows what happened to the registers.
Procedures structured stack usage, automating it: get what you want, do what you want, return what you want, get rid of the rest.
Anonymous
8/7/2025, 1:42:47 AM No.106168761
64634447df7e3d71010068bc_45
64634447df7e3d71010068bc_45
md5: c5966ec2d4b33c5f4944f3cbd41c8fc8๐Ÿ”
>>106167973
It's actually filtering retards
Anonymous
8/7/2025, 1:43:42 AM No.106168775
I apologize for the shit solution with returning an arbitrary -1 value. Here is the fixed version:
for(int i = 0; i < haystack.size(); i++) {
if (needle == haystack[i]) return i;
}
throw new NoSuchElementException("Needle not in haystack");
Replies: >>106168880 >>106168913
Anonymous
8/7/2025, 1:50:07 AM No.106168843
>>106168467
Not this time they aren't.
Anonymous
8/7/2025, 1:52:58 AM No.106168880
>>106168775
for(int i = 0; i < haystack.size(); i++) {
if (needle == haystack[i]) return std::make_optional<int>(i);
}
return std::nullopt;
Anonymous
8/7/2025, 1:54:08 AM No.106168891
>>106168647
you dont see whats wrong with this?
it means the value of the company is purely speculative

for example a construction company has an roi of around 3 months or youre doing something spectacularly wrong
Replies: >>106168919
Anonymous
8/7/2025, 1:56:01 AM No.106168913
>>106168775
>new
>allocating on the heap to throw an error
this is completely fucking retarded
who taught you to program?
Replies: >>106168960
Anonymous
8/7/2025, 1:56:37 AM No.106168919
>>106168891
it's not a regular company.
Replies: >>106168949
Anonymous
8/7/2025, 1:59:56 AM No.106168949
>>106168919
it is a regular company
and you are a fanboi cultist
Anonymous
8/7/2025, 2:01:12 AM No.106168960
>>106168913
>he learned about C's memory allocation once
>he is unable to envision systems where memory is reserved in advance for situations like these, resulting in cheap "allocations"
the people behind the JVM are way smarter than you lil bro
Replies: >>106169040 >>106169066
Anonymous
8/7/2025, 2:08:35 AM No.106169040
>>106168960
>he is unable to envision systems where memory is reserved in advance for situations like these, resulting in cheap "allocations"
its called an arena
and its still completely
wildly
unimanginably retarded

and its default, right?
fucking sepples should be named seppo
because it seems to be maintained by aboriginals
and not those who drink beer, those who sniff petrol

all you need is a constant and a function
god sepples is so fucking retarded
Replies: >>106169086
Anonymous
8/7/2025, 2:10:43 AM No.106169066
>>106168960
Accessing heap is not an issue, but throwing a runtime exception, simply because you can't find an item, is a bad idea.
Here's what I would do :
const auto it = std::find(haystack.begin(), haystack.end(), needle);
Anonymous
8/7/2025, 2:12:42 AM No.106169086
>>106169040
>its called an arena
no, arenas indicate all entries sharing a lifetime. they also do not allow for memory defragmentation via reference updates, although that is more of a GC thing.
>all you need is a constant
so the string that the user sees is not variadic in size when considering potential contained values?
you really wanna annotate every single error condition for each function, as well as its dependencies? sounds annoying as fuck to me lil bro, that's part of the reason why I stopped using Rust.
Replies: >>106169153
Anonymous
8/7/2025, 2:19:49 AM No.106169153
>>106169086
>no, arenas indicate all entries sharing a lifetime. they also do not allow for memory defragmentation via reference updates
and why would that be, exactly?
>so the string that the user sees is not variadic in size when considering potential contained values?
who said the function cannot be variadic?
the constant is needed as error message but you can intersperse it with other data
and that still doesnt involve heap allocations
Replies: >>106169240
Anonymous
8/7/2025, 2:25:05 AM No.106169206
>>106167245 (OP)
Nothing, it's unironically optimal code. That's why GCC and Clang both have optimizer passes (e.g. gcc -ftree-tail-merge) that transform jeet-tier "structured" control flow into the equivalent of goto.
/thread
Replies: >>106174010
Anonymous
8/7/2025, 2:28:23 AM No.106169240
>>106169153
how are you planning to return that data (on the stack within your current function) without the heap?
Replies: >>106169269 >>106169354
Anonymous
8/7/2025, 2:31:40 AM No.106169269
>>106169240
pardon the fuck?
you completely lost me
explain what you mean like if i was 5
Replies: >>106169290
Anonymous
8/7/2025, 2:34:02 AM No.106169290
>>106169269
no, I do not care anymore. it is a useless argument. I'm going back to writing Clojure, because all of this shitposting is a waste of fucking time. we are literally arguing over heap use when throwing a fucking error. it does not matter. whatever makes the most sense at a human level is the best decision. if you expect to find the needle in the haystack, and do not, then throw a damn error and move on with your fucking life.
Replies: >>106169306 >>106169326 >>106169538
Anonymous
8/7/2025, 2:36:12 AM No.106169306
>>106169290
>no, I do not care anymore.
i think youre talking out of your ass and this is a tactical retreat
>closure
explains why youre retarded
Replies: >>106169326 >>106169331
Anonymous
8/7/2025, 2:38:04 AM No.106169326
>>106169290
>whatever makes the most sense at a human level is the best decision.
>>106169306
cont
retarded indeed

if that was the case everything would be written in python
learning functional programming turns you into a retard
Anonymous
8/7/2025, 2:38:46 AM No.106169331
Screenshot from 2025-08-01 08-14-47
Screenshot from 2025-08-01 08-14-47
md5: 76a06882c33cb80792e84a3606f1a118๐Ÿ”
>>106169306
Clojure is a very good language, and I say that after writing quite a bit (around 100k LOC total) of C, Rust, Python, Go, JS, TS, and others.
Replies: >>106169382 >>106169785
Anonymous
8/7/2025, 2:40:59 AM No.106169354
>>106169240
Pass a pointer to a buffer on the current stack frame. It just werks.
Replies: >>106169381 >>106169472 >>106169538 >>106169630
Anonymous
8/7/2025, 2:41:48 AM No.106169360
>>106167245 (OP)
This is ultimately what a microprocessor does.
Anonymous
8/7/2025, 2:44:38 AM No.106169381
>>106169354
Lol.
Anonymous
8/7/2025, 2:44:41 AM No.106169382
>>106169331
no
its slow
its limited
and its users are buffoons
case in point:
>he thinks 100 klocs between 6+ languages is a lot

everything you said about c users is actually projection
bc functionalshit is programming but for maffbois, so its immediately retarded bc maths dont map to computer ops very well
and its slow compared to proper systems languages
so its jumping through hoops for a disadvantage in the end. how briliant. truly genius
Replies: >>106169497
Anonymous
8/7/2025, 2:49:17 AM No.106169435
>>106168624
O(n) moment
Anonymous
8/7/2025, 2:51:36 AM No.106169454
goto is based and useful and cuts down on boilerplate

the only downsides are when you're a complete fucking retard and use it to break encapsulation or something
Anonymous
8/7/2025, 2:52:44 AM No.106169472
1717440165635112
1717440165635112
md5: 8a794de931543305bd0fbbd79fb7649d๐Ÿ”
>>106169354
But unironically.
Replies: >>106169538
Anonymous
8/7/2025, 2:55:35 AM No.106169497
>>106169382
why do you care so much about performance? seriously, what are you doing that demands it? you do understand that by using a virtual machine (and boxing my types) I gain the human ability to have a REPL? I can SSH into a prod server, connect to a Clojure REPL, and start running diagnostics. I can run SQL queries using my existing functions that do so (and don't fucking tell me you are using stored procedures in raw SQL, those compose horribly and lead to non-DRY shit). the JVM's profiling capabilities are world class purely because it is a VM with the ability to introspect it.
with immutable data structures I gain access to absolutely fucking trivial concurrent behaviors. do you understand that with Clojure's immutable data structures and transactions system, I literally never have to even think about things like mutexes? have you even heard of software transactional memory? I eliminate entire classes of bugs by simply having my shit be immutable.
and, if performance actually does matter, you surely have enough experience to recognize that it only ever applies to some small subset of your codebase, right? I can write Java-in-Clojure (using any Java data structures I want, or libs, such as Roaring Bitmap, or the Disruptor) without any issues. it's trivial. it's less LOC and cleaner (imo) than fucking Java. there is nothing stopping you. you can use type hints. you can match Java speed in Clojure, and this has been demonstratably done in numerous Clojure codebases.
if Java is not fast enough? I literally do not give a fuck at that point. someone else can port my shit to Rust (which will be trivial btw, ports are never that difficult, the difficulty is always in the business logic). I do not have enough time on this planet to give a shit about reaping Rust/C speeds out of my codebases. I am here to solve interesting problems, and optimization is not one of them.
Replies: >>106169534 >>106169615
Anonymous
8/7/2025, 2:58:42 AM No.106169534
1621460103166
1621460103166
md5: 745a896efddb5d50335141e294bf7e3e๐Ÿ”
>>106169497
AI bros are sucking up all the water with their inefficient software. It's joever.
Anonymous
8/7/2025, 2:58:58 AM No.106169538
>>106169354
>>106169472
wait, youre implying the other retard wrote what he meant?
fukken lamao
such is the power of clojure and 100klocs bw 6+ languages...

>>106169290
ey, retard
you just create a buffer in the context that contains your function and you pass a pointer like youre supposed to have learned in cs 101
Replies: >>106169665
Anonymous
8/7/2025, 3:07:40 AM No.106169615
Screenshot from 2025-07-31 21-56-25
Screenshot from 2025-07-31 21-56-25
md5: 0d2fcb525e799c3abc5dc97f9c0d98c8๐Ÿ”
>>106169497
>why do you care so much about performance?
because for me its the difference in waiting for my computations one day vs one month
>what are you doing that demands it?
ML
>inb4
i actually use openclC to do the heaviest of lifting. runs on the gpu, obviously
i use C for the rest because its a tool that fits my hand
i have very powerful visualization abilities, talents in many fields and i am a strict person
so the low level of c, the lack of standardized interfaces, and the lack of memory safety are not a problem for me
theyre features i desire. anything more would just create friction in the process

heres an example of my code
i dont even have use for templates or generics because i use force inlines to turn my code into legos
>but its not portable/idiomatic
i dont write idiomatic C and i think its a retarded idea to begin with
Anonymous
8/7/2025, 3:08:11 AM No.106169622
>>106167354
No, you can only goto within the function.
Anonymous
8/7/2025, 3:08:42 AM No.106169630
>>106169354
btw, allocating before the error even occurs results in poor performance
the correct thing to do in Cnile-lang is pass a null pointer to allocating to if needed.
Replies: >>106169697 >>106173086
Anonymous
8/7/2025, 3:12:02 AM No.106169665
>>106169538
No, I didn't even read the parent.
>such is the power of clojure and 100klocs bw 6+ languages...
Your insecurity is showing.
Replies: >>106169683
Anonymous
8/7/2025, 3:14:09 AM No.106169683
>>106169665
don t try to save face
youre only digging deeper

you dont even know you can pass references to a function
such is the power of clojure and 100klocs bw 6+ languages i guess
Replies: >>106169710 >>106169715
Anonymous
8/7/2025, 3:15:04 AM No.106169697
>>106169630
>results in poor performance
Source?
Anonymous
8/7/2025, 3:15:37 AM No.106169702
>>106167245 (OP)
there's nothing logically wrong with this, but it's very unreadable and shitty for humans, specially with you're working in a huge project with a lot of devs, in that case good luck understanding what the fuck is going on
Replies: >>106174010
Anonymous
8/7/2025, 3:16:16 AM No.106169710
>>106169683
>no arguments made
I accept your concession.
Replies: >>106169725
Anonymous
8/7/2025, 3:16:41 AM No.106169715
Screenshot from 2025-07-22 01-49-49
Screenshot from 2025-07-22 01-49-49
md5: 712e285232ebce7cf42ae18113007c3b๐Ÿ”
>>106169683
post code lil bro
this is a hash map implementation I wrote in Rust that outperforms Swiss Table in some scenarios
Replies: >>106169725 >>106169726 >>106185384
Anonymous
8/7/2025, 3:18:51 AM No.106169725
>>106169715
alrdy posted
>hash map
geeeeeg
now i understand why crabs youre raving about hashmaps
its all you can do

post bucketsort
its gonna be a week im waiting for that

>>106169710
none needed
ur a retard
you dont even know you can pass references to a function
any argument would fly right past you
Replies: >>106169782
Anonymous
8/7/2025, 3:18:54 AM No.106169726
>>106169715
Now show us the benchmark code, where you feed it the same string a million times and get perfect branch prediction.
Replies: >>106169757
Anonymous
8/7/2025, 3:21:08 AM No.106169757
Screenshot from 2025-08-06 20-20-50
Screenshot from 2025-08-06 20-20-50
md5: 0ed6788948b6d61560a62e105c18b108๐Ÿ”
>>106169726
Replies: >>106169771 >>106185384
Anonymous
8/7/2025, 3:21:48 AM No.106169765
maxresdefault
maxresdefault
md5: 2b597f47ba9dd04a16d5f74012ff948f๐Ÿ”
>>106167245 (OP)
Nothing is wrong with goto. Nothing at all. Somebody once wrote a paper that included it in the title, and for decades, people have argued about nothing because they never read the paper and just took the title completely out of context.
Replies: >>106169859
Anonymous
8/7/2025, 3:22:20 AM No.106169771
>>106169757
>crab reinventing the wheel
but i thought you used rust to avoid exactly that...

so even rusts libs are shit
why do you even bother with this failed abortion of a language then?
Anonymous
8/7/2025, 3:22:37 AM No.106169774
>>106167245 (OP)
It looks nice and clean in this simple 1-ary example but start to spam it multiple times and you end up with spaghetti eldritch abominations. Although some kind of tracer or dependency graph utility would mitigate that.
Anonymous
8/7/2025, 3:23:44 AM No.106169782
>>106169725
Cope.
Replies: >>106169804
Anonymous
8/7/2025, 3:24:05 AM No.106169785
Screenshot_20250806_212329
Screenshot_20250806_212329
md5: d7c3f4765b50d29f43d207fdf8f4d78c๐Ÿ”
>>106169331
It's shit. Good code flows straight down the page, and doesn't jut out like this.
Replies: >>106170367 >>106174010
Anonymous
8/7/2025, 3:25:16 AM No.106169804
Screenshot from 2025-08-07 03-25-01
Screenshot from 2025-08-07 03-25-01
md5: 6f2eff5cae27708e6ad7b7025353e9b8๐Ÿ”
>>106169782
cope?
that YOU are a shit programmer?
i think you misunderstand the term...
heres a definition
Replies: >>106170651 >>106170688
Anonymous
8/7/2025, 3:28:09 AM No.106169839
>>106168052
you test it the same as any other function
you can't goto out of the function
it's not long jump
Replies: >>106169946
Anonymous
8/7/2025, 3:30:35 AM No.106169859
>>106169765
you could have written a paper decades ago titled "C considered harmful" and today you could write "C++ considered harmful". The fact that anyone as stupid as OP would be talking about goto is laughable.
Anonymous
8/7/2025, 3:41:51 AM No.106169946
>>106169839
If it's to get out of a loop there's the break and continue statements that can be used instead.
Replies: >>106169991
Anonymous
8/7/2025, 3:48:04 AM No.106169991
>>106169946
yeah but getting out of nested loops can be a mess
and is more expensive than a goto
you will have one additional conditional per nesting level you will be exiting
Replies: >>106170043 >>106170053
Anonymous
8/7/2025, 3:49:12 AM No.106169999
>one additional conditional
*at least one additional conditional
or at least a case statement
multiple jumps in any case
Anonymous
8/7/2025, 3:54:27 AM No.106170043
>>106169991
>getting out of nested loops can be a mess
Java solved this with labeled loops
Replies: >>106170056 >>106170059
Anonymous
8/7/2025, 3:56:04 AM No.106170053
>>106169991
I think it's an acceptable use of goto in that case. Specifically nested loops short enough not to be broken down into function calls.
Replies: >>106170079
Anonymous
8/7/2025, 3:56:28 AM No.106170056
>>106170043
goto is easier to read than labeled nested loops because the label is at the jump destination instead of before the start of the loop.
Replies: >>106170190
Anonymous
8/7/2025, 3:56:42 AM No.106170059
>>106170043
and c solved it with gotos ยฏ\_(ใƒ„)_/ยฏ
Replies: >>106170190
Anonymous
8/7/2025, 3:58:36 AM No.106170074
fuck goto i longjmp
Replies: >>106170096
Anonymous
8/7/2025, 3:58:57 AM No.106170079
>>106170053
theres also error handling
gotos instead of copying the same constructs all over the place
it makes stuff more readable and avoids duplicate code >>106167359
Replies: >>106170190
Anonymous
8/7/2025, 4:00:30 AM No.106170096
>>106170074
dangerously based
Anonymous
8/7/2025, 4:01:20 AM No.106170105
1748883269774392
1748883269774392
md5: 5b786f2ecc421bb1c1f1604812c997a8๐Ÿ”
>ummmm let me goto my error handling logic rather than implementing the Drop trait for my type
Replies: >>106170129 >>106170415 >>106174010
Anonymous
8/7/2025, 4:03:36 AM No.106170129
>>106170105
yeah
why would you need some retard-proofed constructs when a goto will do?
oh right
youre a crab, i tend to forget
Anonymous
8/7/2025, 4:09:42 AM No.106170190
>>106170059
goto can fly anywhere in a function, not just to a loop. it's not equivalent

>>106170056
outer: for (int r = 0; r < rows; r++) {
for(int c = 0; c < cols; c++) {
if (table[r][c] != 0) {
nonzero++;
continue outer;
}
}
}
what's difficult to read here?

>>106170079
that code looks awful
not because of any piece of the logic, but because C just looks awful
Replies: >>106170218 >>106170292 >>106170380
Anonymous
8/7/2025, 4:12:27 AM No.106170218
>>106170190
>goto can fly anywhere in a function, not just to a loop. it's not equivalent
yeah
goto is better
it makes for a simpler language

>not because of any piece of the logic, but because C just looks awful
its bootyful
its just that you have bad taste
Anonymous
8/7/2025, 4:19:27 AM No.106170292
>>106170190
I've never seen this before. I would not mind this in C at all desu.
I usually either use a flag, or if my iterator variable is local to the loop I make it break the condition.
But a named loop is sexy
Anonymous
8/7/2025, 4:20:41 AM No.106170305
>>106167315
No it fucking doesn't.
Anonymous
8/7/2025, 4:21:14 AM No.106170316
>>106168348
it's telling that nobody has even commented on this
Replies: >>106170336
Anonymous
8/7/2025, 4:23:11 AM No.106170336
>>106170316
duh. talking to fptranies is a waste of everybody's time
Replies: >>106170345
Anonymous
8/7/2025, 4:24:08 AM No.106170345
>>106170336
>he thinks he is always correct
Replies: >>106170382
Anonymous
8/7/2025, 4:26:45 AM No.106170367
>>106169785
eh, you get used to it, and it adds "texture" to your codebases
Lisp has one of the most braindead-simple indentation/alignment methodologies of any language, once you learn it
Replies: >>106170383
Anonymous
8/7/2025, 4:28:01 AM No.106170380
1629302492171
1629302492171
md5: 8a58ba2dcac682104900fdd70ab6fe20๐Ÿ”
>>106170190
>because C just looks awful
OK, and? You're not one of those eLeGanT cOdE retards, are you?
Replies: >>106170390
Anonymous
8/7/2025, 4:28:09 AM No.106170382
>>106170345
projection as evidenced itt
hopefully at least you know what a reference is, kek
Replies: >>106170400
Anonymous
8/7/2025, 4:28:12 AM No.106170383
>>106170367
I've never used LISP, but have been reading about rule-based expert systems. Which, of the like 1 that exists, is written in LISP. Can confirm, LISP is dogshit simple to read
Replies: >>106170530
Anonymous
8/7/2025, 4:29:14 AM No.106170390
anakin_padme_enviro
anakin_padme_enviro
md5: f8c4965e727f88907738a70e8a6afda6๐Ÿ”
>>106170380
c looks beautiful if youre into industrial aesthetics
Replies: >>106170432
Anonymous
8/7/2025, 4:30:21 AM No.106170400
1746498365972834
1746498365972834
md5: 771a9028f58a370c91cb7eff420ceb18๐Ÿ”
>>106170382
>ummm I hope you know what a pointer is :^)
>I'm, like, pointin' around
Replies: >>106170408
Anonymous
8/7/2025, 4:31:21 AM No.106170408
>>106170400
>basedquote
and then you act surprized people think you have fuck all to say
you suck even at shitposting
Replies: >>106170439
Anonymous
8/7/2025, 4:32:20 AM No.106170415
>>106170105
>Hidden logic is good bro! Every other lang that did that didn't turn into mandatory LSP slop.
Anonymous
8/7/2025, 4:33:21 AM No.106170432
1623857992217
1623857992217
md5: 2f83c45bc2022ad607ad089b726bd2fc๐Ÿ”
>>106170390
Anonymous
8/7/2025, 4:34:22 AM No.106170439
i-am-a-surgeon-good-doctor-734054251
i-am-a-surgeon-good-doctor-734054251
md5: ddafcf00ae2d3d5da6afb5f997dade8c๐Ÿ”
>>106170408
99% of functional programmers have done imperative shit
maybe 5% of imperative programmers have done functional (and immutable) shit
which side do you think knows more? why don't ya, POINT to the side you guess?
lmao, get it?
point?
Replies: >>106170451 >>106170456
Anonymous
8/7/2025, 4:34:28 AM No.106170440
goto is harmful inasmuch as C itself is harmful
Replies: >>106170505
Anonymous
8/7/2025, 4:35:34 AM No.106170448
1743622989564406
1743622989564406
md5: ed26b54e8ad90639054240435f8df2f8๐Ÿ”
>defer technical spec coming in C2Y
>mogs your favorite language
Anonymous
8/7/2025, 4:35:57 AM No.106170451
>>106170439
>99% of functional programmers have done imperative shit
then they havent done enough of it because as a rule theyre retarded
3 separate fptranies ITT didnt know about references
Anonymous
8/7/2025, 4:36:36 AM No.106170456
1749917055005218
1749917055005218
md5: 39a06dd109563293703ef554526395c3๐Ÿ”
>>106170439
>which side do you think knows more?
Imperative programmers.
Replies: >>106170778
Anonymous
8/7/2025, 4:41:24 AM No.106170505
>>106170440
Source for either of those claims?
Replies: >>106170523
Anonymous
8/7/2025, 4:43:15 AM No.106170523
>>106170505
why would you need a source
hes right
gotos are as harmful as c.
which is as harmful as a hammer. or a kitchen knife. or a screwdriver
Replies: >>106170669
Anonymous
8/7/2025, 4:43:52 AM No.106170530
>>106170383
what do you think of them so far? I've been meaning to learn Prolog or similar. I find the concepts similar to databases (as far as I am aware), which I find incredibly powerful, mainly due to their autonomous use of indexes, which are a grouping of data structures without the need to keep them in sync manually.
there have been some problems where I have given consideration to using an in-memory database purely due to this fact (as well as the trivial ability to write complex queries)
Replies: >>106170551 >>106170783
Anonymous
8/7/2025, 4:44:32 AM No.106170536
>>106167245 (OP)
compiler won't let me jump over allocations
Anonymous
8/7/2025, 4:45:49 AM No.106170551
>>106170530
>cue 3-4 more samefags
>until you realize nobody gives a shit about you
>and then right back to shitflinging
such is the MO of the fptrany
Anonymous
8/7/2025, 4:47:46 AM No.106170569
chad-bizzare
chad-bizzare
md5: 9d7155668313bb4eb616ac97396bec82๐Ÿ”
>>106167716
i don't like the for loop syntax
Replies: >>106174019
Anonymous
8/7/2025, 4:57:43 AM No.106170651
>>106169804
>still coping
Kek.
Replies: >>106170688
Anonymous
8/7/2025, 4:59:05 AM No.106170669
>>106170523
>no source provided
I accept your concession.
Anonymous
8/7/2025, 5:00:21 AM No.106170683
>forget to have statement that makes it return to the top
>it skips all the code in between
Anonymous
8/7/2025, 5:00:31 AM No.106170684
>>106167716
You see backward jumps working around hardware errata. For example, let's say, statistically, some hardware tx function wedges itself once every 100 days under 100% utilization because some chink XAUI block tied together by chinks shits itself, and you're 21 layers deep in call stack. You'll just want to detect it, reset the block, delay a bit, then jump back up to where you were before and fall through again. You'd do this rather than changing shit around "the right way" because some chemical plant loses $1M per minute of downtime and changing the other shit may cause timing differences, different compiler paths, etc, etc, plus more time for QA approval. When you have to do this, it's the least bad thing to do.
Anonymous
8/7/2025, 5:01:20 AM No.106170688
>>106170651
>coping is when i get called out
err no
i even posted a handy picrel for you
>>106169804
Replies: >>106170716
Anonymous
8/7/2025, 5:01:38 AM No.106170690
>>106167245 (OP)
this particular problem is best left to the compiler. its not that humans cant, its just that its boring and easy to fuck up.
c does it right that it limits you to function scope. don't ever go full longjmp()
Replies: >>106170711
Anonymous
8/7/2025, 5:03:39 AM No.106170711
challenge
challenge
md5: 2d4117e84ac0854b955c3f2383886316๐Ÿ”
>>106170690
>don't ever go full longjmp()
>mfw
Anonymous
8/7/2025, 5:04:20 AM No.106170713
>>106167245 (OP)
It's bad for the same reason that raw ASM is bad. Structured programming concepts (e.g. loops, if statements, etc) better conveys the intention of a goto statement in a more clear way. Considering that, when you do see goto (like goto exit in a c function) it's pretty clear what the intention is.
Anonymous
8/7/2025, 5:05:11 AM No.106170716
1728106392906172
1728106392906172
md5: d73d36fae26b8405175d48ff52160ec0๐Ÿ”
>>106170688
this is me reading your absolute insanity
Replies: >>106170720
Anonymous
8/7/2025, 5:06:00 AM No.106170720
>>106170716
>code monkey
about on par with what i expected
Replies: >>106170753
Anonymous
8/7/2025, 5:09:31 AM No.106170753
1750705633486587
1750705633486587
md5: bbbc5d4c79f1b4f1f1f271da2051c565๐Ÿ”
>>106170720
Replies: >>106170771
Anonymous
8/7/2025, 5:11:08 AM No.106170771
>>106170753
you quite literally did this to yourself though
Replies: >>106170788
Anonymous
8/7/2025, 5:11:53 AM No.106170778
ack
ack
md5: 0a2aa31219bd9fb915ff7abb0b213625๐Ÿ”
>>106170456
BASED hasklel
Replies: >>106170790
Anonymous
8/7/2025, 5:12:45 AM No.106170783
>>106170530
I had taken a course on "AI", not GPT, where we really only spent a couple weeks with expert systems.
I've been on & off reading the book "Rule-Based Expert Systems" (Buchanan, Shortliffe, et. al).

Databases are more suited towards large amounts of generic information that is processed 1 by 1. Or commonly referenced records.
In an Expert System you're dealing with just 3 sets of information. In this case its a large LISP program, so everything is in LISP syntax, including factors, rules, goals, everything.
The program doesn't quite work on large amounts of data at once, but bite-size pieces of information, like "bob is a man", "bob is over 30", "the culture was received from a sterile site", "the sample site was blood", "blood is normally sterile". These are all given certainty factors (not conditional) to provide confidence to the assertions.

I think the relationship with databases would basically start and end with conditional logic. After that, the use-cases are just too far apart. an expert system is focusing on processing rules, while when you use a database you're looking to process the data itself. I think you would rarely find yourself doing any time of set operation on a table, in an expert program.

I've never actually looked at PROLOG before, once I finish my non-data science project I might check it or LISP out. Ever since I took that course on AI I have been kinda just looking for an excuse to build an expert system. But I don't have day-to-day problems that require expert level knowledge.
Replies: >>106171220
Anonymous
8/7/2025, 5:13:22 AM No.106170788
1732360469614638
1732360469614638
md5: 9d0725afcad0a4c6b1a774fe5a5334e6๐Ÿ”
>>106170771
Replies: >>106170861
Anonymous
8/7/2025, 5:13:30 AM No.106170790
>>106170778
why the animal abuse?
everyone seems to hate the poor gophers
idk the language but they seem to be pretty chill people...
Replies: >>106170827
Anonymous
8/7/2025, 5:13:37 AM No.106170791
1754536408952
1754536408952
md5: df6d0209f068f2e9358673c2ea05ca55๐Ÿ”
>goto line x
>code is added above the goto code later
Replies: >>106170824 >>106174019
Anonymous
8/7/2025, 5:16:53 AM No.106170824
>>106170791
basic?
10 PRINT "Enter a number (0 to exit):"
20 INPUT N
30 IF N = 0 THEN GOTO 70
40 PRINT "You entered: "; N
50 GOTO 10
70 PRINT "Goodbye!"
80 END
Replies: >>106170875
Anonymous
8/7/2025, 5:17:08 AM No.106170827
>>106170790
>everyone seems to hate the poor gophers
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.
Replies: >>106170861
Anonymous
8/7/2025, 5:21:16 AM No.106170861
>>106170788
>more self harm
anooon
you dont need to do this
just write in c, its gonna cure all your problems
it cured my erectile deficiency AND my male pattern baldness

>>106170827
you mean
>bully them into writing good code?
hmmmm. this opens many possibilities...
Anonymous
8/7/2025, 5:21:38 AM No.106170865
fortran_forever
fortran_forever
md5: 8fb9a13c54a0651417896be696a0cfc9๐Ÿ”
>>106167245 (OP)
Nothing is wrong with it. Embrace the goto.
Replies: >>106170979
Anonymous
8/7/2025, 5:22:30 AM No.106170875
>>106170824
Right I was mistaken
Replies: >>106170906
Anonymous
8/7/2025, 5:26:18 AM No.106170906
>>106170875
'happens to the best and god witness were not amongst them
Anonymous
8/7/2025, 5:35:34 AM No.106170979
>>106170865
based fortranchad
Anonymous
8/7/2025, 6:12:32 AM No.106171220
>>106170783
>expert systems
oh fuck is it the 80s again?
Replies: >>106171444
Anonymous
8/7/2025, 6:15:25 AM No.106171248
>>106167245 (OP)
Deprecated by throw.
Replies: >>106171302 >>106171365
Anonymous
8/7/2025, 6:21:13 AM No.106171302
>>106171248
fuck your throw. try catch these nutz, faggot
Anonymous
8/7/2025, 6:28:01 AM No.106171365
>>106171248
i see your investment with dr mr durgasoft has paid off
Anonymous
8/7/2025, 6:38:02 AM No.106171444
>>106171220
I want to believe they have some use.... Like running an expert system in EU4 or some other overly convoluted game. I think if I did end up learning prolog to make one (whic btw, check this semi-broken webpage out https://cinuresearch.tripod.com/ai/www-cee-hw-ac-uk/_alison/ai3notes/all.html) I'd start out with something like resource management and production planning in space engineers/factorio...
Anonymous
8/7/2025, 6:40:50 AM No.106171474
1746741035742148
1746741035742148
md5: 1d8cfa4aa9cc36ca66a360e9114a90c3๐Ÿ”
>>106168069
Linearity is the reason why every programming language sucks at concurrency, by the way.
(โ—__โ— ) NPC
8/7/2025, 6:48:41 AM No.106171530
goto breaks the natural flow of the structured code. Sussman and Guy Steele fixed that with the lambda expression.
Replies: >>106172094
Anonymous
8/7/2025, 7:03:21 AM No.106171638
>>106167354
>Isn't this just like a JMP instruction?
Very similar concept.
Most high level language users have no idea how computers or CPUs actually work.
The code gen people of your favorite language definitely know how they work.
It's just a cargo cult opinion that goto's are bad, because nobody perpetrating the myth has used/seen/experienced a large-scale BASIC program that abused them.
In 2025, we tend to use GOSUB more since there's less overhead than we had in the 80s.
Replies: >>106173217
Anonymous
8/7/2025, 8:25:31 AM No.106172094
5D56445B-8406-4C62-8FD7-06716F22B5D2
5D56445B-8406-4C62-8FD7-06716F22B5D2
md5: 1f3fbf6459497afde0aa4346de10bcc6๐Ÿ”
>>106171530
> Sussman and Steele invoked
Plase be informed that even the lisp machineโ€™s bytecode implements unconditional branch instructions.
Replies: >>106172117
Anonymous
8/7/2025, 8:28:44 AM No.106172117
>>106172094
no one care about the implementation, this is irrelevant.
Anonymous
8/7/2025, 8:31:05 AM No.106172132
>>106168119
I washed my penis.
Anonymous
8/7/2025, 8:31:56 AM No.106172136
>>106168069
So functions should not have loops or other control flow constructs either. Exceptions shouldn't exist. Function calls shouldn't exist either, especially recursion. You are a retard.
Replies: >>106174372
Anonymous
8/7/2025, 8:33:36 AM No.106172148
goto is kind of amateur.
computed goto is where it's at. Subhuman trash never got to the first instruction set.
Anonymous
8/7/2025, 8:35:23 AM No.106172162
Why are you all getting so angry? Why can't we just delete science and shitwash over it like the subhumans we are? No more goto. Only clearly *clap* defined *clap* functions.
Anonymous
8/7/2025, 8:37:41 AM No.106172178
Is everyone here a jobless neet or something?
You'll never see goto at production code and for good reason
Anonymous
8/7/2025, 8:41:15 AM No.106172197
>>106168386
>I don't see how that's better
you don't need to keep track of a label outside the loop just to exit it, especially if you modify something down the line
Anonymous
8/7/2025, 8:46:50 AM No.106172221
>>106167245 (OP)
Nothing. The goto that the original paper complained about was the completely unrestricted one that could jump forward, backward, into completely different parts of the program.
Not the gimped goto that's in modern programming languages. And even then, he advocated for more modern structures like if with blocks, for loops etc where it makes sense, not for a complete ban of goto. Just use the more "restricted" constructs where they work and reach for goto as a last resort.

Of course the modern programmer doesn't understand that. They read the title, they think
>goto? Programming languages have a goto keyword, so it must be that one!
and then cry and piss themselves in fear that the evil goto boogeyman will explode their program if they use the goto keyword even once, even where it makes sense.
Anonymous
8/7/2025, 8:47:13 AM No.106172226
>>106167699
you can just break out of an if statement in java directly
bye:
if (condition) {
break bye;
}


a label can be slapped on any statement, you can even slap it on the break statement itself
wtf:
break wtf;


try it https://learn.java/playground
Anonymous
8/7/2025, 9:43:26 AM No.106172551
e72ef3d39ef1ffd40ffb8aff12e52e2f
e72ef3d39ef1ffd40ffb8aff12e52e2f
md5: bff5a204f8f64947499c131270c5f292๐Ÿ”
There is ABSOLUTELY NOTHING WRONG with computed jumps UP the function call stack.
Anonymous
8/7/2025, 9:46:46 AM No.106172576
>>106167245 (OP)
goto loops ignore scope and can roll into eachother unlike real loops which has a defined body
this is the main problem with it
Replies: >>106172606 >>106172715 >>106175087
Anonymous
8/7/2025, 9:50:56 AM No.106172606
>>106172576
just to add, this is called structured programming. the naming is coming back with structured concurrency
Replies: >>106175087
Anonymous
8/7/2025, 9:53:31 AM No.106172624
wait until you see structured metaprogramming
Replies: >>106172659
Anonymous
8/7/2025, 9:58:18 AM No.106172659
>>106172624
metaprogramming is just programming, which is already structured, sadly. structure gang won
Anonymous
8/7/2025, 10:01:03 AM No.106172681
I've never heard anyone say it's bad, I've only heard people say it should only be used when it's more succinct to do so. Like specifically with error handling and cleaning up memory.
Replies: >>106174019
Anonymous
8/7/2025, 10:03:00 AM No.106172698
>>106167359
I've never used goto (outside asm) and I've programmed in C11 for years. What even happens to all the variable declarations/expressions you skip with it, you just have to know to never reference them after goto?
Replies: >>106173037
Anonymous
8/7/2025, 10:08:08 AM No.106172715
>>106172576
>goto loops ignore scope
Oh.
I know that.
When I want to ignore scope and jump to a random address, I will do so.
The computer does what I want. I will not abide by arbitrary limitations based on some uninformed fanciful opinion that someone had.
Replies: >>106172790
Anonymous
8/7/2025, 10:20:17 AM No.106172790
>>106172715
you're welcome to write spaghetti code
Replies: >>106175096
Anonymous
8/7/2025, 11:01:30 AM No.106173017
>>106167394
>goto makes code hard to read. that's it. the actual problem.
I agree functions also make code hard to read, why have them for anything but external calls.
Replies: >>106173134
Anonymous
8/7/2025, 11:05:02 AM No.106173037
>>106172698
>variable declarations
local variable are allocated on the stack all at once in the function prelude
>expressions
same thing that the else branch of a conditional when the condition is true, it's not executed
Replies: >>106173108 >>106182359
Anonymous
8/7/2025, 11:12:18 AM No.106173086
>>106169630
Not if you don't allocate on the heap dummy.
Anonymous
8/7/2025, 11:14:58 AM No.106173108
>>106173037
Yeah sure, so their memory contents are just uninitialized then.
Replies: >>106173166
Anonymous
8/7/2025, 11:18:33 AM No.106173134
>>106173017
>functions also make code hard to read
substantiate your claim
Replies: >>106174019
Anonymous
8/7/2025, 11:24:00 AM No.106173166
>>106173108
if you jump over the assignment then yes. allocating stack space and assignments are distinct operations
Replies: >>106173180
Anonymous
8/7/2025, 11:26:49 AM No.106173180
>>106173166
Interesting of you to clarify that, as if it wasn't obvious from the discussion, but whatever I guess.
Replies: >>106173192
Anonymous
8/7/2025, 11:29:06 AM No.106173192
>>106173180
The answer to your initial question was very obvious in the first place. Obvious is what you were asking for.
Replies: >>106173212
Anonymous
8/7/2025, 11:29:49 AM No.106173199
>>106167245 (OP)
It is difficult to debug
Replies: >>106174019
Anonymous
8/7/2025, 11:31:37 AM No.106173212
1742478328407364
1742478328407364
md5: 9032f8754e987d4750e6d38eb5cb45b9๐Ÿ”
>>106173192
One could say it should've been obvious, but I don't like assuming things blindly. I've never had to know this detail so I asked about it and you delivered, so thanks for that.
Anonymous
8/7/2025, 11:32:17 AM No.106173217
>>106171638
>Why ain't people just code in binary since everything gets compiled down to binary code anyways
Try a bit and you might realize why programming languages were established in the first place.
Anonymous
8/7/2025, 11:39:57 AM No.106173274
>>106167245 (OP)
we have production code with thousands of macros that uses gotos under the hood.
Makes the code only readable because the macros are used, otherwise for anything over 300 lines it becomes a mess.
Anonymous
8/7/2025, 11:45:02 AM No.106173300
>>106167315
>it doesn't matter what the scope is
you can't go out of scope with modern gotos retard.
the jump instruction and the label needs to be in the same function, or it won't even compile.
Anonymous
8/7/2025, 12:56:56 PM No.106173748
>>106167245 (OP)
it should only be used to kill code repetition, for example if you need to do a job inside a loop that accounts to 600 lines of code and then you need to do the same job outside the loop, you would not just copy paste the 600 lines, thats playing with fire, as there is no gurantee your monkey brain wont do slight barely visible changes to one part of it
Anonymous
8/7/2025, 1:00:12 PM No.106173771
>>106167245 (OP)
Gotos are only really useful in languages which allow indirect reference. If you aren't using indirection to determine your labels, there isn't much of a reason to use them.
Replies: >>106174081
Anonymous
8/7/2025, 1:07:20 PM No.106173811
>>106167378
This. If you need goto you should probably be writing assembly anyways. Goto is an assembly idea (jump instruction) ported to C for low-level programming. But if you go this low-level then you might as well write straight assembly.
Anonymous
8/7/2025, 1:13:07 PM No.106173844
>>106167267
based

>>106167326
>It makes the code harder to read
Not really, depends but sometimes a goto is the simplest and clearest solution. Like when you're deep in nested shit and you have to get out of the whole thing.

>>106167359
goto error; is a perfectly fine way of doing things. I'll tell you what really makes your code spaghetti:
>just put parts of your function into their own function that won't be reused because that's Clean Codeโ„ข that won't need commenting so when you read the parent function you have to jump to all the subfunctions to see what they do
>no you can't just write numbers bro you have to use macros and enums so whenever you want to know what's going on you have to jump to their definition in another file

>>106167315
>shift control
I don't speak tranny so idk what that means. Goto go jmp, you need jmp.

>>106167636
based

>>106167656
>Oh noo my flow is all broken
wtf does that even mean lmao, an if or loop might do the same thing to your flow, but might look worse. It's all in your head.

>>106167716
Sometimes I use goto to loop. I can't think of any problem with that, it's no worse than a normal loop, it's straightforward, it's natural, it just werks.

start:
<do a bunch of stuff>
if (condition) goto start;

>b-but you could use a do-while loop
Why? To add another level of indentation and do exactly the same thing? There's another advantage, I can do this:

start:
<do a bunch of stuff>
if (condition) goto start;
<do a bunch of stuff>
if (condition) goto start;
<do a bunch of stuff>
if (condition) goto start;

>>106168069
>the linearity of reading line after line is still ruined
same thing with any other loop lmao

>>106168119
>but 99% of the times there are cleaner alternatives
No, also if there are I don't care. When I write something I don't consider all the alternatives that retards who get their ideas from books might like, if it werks it werks, if it's good enough it's good enough.
Replies: >>106182122
Anonymous
8/7/2025, 1:18:29 PM No.106173872
>>106167699
More languages should be like perl.
outer:
while (1) {
while (1) {
if (condition) {
last outer;
}
}
}
Anonymous
8/7/2025, 1:27:56 PM No.106173927
>>106167693
>if you know you know
>first reply clearly doesn't know
Anonymous
8/7/2025, 1:41:31 PM No.106174010
>>106168349
>>106168624
No one said anything about a return.

>>106168041
This, everybody jumps
>b-but I read in a book written by some retard that this way of jumping is le spaghetti!!

>>106168380
Contrived example that uses goto like function calls. Just because you can think of a bad example doesn't mean there are no good examples. The best uses of goto aren't for doing the equivalent of calling a function, it's for skipping some stuff, getting out of some stuff or looping.

>>106168465
Why not just goto at this point?

>>106169206
Yep, it's all jumps, anything that obscures that is just an illusion.

>>106169702
>it's very unreadable
no it isn't

>>106169785
This is the most ridiculous thing to complain about

>>106170105
>Drop trait for my type
These words mean literally nothing to me. I'll blame trannies for making up these words.
Replies: >>106174261
Anonymous
8/7/2025, 1:42:32 PM No.106174019
>>106170569
based

>>106170791
>>goto line x
We're talking about gotoing to labels

>>106172681
Dangerously moderate opinion, we can't have that here. Either gotos are dangerously based or goto writers are madmen/unemployed nocoders.

>>106173134
You have to jump to them to see what they do. It's much better to have a paragraph of code in your function with a comment right about it that says what the paragraph does. Functions are just when you need some code more than once, then they're a necessary evil.

>>106173199
It isn't.
Replies: >>106174261
Anonymous
8/7/2025, 1:57:18 PM No.106174081
>>106173771
This is true, but the board is full of zoomers who have never heard of indirection, so they're just arguing about readability and if you should listen to people who say it is a bad practice or not.
Anonymous
8/7/2025, 2:08:56 PM No.106174156
>>106167716
>Jumping back though? That we don't do.
if (cond_unlikely1) {
goto unlikely1;
}
ok1:
if (cond_unlikely2) {
goto unlikely2;
}
ok2:
if (cond_unlikely3) {
goto unlikely3;
}
ok3:
// work
return val;

unlikely1:
// realloc
goto ok1;
unlikely2:
// realloc
goto ok3;
unlikely3:
// realloc
goto ok3;
Replies: >>106174263
Anonymous
8/7/2025, 2:23:17 PM No.106174261
>>106174010
>>106174019
>Contrived example that uses goto like function calls
read the context of the post

>You have to jump to them to see what they do.
you missed the point where I can also not jump into them and instead can skip over and continue reading line by line
which you can't do with goto because it doesn't return
>It's much better to have a paragraph of code in your function with a comment right about it that says what the paragraph does
it's not
in most cases, a well-named function replaces the need for a comment
also comments should state the 'why', not the 'what' - the 'what' is the code itself, no point in duplicating information
>Functions are just when you need some code more than once
functions also allow for tighter scoping of variables - each section of code will usually not need every variable to be in scope, so separate functions can use fewer and only the relevant parameters
another point is that all IDEs and many text editors offer an outline view of a source file - a list of all functions. this works like a table of contents in a book, enabling easier and faster navigation over the source file.
yet another point is that functions are easier to share or work on separately when working on a shared codebase by a team
Anonymous
8/7/2025, 2:23:26 PM No.106174263
>>106174156
it doesnt make sense, just put your shit in the corresponding if block
Replies: >>106174397
Anonymous
8/7/2025, 2:37:39 PM No.106174372
>>106172136
>So functions should not have loops or other control flow constructs either
loops, ifs, switches, etc. you can skip over them and continue reading what's after
you can't skip over a goto because nothing at that point says if/when the code after it will be executed
>Exceptions
as the name implies, they're for exceptional situations
and the main thing they do better than goto for exceptional purposes: they do not mix into the regular logic, instead they have a separate and distinct throw/try-catch mechanism
>Function calls shouldn't exist either
ad absurdum
>You are a retard.
ad hominem
Anonymous
8/7/2025, 2:39:42 PM No.106174397
>>106174263
that way there are no jumps in the fast path and the you can improve code density, good for the code cache
Replies: >>106174428 >>106174452 >>106174638
Anonymous
8/7/2025, 2:42:33 PM No.106174428
>>106174397
thats smart.
not taken
Replies: >>106174452
Anonymous
8/7/2025, 2:44:47 PM No.106174445
>>106168467
theres literally hardware instruction for goto, JMP
you're dumb normie kys
Anonymous
8/7/2025, 2:45:53 PM No.106174452
>>106174397
>>106174428

*notE taken
Anonymous
8/7/2025, 3:09:48 PM No.106174638
>>106174397
why don't you autists try doing something productive like writing compilers that do all of this shit for you? you would learn far, far more.
Replies: >>106174674 >>106174922
Anonymous
8/7/2025, 3:15:23 PM No.106174674
1406902586145
1406902586145
md5: feaa61505aa82b9a132f92cd892aaa93๐Ÿ”
>>106174638
>something productive
>like writing compilers
Replies: >>106174696
Anonymous
8/7/2025, 3:18:07 PM No.106174696
>>106174674
it's way more fucking productive than trying to optimize your cache use by using goto for some code that probably only you run on datasets that are less than a gb (I'm being very generous here)
Replies: >>106174804 >>106174961
Anonymous
8/7/2025, 3:22:16 PM No.106174733
It's too powerful a tool for mortals. Imagine if you, a human, had the ability to teleport. Before long you'd kill yourself teleporting somewhere stupid. GOTO is unconstrained code teleportation.
Anonymous
8/7/2025, 3:28:06 PM No.106174784
GOTO would be cool if it maintained variable scope. Like, you maitain the state for each scope you jump out of and can return to it later. You could explicitly take variables with you too.
Replies: >>106174904 >>106174988
Anonymous
8/7/2025, 3:30:39 PM No.106174804
Screenshot from 2025-08-07 15-29-32
Screenshot from 2025-08-07 15-29-32
md5: 2b77840791e30291f2ddcec7cea3bf38๐Ÿ”
>>106174696
>yeah just write several milions lines of code instead of using your brain for 5 minutes and drop a well placed goto
not to mention your hand optimization > compiler's

what is it with retards and the need to inject their retard non-opinions into every discussion they take part in?
is it because of reddit?
Replies: >>106174842
Anonymous
8/7/2025, 3:33:56 PM No.106174842
>>106174804
>he doesn't know of the concept of adding his work to an existing compiler, or working with a fork
oh look, a learning opportunity.
Replies: >>106174886
Anonymous
8/7/2025, 3:34:24 PM No.106174845
>>106167245 (OP)
It's perfectly acceptable.
Anonymous
8/7/2025, 3:38:36 PM No.106174886
>>106174842
>implying the compiler has cognizance of the data you will be working with

ill let your brains warm up before explaining

you set?
lets go
lets say you have a set of numbers you have to sort
lets say you know the only disorder in the list will be a couple numbers that have to be permutated

a naive permutation sort will be the fastest algorythm for the job
but would be the one of the slowest performing ones on any other dataset
choosing he right algo for the data is the first step in optimization
and is perhaps one of, if not the most powerful optimization technique.

and a compiler is completely incapable of it, and never will be, because a compiler doesnt have cognizance of the data it will be working with
now go back to your studies, you have yet alot to learn
Replies: >>106174911
Anonymous
8/7/2025, 3:40:00 PM No.106174904
>>106174784
this has similarities with how Prolog is compiled
Anonymous
8/7/2025, 3:40:45 PM No.106174911
>>106174886
>implying the annotation of information for compilers is an unthinkable concept
surely you know of type annotations, Python decorators, etc.?
I highly suggest taking your brain and its optimizations capabilities, evaulating what information you process when driving them, and identifying manners of representing these sets of information in a manner visible and useful to a computer.
Replies: >>106174952 >>106175027
Anonymous
8/7/2025, 3:41:18 PM No.106174922
>>106174638
of course, this kind of stuff is meant for people generating assembly/machine code
Anonymous
8/7/2025, 3:43:30 PM No.106174952
>>106174911
for example, what could a compiler do with a new branching construct, called `unlikely_if`?
Replies: >>106175229 >>106175390
Anonymous
8/7/2025, 3:44:07 PM No.106174961
>>106174696
writing compilers is the ultimate busywork and pseudointelligent wankery

writing something productive means writing software with actual features and for actual users
if you write code that is not meant to be used by anyone - it's not productive
Anonymous
8/7/2025, 3:45:43 PM No.106174988
>>106174784
anon, you have invented functions
Replies: >>106175380
Anonymous
8/7/2025, 3:48:38 PM No.106175027
>>106174911
>implying the annotation of information for compilers is an unthinkable concept
this is dumb, bc it doesnt cut the crap, it cannot cut the crap given the complexity of the problem and why do things in a roundabout way to begin with?
also compilers are not code generators, theyre code translators
it still up to the programmer to express the algorythm thats expected to be compiled

>I highly suggest taking your brain and its optimizations capabilities, evaulating what information you process when driving them, and identifying manners of representing these sets of information in a manner visible and useful to a computer.
so that retards can do the same?
no. fuck em.
if i wont benefit from opensourcing something then i wont opensource it.
if i wont benefit from creating procedures, then i wont create them.

i have no qualm with using opensource myself because if people wanna work for free thats their choice
but its not something i will do myself
Replies: >>106175048
Anonymous
8/7/2025, 3:50:23 PM No.106175048
1723483229659790
1723483229659790
md5: dcba80e53e78cc546a6b50292586245c๐Ÿ”
>>106175027
so you're retarded
I thought we were getting somewhere
oh well, I like the idea of `unlikely_if`, and similar concepts. I will add it to the todo list, and maybe get around to it one day after I finish my other 20 projects on the backlog.
Replies: >>106175086
Anonymous
8/7/2025, 3:53:35 PM No.106175086
>>106175048
>doesnt know shit about optimization
>doesnt understand shit about the discourse
when are you going back?
Anonymous
8/7/2025, 3:53:36 PM No.106175087
>>106172576
>>106172606
Lowest IQ poster ITT. I fear for your offspring, should you have any.
Anonymous
8/7/2025, 3:54:37 PM No.106175096
>>106172790
t. "JavaScript Engineer"
Anonymous
8/7/2025, 3:55:59 PM No.106175112
>>106167716
>Jumping back though? That we don't do.
Who's "we". I do that and code circles around you.
Anonymous
8/7/2025, 4:07:45 PM No.106175229
>>106174952
not him but modify the order of the basic blocks, or emitting branch prediction hints before conditional branches for architectures that have it. x86 has it but it may have been deprecated now and may do nothing, not sure

It can also be used to determine how to best compile the body of a loop (that has been unrolled or for SPMD or GPUs) when there are branches inside, wether use normal branches or do an if-conversion which allows you to remove conditional branches but at the cost of always executing all paths. This will only lead to faster code if the branches have a similar number of instructions and if there isn't an unlikely branch. basically
Replies: >>106175246 >>106175381 >>106175406
Anonymous
8/7/2025, 4:09:47 PM No.106175246
>>106175229
forgot to say that the if-conversion thing and removing the conditional branches is to be able to vectorize a piece of code that has conditionals
Replies: >>106175381
Anonymous
8/7/2025, 4:25:16 PM No.106175380
>>106174988
No, functions have a single entry point. I want functions with an offset.
Anonymous
8/7/2025, 4:25:19 PM No.106175381
>>106175229
>>106175246
Least obvious larping compiler engineer.
Replies: >>106175980
Anonymous
8/7/2025, 4:25:57 PM No.106175390
>>106174952
look at the linux kernel. they have a likely/unlikely macro over a gcc builtin
Anonymous
8/7/2025, 4:27:02 PM No.106175406
>>106175229
>emitting branch prediction hints before conditional branches for architectures that have it
That's not how branch prediction works in 2025, you dumb fuck. Stop larping.
Replies: >>106175980
Anonymous
8/7/2025, 4:35:03 PM No.106175518
>>106167636
>>106167699
>break 2;
Now what?
Anonymous
8/7/2025, 4:53:58 PM No.106175763
>>106167708
Easier said then done when you're on a project with 100+ programmers, fag
Replies: >>106175795 >>106175809 >>106179443
Anonymous
8/7/2025, 4:55:59 PM No.106175795
>>106175763
there should never be a singular project with more than 5 devs, and even that is pushing it (I prefer 3 for tolerance of negative effects such as unexpected dev death).
break out your project into smaller projects. programming languages have great support for this concept, called "libraries."
Anonymous
8/7/2025, 4:57:01 PM No.106175809
t
t
md5: 3cbd1a0d9c57a5dcc2f36c02c4bde21c๐Ÿ”
>>106175763
>100+ programmers
>on a single project
Replies: >>106175820
Anonymous
8/7/2025, 4:57:50 PM No.106175820
>>106175809
>monkeys and typewriters
Anonymous
8/7/2025, 5:09:17 PM No.106175980
>>106175381
problem?
>>106175406
finish reading the sentence
Anonymous
8/7/2025, 6:41:05 PM No.106177007
>>106167245 (OP)
>Explain what's wrong with it
The instruction says "go to label" but the program actually goes below the label. Wtf
Anonymous
8/7/2025, 7:53:30 PM No.106179018
>>106167267
fpbp
Anonymous
8/7/2025, 8:08:46 PM No.106179443
>>106175763
>a project with 100+ programmers
What the fuck? Where do you work at?
Replies: >>106181952
Anonymous
8/7/2025, 10:49:07 PM No.106181952
>>106179443
that github repository that the pajeet youtube tutorial linked to and 100+ shitskins make pull requests for changing a sentence in the readme or some comment
Anonymous
8/7/2025, 10:50:41 PM No.106181971
_132760476_crgettyimages-1062710576
_132760476_crgettyimages-1062710576
md5: c03af8a1c0ba4b78fba4910182dc8430๐Ÿ”
>>106167267
>clean your code, bucko.
Anonymous
8/7/2025, 11:01:24 PM No.106182122
>>106173844
>just put parts of your function into their own function that won't be reused because that's Clean Codeโ„ข that won't need commenting so when you read the parent function you have to jump to all the subfunctions to see what they do
This makes the overall structure of the function more readable. And your function names should say what they do.
>no you can't just write numbers bro you have to use macros and enums so whenever you want to know what's going on you have to jump to their definition in another file
Likewise using enums or named constants means that instead of say "12" you have "MONTHS_IN_YEAR" and you know WHY the variable has the value that it does. And you don't have to jump to another file you just hover over it and your IDE tells you its value, unless you're some vim/emacs/whatever retard in which case you're doing it to yourself.
Anonymous
8/7/2025, 11:05:23 PM No.106182184
>>106168465
Labelling the loops is easier to get right and keep right than counting loop levels. Let the compiler do the counting for you.
Anonymous
8/7/2025, 11:08:13 PM No.106182221
>>106167245 (OP)
goto is a primitive construct; it can be used for many things, so it is more mental effort to see how it is being used this time
use it when you have no other option that expresses your intent better

the compiler is never confused by it; if you want that, you need longjmp(), and may god have mercy on your soul
Anonymous
8/7/2025, 11:17:02 PM No.106182359
>>106173037
>local variable are allocated on the stack all at once in the function prelude
lolnope, except for no-optimization builds
when the optimizer is on, a variable may never be on the stack at all, or may be on the stack multiple times; modern compilers have many options for chewing stuff around, and you should learn about static single assignment form before commenting further
and the compiler may also just choose to adjust the size of the stack frame at any time it wants; that's not required to be constant through the life of the function call
Replies: >>106183476
Anonymous
8/7/2025, 11:27:36 PM No.106182497
Nothing that isn't opinionated. This is one practical use for it:
#include <stdlib.h>

// example size
#define SIZE_LENGTH 20

#define ERROR_UNKNOWN -1
#define ERROR_SUCCESS 0
#define ERROR_OUTOFMEMORY 1
#define ERROR_INCOMPATIBLE 2
#define ERROR_ERRORSECOND 3
// etc... Could also be enum

int example(void){
int success_code;
int* example_alloc; // Could be any type, but int* is used for example

success_code = ERROR_UNKNOWN;
example_alloc = (int*)malloc(SIZE_LENGTH);
if (!example_alloc){
success_code = ERROR_OUTOFMEMORY;
goto fin;
}

// Do operations. For instance:

if (example_alloc[14]!=88){
success_code = ERROR_INCOMPATIBLE;
goto fin;
}

success_code = ERROR_SUCCESS;
fin:
free(example_alloc);
return success_code;
}
Anonymous
8/7/2025, 11:39:38 PM No.106182664
>>106167245 (OP)
hard for juniors and ChatGPT to understand
Anonymous
8/7/2025, 11:41:18 PM No.106182685
>>106167315
uhhh maybe don't hardcode asm(LJMP xyz) into your constructors then? goto is not setjmp or ASM, the compiler doesn't disintegrate if you use a single goto.
Anonymous
8/7/2025, 11:53:17 PM No.106182832
Two facts:
If you give an idiot access to jumps any function over 10 lines becomes unreadable.
Most programmers are clinically retarded.
The damage jumps can do to a codebase is far greater than the benefit of the two times using jumps is marginally better.
Replies: >>106183358
Anonymous
8/8/2025, 12:46:19 AM No.106183358
>>106182832
>If you give an idiot access to jumps any function over 10 lines becomes unreadable.
>Most programmers are clinically retarded.
not my problem
Anonymous
8/8/2025, 12:56:25 AM No.106183476
>>106182359
I know all that, this doesn't change that generally if there aren't enough registers to store all the maximum number of variables and temporaries live at a single time, the stack space needed to store the spills will be allocated in one go in the function prelude.
>you should learn about static single assignment
already do, what about it?
Anonymous
8/8/2025, 4:07:57 AM No.106185384
Screenshot from 2025-08-07 21-00-13
Screenshot from 2025-08-07 21-00-13
md5: 2c6e683384060e86b802ec7d58d9466d๐Ÿ”
>>106169715
update: the bottom keys seen in >>106169757 previously fucked my shit up bad, resulting in ~2s, but I made a small change and now beat Swiss Table in all of my benches so far. more testing is needed.