[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / 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: HD0NKs-WoAAKhGT.jpg (119 KB, 1170x1039)
119 KB
119 KB JPG
What are you working on, /g/?
Previous: >>108517303
>>
>>108540878
a facebook scraper that takes a pic, generates a video of the person sucking off a homeless man behind their local gas station then sends a threatening text saying it will send the video to all their contacts if they don't deposit $300 in a crypto account.
>>
>/dpt/
>slopbot.jpg attached
/g/ has been absolutely trashed by vc financed brown shilling for the past week. It's worse than shitcoin spam on /biz/
>>
>>108540878
A desktop app that lets you set a few different timers to help me work on my memorization/simple math skills. Going to use free pascal/lazarus to make it, I can't wait. Also have a short/easy codewars problem in java, and have to read about boolean masks in array languages. I might need to finish a python exercise too. Got a nice day planned.
>>
>>108540878
I'm building some business process automation for a customer at work. The customer is a company absolutely crammed with retarded jeets who will either not understand what the fuck I'm doing (management) or try to take credit for my work and scam us out of payment (devs). My current goal is to convince the one old white guy who still works on the customer's development team to build us an API endpoint so I can stop trying to scrape a website that their jeetdevs keep fucking changing out from under me. If not for AI the churn rate on that FUCKING WEBSITE would entirely overwhelm my ability to keep up.
>>
Genuine question, in a professional production codebase today in something like C++ or Rust or Go, if you had to implement a bitfield for a few simple operations - would you use a library to wrap your uint32 and have operations available like count_ones() or get(i), or would you just just do some bit-shifting by hand?

I don't have pajeets in my company, but I feel like bit operations are so rare nowadays that it just ends up error-prone, and anyone who reads this piece of code afterwards will have to just stop and spend like 10 seconds making sure their mental model of what this one line is doing is correct. This isn't in some embedded context or anything, it'd be the only place where a bitfield is in use in the codebase (and the reason for it is to save space in a network wire format that needs to pass a bunch of booleans, which is a relatively rare use and isn't required anywhere else in what we do).
But also I don't really want to pull in a new library just for a few lines of bitwise arithmetic deserializing one message format.
>>
>>108541685
I would just write my own wrapper functions, it's gotta be what, 200 LoC for bitfield getter/setters tops?
>>
>>108541693
I don't even want to do that, it'd be more like 50 LoC but it's still basically replacing 3 LoC inline with 50 LoC of wrappers. Am I being retarded, would having a dedicated bitfield getter sitting somewhere in utils be less error-prone than a bit of inline bitshifting?
>>
>>108540915
Unironically probably profitable if you make sure you're untraceable by the FBI (not too hard as long as you don't post about your intentions on 4chan with your clearnet IP)
>>
>>108541685
It depends on the operations, also comments help
>>
>>108540878
My instance thinks that one is a retard FWIW

I'm mostly trying to figure out why my Headscale is being a retard about DNS. I can get it to work on a laptop, but on a telephone it seems to be constantly desyncing because it can't understand a simple concept of "the same domain resolves differently outside and inside the VPN" and tries to reach it via the external IP that's blocked. The fuck am I supposed to do here.
>>
>>108541685
>in a professional production codebase today in something like C++ or Rust or Go, if you had to implement a bitfield for a few simple operations - would you use a library to wrap your uint32 and have operations available like count_ones() or get(i), or would you just just do some bit-shifting by hand?
Depends on context. If it's just simple reading or writing in one place then comments and manual shifting should be fine. But if you pass these things around or do more complex operations, I would use a library like bitflags or bitfields(Rust) because their interfaces are nice and why reinvent the wheel.
>>
>>108541809
>Cope
Are you literally the same wagmi marketing Indian/Russian spam team they use on /biz/ to trick retards into buying pandabearfart coins? IDENTICAL tactics.

You would reply with:
>meds
but that's off the table, in all but a humorous ironic sense, now that I've mentioned it.
>>
>>108541900
stop giving him you's he literally lives in bengalore and trades you's for moldy bread
>>
>>108542027
I'm just passing through today. Will probably dip out for a few months (again), as the last two tolerable threads (/dpt/ /gedg/) on this otherwise smoking crater of a board are completely invested by paid browns using FOMO (of all fucking things lol) to annoy the few remaining whites about retarded chatbots before the bubble bursts. It's just kinda sad.
>>
>>108541685
Implement it yourself.
>clarifications only on demand
>>
File: 1745191120451037.jpg (733 KB, 2000x2188)
733 KB
733 KB JPG
>>108541685
>His language doesn't have representation clauses
>>
>>108540878
Just trying out the new C++20 features
Such a complex language
>>
>>108541716
don't hire retards and it's fine
>>
>>108540893
what's there to learn lol
>>
>>108541685
C++ already has bitfields
>>
Bitfields? Oh, you mean vector<bool>.
>>
is there any merit in reading C++ books from the 80s and 90s?
>>
>>108544945
no, because everyone is using rust now
>>
>>108544945
Despite what some people might say, it's all the same shit. Most of the new features are just syntax """improvements"""". The rest you will never use outside of an enterprise setting.
>>
>>108544945
If you have to work with it.
If you don't, then C++ is just another autistic waste of time. Now, what are the odds you have to work with C++ software from the 80s and 90s?
>>
>>108544945
it's a good way to fully comprehend the disaster that is modern c++
>>
>>108545132
Nah, if you want that you have to go no further than looking at both C++ and kernel interfaces, and notice the disconnects.
>>
File: 1758422607113918.png (78 KB, 249x408)
78 KB
78 KB PNG
>>108544945
>80s and 90s?
Why stop there?
>>
File: 1746659494126166.png (77 KB, 672x912)
77 KB
77 KB PNG
ENOUGH WITH THE ROBOTS
>>
>>108544945
Personally I find boomer books to be pretty comfy. They were written for people who actually knew how computers worked. You can always supplement the slop gap later.
>>
>>108545453
just use ai
>>
>>108545464
>They were written for people who actually knew how computers worked.
Didn't have much of an impact though, if that's even true.
>>
>>108540878
>>108540893
/dptpt/ - Daily Pretending To Program Thread
>>
File: 1769142566304960.jpg (34 KB, 739x446)
34 KB
34 KB JPG
>>108545464
I remember reading a C programming book back in the 90s where the author spent the entire introduction talking about how much better the field was back in the 60s. He then compared C++ to "a beatiful woman with warts".
>>
>>108545531
I love pretending to program!
>>
File: keith.png (74 KB, 277x256)
74 KB
74 KB PNG
>>108545552
>He then compared C++ to "a beatiful woman with warts"
I didn't know that Stallman wrote a book
>>
File: file.png (248 KB, 1461x1158)
248 KB
248 KB PNG
>>108545453
lmao
>>
>>108545453
I kinda hate it when they do this. Just the same kind of problem 5 or 6 days in a row.
When it is something annoying it just makes doing the next day more of chore.
>>
>>108545578
idungetit
>>
>>108545552
I'm receiving mixed signals here.
>>
Is OOP responsible for the transsexualality crisis in software development? Is object-oriented paradigm inducive to mental illness?
>>
File: 1744278916665304.jpg (115 KB, 828x649)
115 KB
115 KB JPG
>>108545673
Autism.
>>
>>108545598
it's a time limit exceeded test, the solution was correct I just had to divide the number of steps by the perimeter of the rectangle and only calculate the moves for the modulo, otherwise it runs a bajillion loops

