[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: IMG_20260527_214449_637.jpg (108 KB, 1280x726)
108 KB JPG
I respect the guy, but holy crap his code is ugly sometimes and no, I'm not talking about lack of syntax highlight.
>>
Claude, make my code look pretty.
>>
why do trannies obsess, and I mean absolutely OBSESS over jblow and notch
>>
>>108920142
OP here. This is actually my first post about blow, I think. I usually am not critical about him. But yeah, I've noticed people are really obsessed with him here, wouldn't be surprised if it's exclusively trannies, because I can see how he rubs them the wrong way.
>>
>>108920115
>tower := get_state()
>satisfied = true
I might aswell rope myself now that is early.
>>
>>108920115
It's fine.
>>
>>108920115
In big codebases with several contributors, you need to trade "beauty" for clarity
>>
>>108920115
1. He's coding on-stream, so he isn't going back to refactor, which is boring.
2. He is rushing to meet an EOY goal for a game that will never make back its budget.
>>
File: 1768542739920238.jpg (111 KB, 1564x814)
111 KB JPG
looks like he tidied up since last time xD
guessing ai did the un-jeeting
>>
>>108920142
because they're both known for making a single game 20 years ago and the only way either of them can stay relevant now is ragebaiting with their "based takes"
>>
>>108920115
Really? I think your picture looks clean and clear. I prefer_this overThis. Plus all his variables give you a clear idea of what they're for.

The only thing I really don't like is the long names: delay_before_freezers_unlock_due_to_cutscene_trigger. But I understand the reasoning behind it.
>>
>>108920115
This code is also not good quality. Lots of branches that don't need to be there, and forward-branches instead of back-branches. No wonder his games always run like ass.
>>
>>108920403
This isn't the worst example, just the one I found. >>108920334 this one is pretty bad though.
>>
>>108920115
the code is fine. maybe a bit too verbose, but you get used to read this style.
>>
File: 1773430100.png (594 KB, 1068x718)
594 KB PNG
>>108920115
>code is ugly
ask claude to add emojis
>>
>>108920576
Garbage font, but that is 100x better than the example in OP. There is nothing particularly wrong or smelly about this code at all. Surprising given this guy is severely brainfucked (also dead).
>>
>>108920115
niggerlicious
>>108920576
Divine Intellect
>>
>>108920115
> if (condition) /* FUCKING COMMENT BLOCK */ {expression}
>all in one line
This shoule be punishable by death
>>
File: file.png (356 KB, 1755x885)
356 KB PNG
>>108920115
>descriptive naming
>no bloated abstractions
>just if else because that's all it needs
>very explicit
I feel like I'm taking crazy pills. How is this bad code? This is better than 99.99% of the shit out there with fucking std cancer everywhere? Pic related thanks to another thread.

Did you want a few more interfaces, lambas, and ugly std functions?
>>
>>108920695
>Pajeet, my son...
>>
HOLY SHIT, OP, I just saw it. Is that... a fucking if statement? Jesus christ what HIDEOUS unsafe boomer code!
>>
>>108920115
K&R braces strike again. You have to be mentally ill to align your code like that.
>>
i guess part of the problem is that game logic is necessarily convoluted. the more state you can access the better you can make the logic, but the more you drown in entangled spaghetti
>>
>>108920115
>uses Emacs
>uses Windows
why
>>
>>108921163
Why not?
>>
File: clinic.png (590 KB, 1288x746)
590 KB PNG
the god is a real basterd - the god is a perfectionist.

thats why he torture them
>>
>>108921216
Because you have to be an extremist and only use Emacs on GNU+Linux while limiting yourself to AI slop Notepad on Microslop Winslop because fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you fuck you
>>
>>108920695
ya I agree
it is objectively the correct way of programming for a human
sadly most people just want to write "clever" code rather than code that is readable and just works
TypeScript is also so fucking disgusting in this regard
Rust too obviously
>>
>>108921100
t. Horstmann user
>>
>>108920228
in big codebases you need to trade beauty for code that actually exists
how long has he spent on a fucking sokoban clone? i should fucking hope at this point he's just doing the trivial bullshit in the most obvious, retarded way possible to try and get out the door quicker.

niggas who have never shipped anything more complex than a web server should shut the fuck up.
>>
>>108920637
There are a lot of style inconsistencies. It's not just whitespace either, on line 16 he doesn't use a block for the if-statement because it's a single line, which is fair enough, but then for the else-clause he does use them despite also being a single line.

Other than the inconsistencies though it's perfectly fine yeah. The general conservative usage of whitespace is ugly as fuck, but also understandable given the extremely limited width he has to work with.
>>
>>108921468
> conservative usage of whitespace
4 spaces, how many more do you need for one tab?

> extremely limited width
he exceeded 80 chars per line by at least 2x
>>
>>108920115
Why the fuck would anyone willingly use snake case for a language he even designed himself? This is a sign of serial mental illness.
>>
>>108920115
My code looks like this, maybe even worse. Because when I started programming I learned cargo-cult style from japs. It's an acquired taste.
idk who this is btw
>>
>>108920115
Honestly at this point if someone writes code by hand they're owed some level of respect.
>>
>>108921373
Allman is the only way to align braces. everything else should reward you with jailtime.
>>
Has there been any newer compiler "releases" other than beta-2-009?
>>
>>108921765
Allman has no benefit, it doesn't improve legibility, it only has the small drawback of wasting an extra line. The only reason it was pushed was because they wanted to differentiate themselves from "old" C.

Basically the same way jeets want to push "modern features saar" and turn languages into >>108920695
>>
>>108921468
>retard can't read
it's 2 lines in the else, moron. The code style is fully consistent. The spaces are exactly what they should be and aren't conservative.
The thing you should have complained about is the use of several clearly not-so-temporary variables called tempXXX, yet somehow you didn't manage to pick up on this. Verdict: you are a nocoder retard which is why you have the most retarded opinions in the universe.
>>
>ew it's like icky and ugly yikes
so uhhh what's wrong with that code, you people never elaborate, is someone just supposed to know? (it was revealed to them in a dream)
I would appreciate if you provide examples of what good code looks like, I'm also open to recommendations on literature or whatever to improve my code
>t. novice programmer
>>
>>108924270
It isn't, that's how code from someone who actually knows how to program looks.

Most of this board (and a lot of the programmers that do webshit and such) are in their juvenile phase where they think making the code more "complex" makes it better. Well not really, they realize themselves it doesn't, but they want to do it and will claim it's better until the day they die because they think it makes them look like better and smarter programmers.

If you're working on a huge project like a game and most of your code is as simple as the one in OP, you're a better programmer than the absolute vast majority of people out there.
>>
>>108923654
Counted the netsed ifs and for loops in this >>108920334 code, here's your answer.
>>
>>108924857
that reply above was actually meant for >>108924270, but whatever
>>
>>108924487
>Most of this board (and a lot of the programmers that do webshit and such) are in their juvenile phase where they think making the code more "complex" makes it better.
OP's code is already too complex.
>>
>>108920115
I don't like Jai because it looks ugly as fuck. Any language that doesn't look like C looks ugly, idk why new langs keep being so degenerate. Javascript looks great because it looks like C.

But this particular piece of code doesn't look that bad. What about it is bad? I don't like entity_manager because anything_manager is what lazy or inexperienced devs name things. Manager is an illegal word.
>>
>>108920115
out of all the super shilled e celebs on 4chan, this guy might be my last favorite. john blowhard the guy that made ... an indie platformr game 25 years ago and got dunked on by soldier boy. yeah thats the guy to have as aggressive opinions as his on everything.
>>
>>108920576
all good programmer uses PascalCase for functions and camelCase for params and locals
>>
>>108920576
Is this HolyC?
>>
>>108924270
The code itself is only slightly icky out of context because it does some unecesary stanza like if(condition == true) variable = true instead of variable = condition kinda things. But the problem is that game code is extremely sensitive to conditionals, and this code heavily relies on very deeply nested forward-conditionals. The correct form for efficient game code is 1) reduce all conditionals (for example instead of if(var) x = true you will say x = var or x = (var == true)) and 2) make all mandatory conditionals backward (e.g. x = true if(var) x = false. The reason is that it is much cheaper in games to create one path and then go back and correct it if the assumption was wrong, it's related to branch predictions in modern processors).
The bigger problem is that what I'm explaining here is game programming 101 and this guy poses as a multi-decade hardcore expert on game programming specifically export on the programming aspect (as opposed to someone like notch who generally poses as an expert on 'making games' rather than 'programming games' if that makes sense).
>>
>>108923654
>tempi
i for intermediate
>tempc
c for class
>not-so-temporary variables called temp
i sure hope i don't have to explain to you that "temporary" doesn't mean "discarded in this scope", and why IR is "temporary"
clearly the code is beyond you. this surface-level niggerlicious critique just tells me how much of a black gorilla nigger you really are.
>>
>>108920334
you can't even read code
>>
>>108921262
This but unironically
>>
>>108920695
there is nothing bad about this except the author's insistence on not using
using std
, plus having to tell the compiler what it should already default to (auto), plus C++'s retarded iterators.
>>
>>108920115
The code looks fine to me but the guy is really unattractive.
>>
>>108920115
looks reasonable
if you want short identifiers, try programming in hoon, where the standard library used to prefer identifiers that were 1–4 characters long
>>
File: 1777781146143005.jpg (365 KB, 2000x2000)
365 KB JPG
>noooo you can't just use two nested if statements!!
Do you larpers really? Sure it could be refactored but who cares as long as the meaning is clear? It's obviously not some performance-critical shit. The code looks fine to me. Everything has clear names and it's clear what it's supposed to do, or at least it would be if I knew what these signs and freezes were.
>>
>>108921870
Allman is great and I like to use it whenever I can because it just makes everything much more readable vs the mushed together K&R style. The fear of using vertical space and the abuse of horizontal space is a huge problem in programming imo
>>
>>108920115
He really like the Python convention of use snake_case + make every name extremely explicit. Not the worst crime in the world. Often explicit is better. Even emacs can autocomplete variable names you've used before without LSP garbage.

For the first 2 if-else blocks it's fair to gate running a function inside the if, thus the nested if is valid. For the final else if, it's kinda pointless and retarded unless he plans on expanding it, but realistically speaking, it's not really an actual problem and logically explicitly.
>>
>>108929757
illiterate retard
>>
>>108920115
stupid soigrammers listen, code doesn't need to be fancy, the software the end users looks at is the one that needs to look and work well.
you all are so concerned about the stupid code but then your garbage barely runs and is slow as hell, fuck you all soigrammers
>>
>>108930570
Nocoder or pajeet?
>>
>>108930902
Brain status: positively absent.
Allman makes things completely unreadable as it decreases the signal to noise ratio at minimum by 30%, if not 50% in many cases. On top of that it prevents fitting more things on screen which means it's not possible to fit the whole logic at once in even small code segments.
The only people who like that shit are clinically retarded: they can't operate at a normal reading and thinking speed so the forced slow down from the unreadable garbage that is allman appeals to them.
>>
>>108931366
But the complaints in this thread were literally that the code is likely to be buggy and that it is definitely slow as hell. Self-pwn.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.