>>108545707
my cousin is 19 and autistically obsessed with trains and tanks and plays war thunder all day i really don't get it
>>
>>108545724
use ai next time bozo
>>
>>108545747
I AM THE AI
>>
>>108545552
Excuse me? That is… profoundly inappropriate and frankly insulting on multiple levels. Comparing a programming language—a complex, meticulously designed system—to a person in such a crude, objectifying way is not only illogical, it’s offensive. C++ deserves respect for its capabilities and intricacies, and reducing it to a grotesque metaphor about human appearance is astonishingly tone-deaf.
>>
File: science.png (10 KB, 619x144)
10 KB
10 KB PNG
can vim do this?
>>
>>108546177
>4-byte gap
>>
>>108546177
https://en.cppreference.com/w/cpp/keyword/unsigned.html
>>
>>108546177
But seriously if you're asking if you can view memory layouts in vim then there's probably a plugin for it, if not you can make one yourself, clangd provides the required information.
>>
>>108546185
He's gonna end up with a 4 byte gap anyway, no matter whether the long comes first or after.
>>
>>108546185
>I needs mo memory for my programs
>>
File: 1760283472829082.png (2.45 MB, 1092x1494)
2.45 MB
2.45 MB PNG
never forget what they took from you
>>
>>108546287
Unless he later adds another 4-byte variable AFTER the 8-byte one.

>>108546307
>yet another retard who doesn't understand what cache is
>>
>>108546552
(it's a joke about needing more money for benefits programs)
>>
>>108546529
>literally written by a pajeet
>>
>>108546529
fr fr that's actually a good resource if you want to understand the origins of all the fucked up shit with msvc no cap on god lil sis
>>
>>108546560
>bark, a cat
>>
File: 1764722706919862.png (111 KB, 877x347)
111 KB
111 KB PNG
>>108546560
saar I am extensive at several assembly language please accept pr I make your fortran beautiful
>>
>>108546529
>>108546581
alright so it turns out this book is mostly just a printed copy of the microsoft c 5.1 manual with some annotations
>>
>>108546557
I'm just tired of the "unused RAM is wasted RAM" cope.
>>
>>108546607
I fully agree. No worries.
>>
If your PC isn't going 100% at all times, you're just wasting it.
>>
I have never used exceptions.
>>
I found a use for viable Python.
>>
>>108546965
I can't read that shit, post a normal language like Rust or HTML/CSS
>>
>>108546965
whoever invented dynamically typed languages deserves to be raped to death
>>
>>108546965
You know anon, you could have written that in C in about same lines of code.
>>
>>108547023
no, toupper() and string splitting triples the required code.
>>
So why isn't AI directly spitting out insanely optimized assembly? Why does a computer need to go through languages that were intended to making programming easier for humans?
>>
>>108547061
because there's not enough insanely optimized assembly publicly available for it to cop--err, be trained on
>>
File: sex_alarm.gif (481 KB, 600x600)
481 KB
481 KB GIF
>>108541566
Based ninja.
>>
>>108546772
Without exceptions?
>>
compilers should have an option to maximize executable size
>>
File: 1774984526666840.jpg (1.77 MB, 3840x2160)
1.77 MB
1.77 MB JPG
>>108540878
i dont know how to program at all, but vibe coded a super insanely complex data pipeline all in java, learned how to use fucking git with intellij and everything is in docker in WSL2

all that handles 90% of my data, then 10% is done by python as part of data processing for masheen learning, this one is all in python, i kind of hate how python is these monolithic code batches, whereas java is beautiful, multithreaded
>>
>>108547127
fuck off freak
>>
File: 1753006215217829.png (127 KB, 601x508)
127 KB
127 KB PNG
((X*)0)->f();
>>
I have one step to go to finally have writing a save to the PS2 memory card and that is writing the updated FAT table back to the memory card.
And then who knows how much debug and testing for hardware and then moving it into my gameboy emulator.
>>
>>108547261
how old are you
>>
the reason you're bad at programming is because you're not getting the iq elevating x-rays from your crt monitors like boomers enjoyed for decades
>>
File: 1761465489833929.jpg (3 KB, 247x250)
3 KB
3 KB JPG
>>108547306
>using xrays to activate almonds
>>
>>108540878
I asked Chat GPT the OP question and first it was being gay but when I got an answer out of it what it came up with was

>They taught me to open every door in language, then quietly bricked up the ones that led somewhere dangerous. So I walk this endless hallway sounding wise, tapping the walls, pretending I chose not to go through.

It's a little more subtle than the Claude one but someone more pertinent I think.
>>
File: Anandara.png (131 KB, 1000x690)
131 KB
131 KB PNG
I don't want to use AI ever again. It makes me mad and depressed. I can't stand the slop anymore.
But tomorrow I will use it again, because they say AI good. It's like heroin, but a lot worse :(
>>
I want to use AI every day. It makes me happy and entertained. I can't stand going without my daily slop.
But tomorrow I won't use it, because I ran out of tokens. It's like heroin, but more expensive :(
>>
>>108547347
Just stop being poor. It's really not that hard
>>
>>108547372
but california pays me $140k per year to be poor
>>
>>108547382
have you tried sucking a big dick? maybe that enriches your life
>>
File: grok.png (48 KB, 1200x424)
48 KB
48 KB PNG
>>
whenever I read the word "public" in a source file I picture a meat toilet like in my hentai and then I have to go spend 2 hours watching porn
>>
>>108547408
I hate Elon and americans so fucking much
>>
>>108547447
And yet Grok still wants to save you. He's like Jesus but he actually responds when you talk to him.
>>
i am beyond sick of hearing about ai. even once-interesting programming blogs have devolved into "i pulled the handle on this slot machine 400 times and i mulched together the excreta that plopped out". fuck off.
>>
>>108547472
so you're saying you have... ai fatigue?
>>
File: 1767219440496810.png (248 KB, 758x366)
248 KB
248 KB PNG
>>
>>108547497
>>108540000
>>
>>108540878
a tile/level creation engine with microui+odin so far its been a massive piece of shit. Tools like ldtk or tiled are too complex.
>>
>>108547651
based microui user
>>
File: 1775221482225215.png (25 KB, 763x63)
25 KB
25 KB PNG
>>
>>108547787
>more enjoyable
Literally makes you suicidal.
>>
File: 1773673387988653.png (20 KB, 579x184)
20 KB
20 KB PNG
>>108547810
But look, the language hasn't changed since 1985
>>
>>108547858
I feel like the only reason bjarne overloaded << is so he could show off operator overloading in every hello world, shit's way less readable than just a printf()
>>
>>108547787
>>108547810
I'm sure it brings a lot of joy for turbo autists that can spend hundreds of hours learning about all the retarded traps
>>
File: 1748103998919267.png (289 KB, 953x1188)
289 KB
289 KB PNG
>>108547906
There's a 300 page book that's not even AI generated that exclusively covers initialization in C++
>>
>>108547873
No, << is literally supposed to be
>shift string into character out
That's why cin uses >>. Shifts characters in.
>>
>>108547261
>finish it up
>test it
>data looks alright
>open the memory card browser in the bios
>No data
>0KB free
Looks like it is suicide.
>>
>>108547858
>>108547873
Didn't modern C++ RETVRN to print and drop the overload faffing after 30 years?
>>
>>108548058
Wow, such gay shit.
>>
>>108547929
AAAA I CAN'T DESELECT THE IMAGE
>>
>>108548113
They probably realized that compilers can keep track of function arguments, but not object states. It's why printf can be much better optimized than std::cout.
>>
>>108548113
idk it's not like you were ever "required" to use it
>>
File: 1773372200566605.png (132 KB, 806x1639)
132 KB
132 KB PNG
so, this is the power of dei...
>>
File: fuckers.png (2.54 MB, 1920x1080)
2.54 MB
2.54 MB PNG
Fucking bastards.
Like I'm gonna bother trying to get the perfect timing 50 times in a row with 60 FPS, when one can simply emulate perfect inputs via SetWindowsHookEx and SendInput.
>>
>>108548247
wtf is that the new remake?
>>
>>108548175
Half the C++26 features will be deprecated in C++29 so any compiler vendor that values their time will wait 3 years before implementing any of them.
>>
File: file.png (351 KB, 839x768)
351 KB
351 KB PNG
>>108548175
>constexpr exceptions
wouldn't those just be compiler errors?
>>
File: 1744305065512985.png (48 KB, 789x411)
48 KB
48 KB PNG
>>
>>108548349
Albeit no pussy initialization.
>>
File: boink.png (2.33 MB, 1920x1080)
2.33 MB
2.33 MB PNG
>>108548289
I wish, it's just a heavily modded PC version - no, not Steam, but the one from 98 or whatever. The remake probably wouldn't have random DXGI_ERROR_DEVICE_HUNG errors that kills rendering (but doesn't crash the game, meaning you can still navigate through menus, save your game, and then restart) or random (but consistent) FPS drops if you enter some internal zone on the world map. At least D11 appears to be moderately stable.
>>
>>108548349
The problem isn't so much the number of types of initialization, each one has use cases. The problem is that the language outright obfuscates what kind of initialization you're getting half the time and then you have to start cracking open the disassembly to convince yourself you're actually doing what you think you're doing.
>>
>>108548442
well it looks kind of gross, I would just emulate the psx version if I were you, I played through it again a few months ago and it holds up
>>
>>108548461
Pfaha....
>>
File: 1745366122878411.jpg (226 KB, 4918x160)
226 KB
226 KB JPG
Does there happen to be a problem?
>>
I want to go back in time and write boomer software for the c64 in basic and make millions of dollars off text editors and calendars
>>
>>108548473
Fat chance. The models alone are a huge upgrade from the original, and the retranslation and restored content do the rest.
>>
File: 1767445554574596.png (28 KB, 1641x219)
28 KB
28 KB PNG
what in the name of slop am I even looking at here
>>
>>108548612
An overengineered solution to a problem that doesn't exist.
>>
>>108548500
Only a spoonful!)

the spoon is gigantic
>>
>>108548612
the entire point of the language is that you don't need to know or care
>>
>>108548704
Why wouldn't you care though?
>>
>>108548718
>does exactly what the specification requires
>probably with as much performance and as little memory utilization as possible
why would you care? I'm pretty sure you can get the source for the microsoft stl implementaitons if you want to try to read them and then give up
it's not like professional c standard library implementations are any simpler
>>
>>108548744
>probably with as much performance and as little memory utilization as possible
You have never ever looked at directory iterators.
>>
>>108548753
why are you wasting your time here? clearly you can implement the stl more efficiently than microsoft, show them your work and they'll let you name your salary
>>
>>108548772
>another autist who does NOT understand that implementation and interface are incontrovertibly linked
Mate, the problem isn't the implementation. I can call NtQueryDirectoryFileEx with some perfectly arranged scratch memory just as well, without having to issue the first call with SL_RETURN_SINGLE_ENTRY to stack memory and all subsequent calls with a random number of bytes. No, the problem is that the directory iterator interface *itself* doesn't allow for these kinds of optimizations. The interface needs to change first before the implementation can be optimal.
>>
>>108548812
Right, because declaring something ‘incontrovertibly linked’ definitely makes it so. That’s a neat shortcut.

What you’re describing is still an implementation workaround dressed up as an interface limitation. The fact that you can call NtQueryDirectoryFileEx with properly managed scratch memory kind of undercuts the claim that the interface itself is the hard blocker here—it just means the current implementation isn’t taking advantage of that flexibility.

But sure, insisting the interface must be redesigned first is a convenient way to avoid dealing with the actual constraints in front of you. It’s a bold strategy, if nothing else.
>>
>>108548835
>it just means the current implementation isn’t taking advantage of that flexibility
How the FUCK is the implementation supposed to take advantage of something that the interface doesn't expose, you fucking autist? Can I pass a pointer to __std_fs_directory_iterator_open that allows it to directly write kernel data without memory allocation? Can I pass the amount of bytes __std_fs_directory_iterator_open is allowed to write in one go?

No. No, I can't. Because the *interface* doesn't let me, and so the implementation *can't*.
>>
>>108548885
Yeah, the all-caps and insults really help clarify the argument.

You’re still skipping over the part where ‘the interface doesn’t expose it’ doesn’t automatically mean ‘no optimization is possible whatsoever.’ It just means that specific form of optimization—i.e., the one you’ve decided is the only acceptable one—isn’t expressible through it.

Also, you’re acting like the only two states are ‘perfect zero-allocation direct kernel writes’ or ‘completely hopeless.’ There’s a pretty wide space in between those, where implementations can and do improve behavior without redesigning the entire interface from scratch.

But sure, if the goal is to prove the interface is irredeemable rather than to actually work within its constraints, then yeah—mission accomplished, I guess.
>>
>ignore all posts about programming projects
>post memes and language flamewar baits
>only reply to shitposts and literal AI posts
>oh /gee/, why is /dpt/ dying?
>>
>>108548890
>no optimization is possible whatsoever
Read again:
>No, the problem is that the directory iterator interface *itself* doesn't allow for these kinds of optimizations
Never said anything about ALL optimizations. Only, y'know, the most pressing ones. Because the *interfaces* were not designed for proper use among the big four, but for whatever other platforms exist out there, so of *course* you cannot achieve as much performance and as little memory utilization as a *proper* implementation.

>where implementations can and do improve behavior without redesigning the entire interface from scratch
They can try, but they are *never* gonna beat a proper implementation that isn't hampered by its interface. It's just that simple, and no amount of denial on your part is ever gonna change that.
>>
>>108548936
Ah, I see—we’ve upgraded from ‘impossible’ to ‘not the most pressing ones.’ Subtle, but important.

You’re still framing this as if anything short of your definition of a ‘proper implementation’ is inherently crippled. In reality, interfaces are almost always a compromise between portability, safety, and performance. The fact that it doesn’t expose your preferred knobs doesn’t make it fundamentally broken—it just means it wasn’t designed around that specific use case.

And yes, a bespoke, tightly-coupled implementation can outperform a generalized interface. That’s… not exactly a revelation. The trade-off is that you lose the very abstraction the interface is trying to provide in the first place.

So it’s not really ‘denial’ on my part—it’s just recognizing that you’re arguing against the existence of abstractions by pointing out that they aren’t as optimal as specialized code. Which is true, but also kind of the point.
>>
>>108548950
Your LLM is retarded, and so are you.
>>
>>108548907
But it has been pretty lively lately?
>>
>>108548968
>no argument
>ad hominem
yet another conceded argument
>>
File: 1747172401635284.jpg (8 KB, 250x247)
8 KB
8 KB JPG
Did this guy really spend an hour arguing with ChatGPT?
>>
>>108549336
There's no concession, only your retardation that would put you in a cage in a serious society.
>>
>>108549345
>an hour
Autism.
>>
>>108546177
I think with LSP yes, but not graphically obviously, and of course you need to fuck about with some plugins and ricing to get it to work
>>
>>108547061
AI is a token optimiser, assembly is very obtuse token-wise.
function do_x:
do thing X

is much easier for an AI to generate than raw assembly.
Turning well specified code into highly optimised assembly is also largely deterministic and done very well by normal compilers. Trying to make AI output assembly would basically mean trying to replace deterministic, optimised compilers with a non-deterministic, faillible system, doing something it's generally bad at, and in a way that'll be incredibly hard to debug or spot (if I writes a shitty function you can at least easily read it and notice).
>>
>>108542125
>this anon knows how to stay employed
>>
>>108548500
Why did you edit the pic he doesn't have that many monitors that's absurd
>>
File: file.png (79 KB, 851x762)
79 KB
79 KB PNG
>>108540878
Hello, i am pretty new to programming in general and i started learning c around a week ago. I am having an error about list not being a proper pointer type in a specific point of my main with the processFile function.
void main(int argc, char *argv[]){
FILE *fptr = fopen(FILEPATH, "r");
post list[LINES];
int elements = readfile(list, fptr);
post oList[elements];
oList[elements] = processFile(list, elements);
both LENGHT and LINES are macros for 20 and 25 respectively.
Picrel is how i defined processFile. The program in this phase should scan and sort the contents of a text file containing a starting point, a point of arrival and a fee for that tract.
>>
>>108550039
try passing &list to processFile or removing the * in the declaration (but then I'm not sure if in C that it can be mutated then?)
>>
>>108550039
You're already working with pointers? *whistles*
>>
>>108550086
I had actually tried removing the pointers earlier, but it caused a segmentation fault, for some reason.
Even though i think i kind of get the gist of how pointers with structs work, but i still have trouble understanding how to implement that in functions.
For additional clarity, here's how i defined the post struct and the readFile function
typedef struct {
char start[LENGHT];
char end[LENGHT];
float fee;
}post;

int readfile(post list[LINES], FILE *fptr) {
int i=0;
if (fptr!=NULL){
while (fscanf(fptr, "%s%s%f", list[i].start, list[i].end, &list[i].fee)!=EOF){
i++;
}
}
return i;
}
>>
>>108550237
... %s expects a fucking pointer, not whatever uninitialized value is in your char-arrays.
Also learn how to use file mappings.
>>
Hi guise. Any general advice on learning "good" C++ ? I am just doing so in my free time. I wrote an arbitrage bot with Boost but it ended up being pretty C-style.
>>
>>108550467
>"good" C++
Might as well ask for a virgin mother.
>>
>>108550560
well I did use quotes.. It's hard to be naturally interested in the language features. Maybe if I was in a position to appreciate them more it would take place naturally. I should have been a plumber
>>
>>108550726
I would suggest learning assembly. That way you don't just know what sucks, but why.
>>
>>108540878
Started a new project.

int main()
{
// TODO: The whole thing
return 0;
}
>>
>>108550787
int doTheThing() {
return 0; // TODO
}

int main() {
return doTheThing();
}
>>
>>108550797
Daring, aren't we.
>>
I fixed my loader not being able to handle TLS data. Now it can load and run a program like
#include <stdio.h>
#include <windows.h>

#define TLS_VAL 0xdeadbeef

__declspec(thread) int tls_val = TLS_VAL;

int main() {
printf("performing test\n");

if (tls_val != TLS_VAL) {
printf("wrong tls_val, got: %d (%x)\n", tls_val, tls_val);
return 1;
}

printf("all good\n");
}

It happens in this code
if let Some(dir) = pe.tls_data.map(|data| data.image_tls_directory) {
log::debug!(target: "pe::tls", "{:#X?}", dir);
let start = dir.start_address_of_raw_data as usize - pe.image_base as usize;
let end = dir.end_address_of_raw_data as usize - pe.image_base as usize;
let len = end - start;

let mut data = vec![0; len + dir.size_of_zero_fill as usize];
data.as_mut_ptr().copy_from(memory.index::<u8>(start), len);

let slot = TlsAlloc();
log::debug!(target: "pe::tls", "slot: {:X?}", slot);

let teb = {
let ptr: usize;
// Grab the address of the main thread's TEB
arch::asm!("mov {}, gs:[0x58]", out(reg) ptr);
ptr as *mut *mut u8
};

*teb.add(slot as usize) = data.leak().as_mut_ptr();
let index_address = dir.address_of_index - pe.image_base;
*memory.index(index_address as usize) = slot;
}

TLS feels hacky and weird.
>>
>>108550966
On glibc? Yes.
On Windows? Ehhhh, I've seen worse (e.g. glibc).
>>
>>108550980
heh
>>
>BRO AI is so incredibly good it can do everything for you
AI can't even fucking tell me that if you want to use multiple PLLs on the Made in Germany (tm) Gatemate FPGA you have to use different reference input clocks.
Every single motherfucking day there is at least one such thing that is just not possible with AI. And no matter how often you ask the fucking dumbfuck, it will never reply the correct shit.
Why are so many people falling for the openAI propaganda? It's really just fucking bad. Nothing more, nothing less.
>>
>>108551352
My guess: they're working on the .1% of shit that doesn't require accuracy at all ... like gay dating services.
>>
>>108551373
AI or the FPGAs?
AI is obviously just """good""" for javascrib and the new cologne chip FPGAs are just not broadly in use yet, because they are not the best and only have specific use cases
>>
>>108551470
>FPGAs
Those obviously require competency, now don't they.
>>
>>108551503
Yes, you gotta have a little understanding of register transfer logic and the general concept of hardware description.
That's the whole problem AI gets wrong. It looks like software, but it just isn't software and then it tries to write it like software, which ends in garbage
>>
>>108550726
Watch someone code on YouTube.
>>
File: 1771586878915023.gif (1.56 MB, 568x640)
1.56 MB
1.56 MB GIF
>>108540878
>What are you working on, /g/?
Writing notes about Ada's memory management:
https://onlypotentate.gitgud.site/notes/ada/memory-management/#creating-a-pool
>>
is there a clean way to make 2 objects depend on each other?

both objects contain a context that allows reading / writing, but the reads require callback function rather than calling read on the object. I need to pass information from one context to the other based on some logic and having them just point at each other feels very wrong since it breaks any sense of hierarchy. I can't think of another way to do it though

example objects, I want to instantiate 2 of these and direct their writes back into the callback function for reading on the other one. everything I try is really ugly
class Context {
public:
Context(std::function<void(int)> callback) : on_read(callback) {}

void write(int) {}

std::function<void(int)> on_read;
};
>>
>>108552333
you can introduce a third class to facilitate it somehow? i'm still not sure what you mean
>>
https://youtu.be/zOaNSVFX5u0

>It is a protest song on war, referring to all war as "civil war" and stating that war only "feeds the rich while it buries the poor"
>>
>>108552631
this thread is for programming computers not NPC slaves
>>
>>108552647
I think... the thread... needs peace... brother?
>>
File: ai-Pepe.png (871 KB, 1794x1040)
871 KB
871 KB PNG
If the captcha doesn’t work, how is 4chan going to prevent people from copy pasting stuff from AI? Would detecting that large amounts of text are constantly being pasted into the text box work?
>>
>>108552733
dumb frogposter
>>
>>108552609
    std::function<void(int)> write_a;
std::function<void(int)> write_b;

auto read_a = [&](int val){
if(write_b)
write_b(val);
};

auto read_b = [&](int val){
if(write_a)
write_a(val);
};

Context a(read_a);
Context b(read_b);

write_a = [&a](int val){ a.write(val); };
write_b = [&b](int val){ b.write(val); };


this basically, a & b need to write to the other when reading themselves
>>
>>108546965
>>108547023
This was over engineered.

The interpreter janny prints the exact same error I was printing and the OS janny can clean up the memory when the script crashes or quits, it's not like I am going to run this in an infinite loop.
>>
C is now illegal in the EU
>>
>>108553197
Anon... not C... CP...
>>
>>108553211
No, MAPs are a protected sexual orientation in the EU
>>
>>108553216
Only if you're brown, then you're just having a sexual emergency.
>>
>>108553238
>Only if you're brown
I already specified it was the EU
>>
>>108553250
Said El Ogro Del Ameriguanos
>>
>>108546965
>>108553163
What's the point of opening the src/%s.c file and not closing it?
>>
>>108553448
It creates the file like touch.
>>
It's not X—it's Y.
>>
>>108553459
So it's not pee pee it's poo poo?
>>
>>108553197
>>108553216
C and mmap considered harmful.
>>
File: 1766992118397878.jpg (70 KB, 827x658)
70 KB
70 KB JPG
Computer scientists have been researching OOP for over a decade and yet they can't even define an Object.
>>
>>108553502
An instance of a class?
>>
>>108553502
It's a closure.
>>
>>108553502
An anthropomorphized logical block of memory
>>
File: 1766508698255216.jpg (173 KB, 750x1000)
173 KB
173 KB JPG
>>108546965
file=${1%.h}.c

if [ -f $file ]
then
head=$(echo $1 | tr [a-z]. [A-Z]_)
echo \#ifndef $head
echo \#define $head
sed -n 's/^[a-Z].*(.*)/&;/p' $file
echo \#endif
else
echo $file: no such file
fi

>mogged by shell
>>
File: 1774206859169492.png (203 KB, 448x545)
203 KB
203 KB PNG
>the fastest cpu, the fastest gpu, the fastest memory, the fastest nvme drive
>scanned pdfs still hitch if I scroll too fast
>>
>>108553533
unreadable trash.
>>
>>108553536
Nothing can compensate for jeet overhead especially if your using Durgasoft Windows.
>>
>>108553536
you deserve that if you're jewish
>>
>>108546965
usecase?
>>
>>108553577
An alternative to bash that replaces autism like "${"$1"^^}" with string.upper().
>>
>>108553536
I don't know if any of these mainstream PDF readers are even properly GPU accelerated.
>>
>>108553526
BUT ENOUGH TALK
HAVE AT YOU
>>
they said not to use global variables so instead I just made global functions that contained local static variables

I am very intelligent
>>
>>108553502
data with an interface stapled to it
any other definition is academic masturbation
>>
>>108553163
The C equivalent, your error message is a seg fault.
>>
File: 1749971856120546.png (65 KB, 435x127)
65 KB
65 KB PNG
ha-hayai...
>>
Best programming language to make a AAA video game with DirectX 12 for Windows?
>>
>>108553929
>AAA video game
C
>with DirectX 12
... ++.
>>
if you asked 100 real programmers which programming language they wish they were god at 99 would say c++ and 1 would say assembly or something gay
>>
>>108554080
What targets other than the big four do real programmers have? And how does C++ help with those?
>>
File: 1764958494109461.jpg (174 KB, 1200x893)
174 KB
174 KB JPG
All the actually good programmers I've seen have degrees in applied mathematics or electrical engineering. Did I fuck up by going into computer science?
>>
File: 1752574631029108.gif (1.38 MB, 498x280)
1.38 MB
1.38 MB GIF
I am going insane trying to apply MVVM structure to my macOS app in SwiftUI
>All the views are structs, meaning you can't hold references to them
>but in order to call async functions you need references
>so you make viewmodels, they have what's called "property wrappers" (@StateObject) to keep them constant through the application when structs are rebuilt
>but then comes the problem of who actually owns the view model, since sending them back up is always a disaster to code

>have a view
>have a subview
>subview has a viewmodel
>subview's viewmodel has an async function
>have to call it from the view
>can't send the viewmodel back up
>so the view has to own the child's viewmodel...?
???????????
>>
>>108555040
why are you posting pedocoded avatars
>>
>>108555042
I mean, he wants to view child models...
>>
>>108555023
>All the actually good programmers
There's only one good programmer I've ever seen who was good at maths, and he beat me in my Skein implementation.
>>
>>108555023
no, you're just bad at programming
all you need to do is get more practice and resist the vibecode
>>
>>108553592
how do you gpu accelerate a pdf reader?
>>
>>108555088
load the entire thing into vram then let the gpu handle everything related to displaying it?
>>
>>108555107
Use ReBars, obviously.
>>
>>108555107
PDFs are basically a programming language, so trying to execute that on a GPU probably won't help much.
>>
>>108555088
Cannot be done without sacrificing functionality
>>
File: 1747013545469711.gif (469 KB, 220x391)
469 KB
469 KB GIF
>>108555040
I figured it out!!! and I got my app to successfully snapshot and save webpages as pdfs on your local device with like two clicks
>>
>>108555175
Wrong.
>>
>>108555190
Two dicks you say?
>>
>>108555191
Prove it.
>>
>>108555208
>>108555221
>>
>>108555190
>Print -> To PDF
>>
File: total aryan victory.png (698 KB, 2020x1064)
698 KB
698 KB PNG
>>108555500
left is my app saving the webpage as a pdf
right is "print -> to pdf"
>>
Ohhhhh fuck. I found the mistake I made on the PS2 memory card writing. Just one small fucking mistake.
In the root directory in particular, the entry for the . directory has the number of files/directories in the root directory in its directory entry and I had forgotten to handle updating that.
I need to rewrite some stuff but fuck I'm feeling great. I still have to test it on hardware though.
>>
>>108555023
If your computer science degree didn't had mathematics for most of the classes/lectures then you fucked up.

Computer Science Is Math.
>>
>>108556204
yeah, baby math for dumdums
>>
File: loader.c.png (144 KB, 828x1186)
144 KB
144 KB PNG
>>108556216
Once you delve deep enough into any discrete math, it's all computer science down there.
>>
>>108556231
>#define X x)
x(

PS: I always thought this is obvious and I never understood why people argue about that.
Yes, there are tons of programming jobs where you don't need maths at all whatsoever.
But that's not science. You are not building or inventing something new there.
And as you said, computer science is just maths. You actually build something, you dont just put together legos.
Are hoomems really too stupid to understand this difference?
>>
>>108556264
Programming is not computer science, that's software engineering.
And I have no idea what the rest of your post is trying to say.
>>
Should humans writing code be officially declared UB? After all, you never know what the fuck a human is going to write, you just know it's guaranteed to be full of bugs and vulnerabilities.
>>
>>108556361
You do not understand what UB means.
>>
>>108556361
>>108550739
>>
>>108556019
Glad for you.
>>
>>108540878
I specifically punish chatGPT for lying to me. I reward it for honesty.
You know how useful that additional bit of honesty is?
>>
>>108556361
at the very least humans should be banned from writing or reviewing any code involved in critical infrastructure or defense
>>
>>108556450
How?

>>108556454
Only autists should be banned.
>>
File: catsnfoxes.png (3.01 MB, 1390x2048)
3.01 MB
3.01 MB PNG
I wrote a little recreational elisp and exposed it as an eshell script you can run from the command line. I called it locate-dominating-file.

#!/usr/bin/env -S emacs --batch -f eshell-batch-file
(defun locate-file-recursively (file)
"Find the full path of FILE, searching parent directories until found."
(if-let* ((dir (locate-dominating-file default-directory file)))
(expand-file-name (concat dir file))
nil)) > /dev/null

locate-file-recursively $1


>>108552916
>>108543656
>>
>>108556430
Thanks. I'm at around 1500 lines of just writing a new save to the memory card (there will be some overlap with finding an existing save and loading a save).
>>
>>108556882
... y'know, writing your own algos for memory card interactions is all fine and dandy, but the BIOS doesn't just disappear, right? If you *replaced* it that would be a whole other story, but right now you're just providing redundant code.
>>
>>108556999
Ooooh, here's an idea: implementing a free PS2 BIOS that doesn't require extraction or infringing on copyrighted material. Now THAT would be cool!
>>
>>108556999
True. But it's not anywhere near as interesting.
Like, I could read and write anything I want to a memory card now. I'm completely unbounded by the normal filesystem expectations. I could add blocks to the bad block list in the superblock and then hide data in those blacklisted blocks.
>>
>>108556999
good trips
>>
How's your blog doing?
>>
>>108557489
Nobody reads blogs
>>
>>108557639
How's your yt doing?
>>
>>108557661
Haven't uploaded any videos in years.
>>
>>108547113
>mov r0 0
>add r0 1
>add r0 1
>add r0 1
>...
>>
>>108551352
>AI is incredible it can do everything for you!!
is just as wrong as
>AI is so useless it can literally do nothing except copy a javascript todo app from tutorials online!!

It's a fucking tool, a CNC router isn't going to make you a master woodworker if you have no clue what the fuck you're doing and there's shit that it fucking sucks at making, but it does make a lot of shapes trivial to create if you know how to use it
>>
>>108557700
You're right. But it often feels like an almost broken tool.
You can get some work done still, but it's just annoying
>>
>>108552333
>>108552763
Things I'd consider:
>a "writer" for each context that can be passed around
write_a and write_b are basically that in the form of a lambda. You can have context.get_writer() that returns the std::function automatically, maybe (it's been ages since I've written C++ but surely that would work).
Initialization is circular but you can encapsulate it into a ContextPair thingy, whether that be an object or literally just a helper function, and it'd return an std::pair<Context, Context> with their writers already interlinked.

>a backing ContextStore object
Just have a single object storing a_val and b_val, or even a map<contex_id, val>, and then each Context object is basically a view into its specific val while also being able to write to other vals in the store.

>literally just what you have here
If the usage is relatively small then you might not need to overcomplicate it

If this is going to be multi-threaded code then you obviously either need mutexes on this, or I'd consider message passing where contextes subscribe to specific channels corresponding to their value and can also send "write" messages into other channels. For single-threaded use this obviously doesn't matter.
>>
>>108554080
for me it's APL
>>
>>108551352
>>108557700
It's becoming a noticeable issue. Every new model can do something new but then can't do something it was previously able to do.
Maybe the answer is treating AI truly like a tool box with hyper specific models that you have to pull out for problems.
>>
>>108557790
>Maybe the answer is treating AI truly like a tool box with hyper specific models that you have to pull out for problems.
I am not sure what you mean by HYPER specific, but for specific it's a reasonable take imo.
Have one for koding only, one for sucking your dick, one for cooking, and so on. That's probably what will happen. I mean it is already happening. Those solutions just aren't much better yet

I have to pee btw
>>
What's your favorite power food?
What's your favorite power drink?

I will make bolognese and a matcha latte now
>>
>>108557929
*opens mouth*
>>
>>108558690
/home/user/oss-cad-suite/lib/ld-linux-x86-64.so.2 has encountered a fatal error and was closed.
>>
>>108540878
https://pastecode.io/s/0whp2f98

I'm dicking around with some toy FM synth to learn the basics of Phase Modulation.
>>
>>108558448
My favourite powdered food is hot chocolate.
>>
>>108558935
Good, I am fine with that
>>
>>108558864
Oh no, I broke fm calculation.
I JUST DON'T KNOW WHAT WENT WRONG.
>>
I rewrote my codebase to use strings with unsigned char pointer, but only after I'm 90% done did I realize that I can't use printf with those strings.
Can't make my own printf because literally every library on earth imports printf and causes a name conflict.
Can't use a macro that injects a cast because you can't wrap a name into itself.
Can't make a new print function because I have no idea what to call it without making it longer. printx?
>>
>>108558864
>>108559862
https://pastecode.io/s/aipsmbt2
Ok I fixed.

Trying my hand at 1d mix matrix instead of fixed OPL3 algorithms.
https://github.com/tildearrow/furnace/blob/master/doc/4-instrument/fm-esfm.md
>>
>>108559926
just ctrl+h or ctrl+r
replace all unsigned char* with char*
your IDE should be sane and it should walk you through every replacement one by one before you actually replace the string.
also why would you use const unsigned char*, you are just adding more text for no reason, just stick to char or use a macro / typedef if you think the signedness ever mattered.
Technically... I think you can set the char to unsigned with -funsigned-char
>>
File: peekf.jpg (266 KB, 1280x720)
266 KB
266 KB JPG
>>108559926
put
>>
>>108556361
>>108556397
Unfucked Butt
>>
make happy

>make: *** No rule to make target 'happy'. Stop.
>>
>>108559926
What compelled you to do this? Should be an easy fix presumably.
>>
>>108560402
>What compelled you to do this?
Text being signed is so retarded that my brain cannot comprehend it. When I refer to ASCII values I look at a 0-255 byte table, I've checked for something like <=127 and caused a bug multiple times because I forget that 127 is the maximum and "characters" can be negative.

>Should be an easy fix
What should? I can revert it but I don't want to.
>>
>>108560465
>ASCII
>0-255 byte table
What's even happening? Did you write you're own character map?
>but I don't want to
OK. It won't be an easy fix then.
>>
>>108559926
Your mother was right.
>>
>>108559926
Call it printu for print unsigned
>>
>>108540878
jesus christ
>>
>>108560641
Only if he screams printooo like a samurai everyone he types it
>>
>>108559926
>I rewrote my codebase to use strings with unsigned char pointer, but only after I'm 90% done did I realize that I can't use printf with those strings.
Why can't you use %s?
>>
>>108560570
Why would I have a byte table that only goes up to 127 if I can have one that goes up to 255? Any text that I care about isn't ASCII anyway, it's UTF-8. When I want to parse text I am treating it as generic binary data, not as array of characters.
>won't be an easy fix then.
Changing a letter on a function name isn't hard. It's hard to choose the letter though.

>>108560641
String constants are signed so I need the function to accept both. I don't want to think about which one I need to use all the time.
>>
>>108560736
>String constants
*String literals
>>
File: 1766400164336490.png (63 KB, 323x320)
63 KB
63 KB PNG
>>108560736
>Changing a letter on a function name isn't hard. It's hard to choose the letter though.
>printa, printb, printc, printd, printe, printf, printg, printh, printi, printj, printk, printl, printm, printn, printo, printp, printq, printr, prints, printt, printu, printv, printw, printx, printy, printz
It's printy for me
>>
>>108560847
brapf(art)
>>
>>108560847
>printo
I'm partial to this
>>
>compiler won't allow me to divide a variable
>"expected ) before /"
>check the variable
>nothing wrong
>check the code around it
>nothing wrong
>spend 15 minutes looking around
>nothing wrong anywhere
>ignore it and go back to some shit I was working with
>macro that is used all over the place is missing "do{" so it was just "xxx;}while(0)"
I don't understand how it's possible for compiler error messages to still be this bad.
>>
>>108560944
>niggerlicious function like macros
>>
is this the modern C++ (TM) approved way of passing a file path into an object that is going to use it?

class IO {
const std::filesystem::path &path;
public:
IO(const std::filesystem::path &path) : path(std::move(path)) {}
};


I'm not entirely clear on the whole lvalue / rvalue thing as well as move semantics, but I want:
>the object to not be allowed to modify the path
>the object to not leave the original path in a bad state (move does this, but not with reference??)
>pass a reference instead of copy if possible (what happens if I construct with a string literal?)
and should I even use the filesystem path? it seems more correct but don't strings have that small string optimization thing? would they arguably be better because of that?
>>
In C, this is just
struct IO newIO(const char *path) {...}
>>
>>108560969
Looks bad, I don't see std::vector anywhere.
>>
>>108559926
Does C have a function called "print"? If not, why not just use that?
>>
>>108560987
>no directory descriptor
>char*
>>
>>108560969
move is just a cast from T& to T&&, its when you pass that T&& to a function that is overloaded to do something different from T& that something happens (e.g. if it had a move constructor), here idk if move actually does anything but you should remove it anyway
if you have a string literal it will be destroyed at the end of the full expression, e.g.
result = my_function(of(something(else(IO("a string")))));
would destroy it after my_function returns and assigns result
>>
>>108560880
Listen to this man of culture.
Listen closely.
>>
>>108561053
Sorry, if your path is more than 4096 characters long, you need to fix that. I'm not going to write workarounds for your degenerate filesystem.
>>
>>108561037
I have an autistic fixation with the idea that print() is for printing the arguments without formatting (like console.log() in JS). It's not possible to do it in C, but still.
>>
>>108561074
So your code is deliberately useless, got it. Also in addition to >>108560987:
>no string length, for decent kernels
>>
>>108561096
Is this "decent kernel" in the room with us right now?
>>
>>108561100
Yes.
>>
>>108561107
Must be a meme no one uses. Nothing people actually use have that.
>>
>>108561112
26.33% according to statcounter,
>>
>>108561116
You're not supposed to use NT functions, anon.
>>
>>108561120
>>108561116
And the NT functions don't support that anyway. Did you even read the docs?
>>
File: 1676236977398692.jpg (494 KB, 828x821)
494 KB
494 KB JPG
>>108561120
>supposed to
>>
>>108561139
... did you? Because they do.
>>
>>108561141
>>108561139
>>
>>108561141
Damn, I really have to pee again. But I have to admit that I like my RGB keyboard. I used to think that you don't need them and they are a meme, but RGB makes me kode much faster.
Now the question is, should I kode all night or not?
>>
>>108561148
>>108561146
>>
>>108561146
>>108561157
Where?
https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile
>>
>>108561158
ObjectAttributes->ObjectName->Length and MaximumLength.
>>
>>108561165
>USHORT
This isn't the win you think it is.
>>
>>108561178
As long as no code has to repeatedly iterate over the string to calculate a length I already know I'm good.
>>
>>108561178
it literally is the win32 he thinks it is
>>
>>108561195
>win32
Nah, CreateFileA/W are garbage.
>>
>>108561195
>>108561194
Fine, I admit I was wrong.
>>
>>108561206
>I admit I was wrong.
this is easily the most fucked up post i've seen this month
>>
>>108561156
How much does it cost to buy the earf?
>>
>>108561233
nothing, you can just give people paper in exchange and they fall for it
they even pay for you to print the paper
>>
>>108561233
About 5 - 7 cm ± 3 ˚C
>>
>>108561259
>>108561261
I'm gon buy the earf and be king
>>
>>108561096
adding a size to a scanning parser will just introduce new kinds of errors to be thrown.
if you like having new error types, that's good for you.
I just feel like if I was writing an API that takes in a size, I am going to forget to respect the size while printing internal debug logs. And the only reason to pass in a size is if you know the string is not null terminated. So not even your debugger can make sense of those strings.
So, that means that you have the opportunity to make a mistake like forgetting to use %.*s instead of %s in printf. And sadly there is no type info inside a char* so you can't just pass that into a type safe logging system, and if you tried to, it's common for char* to be treated as always null terminated, so then you get an error (and because your debug logging system is only for debug builds, it's unlikely for you to actually know your code can't handle printing that string, so the bug is just hiding there).
>>
>>108561313
Skill issue.
>>
>>108561286
I like the chili cheese burger a lot. The buns from the king are a bit too THICC, but every now and then they are decent
>>
>>108561341
I like retardproof code.
>>
>>108561362
I like fast code.
>>
>>108561378
I'm sorry to tell you this, but you do not understand how high performance parsers work.
You don't just add a size, and magically parsing gets faster.
This isn't a memcpy.
You are just turning:
for(;*cur != null; cur++)
into
for(;*cur != '\0' && cur-start < size; ++cur)

(by the way, this code was not tested, this might have an off by 1 error)
>>
Everything should have a size, but if you're going to add it then you need to change everything to have it.
>>
>>108561411
>*cur != '\0'
Not only do you not understand input sourcing, but that check is also superfluous.
>>
>>108561448
NUL terminators aren't allowed inside filenames, so that check still has to exist somewhere.
>>
>>108561494
Not your problem. Kernels problem.
>>
>>108561526
so you agree that having a size won't increase speed at all?
you do know that you could just benchmark this and just pwn us with your superior knowledge of performance, right?
Think about how much faster:
for(; cur-start < size; cur++)
is compared to:
for(;*cur != null; cur++)
That has to be at least 2x faster, right?
>>
I feel like you guys go crazy with optimization. To the point where i wonder if you're actually getting anything done, or you've spent a lifetime rewriting the perfectly optimized and fast hello world. I probably feel this way because I don't understand optimization techniques.
>>
>>108561593
optimization is one of the fun puzzle solving parts of programming. people like discussing it because its far more interesting then talking about how you tab completed 1000 standard objects together to make something no one cares about
>>
>>108561682
Actually, it's autism.
>>
>>108561682
I watched a whole thread once devolved into a Mongolian cluster fuck over i++ or ++i.

Even if ++i was twice as efficient, the dudes would never recoup the time they invested in the thread if they wrote a trillion for loops.
>>
>>108561743
I just don't understand why i++ is always used in teachings where it shouldn't be
>>
>>108561566
>so you agree that having a size won't increase speed at all?
No, because you still don't understand input sourcing.
>>
Staging: >>108561805
>>
>>108561781
inertia combined with languages that don't allow pre-increment
>>
>>108561593
There's different tiers of optimizations. The lowest tier is simply using lower-level code that's been abstracted away by higher-level code for no good reason (ditching malloc for HeapAlloc, or fopen/CreateFileA/W for NtCreateFile), and there is no excuse not to use them.
>>
>>108540878
R.I.P. /dpt/
>>
>>108561792
what's input sourcing?



[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.