File: The-C-Programming-Language-e1603821228331.jpg (35.0 KB)
What are you working on, /g/?
Previous: >>108932455
Showing all 135 replies.
>>
>>
>>
File: snooping.png (31.9 KB)
Is there an easy way to get around these cloudflare bot checks in python? The website Iv'e been scraping has recently started implementing this and I'm too retarded to figure this out. The closest I've gotten was using playwright but I can't get it to press the button.
>>
File: 1754689330288726.png (110.4 KB)
>>108953357
I remember working on one of these, like 90% of the userbase were ADHD spergs and the rest were women who downloaded it during menstrual cycles (internal clock gets fucked up during this) and stuck with it as a habit.
I wonder how much of /dpt/ actually get their minimum daily water intake correctly though.
>>
>>
>>
>>
File: mpv-shot0001.jpg (23.4 KB)
>>108950758
https://i.4cdn.org/wsg/1780294195613316.webm" target="_blank">https://i.4cdn.org/wsg/1780294195613316.webm
>>
>>108953728
>>108953871
This. People should just stop being retarded.
I have diagnosed ADHD and it has never been a problem.
Of course there are times where I sit here and feel like I'd be dying from thirst soon because I am so focused, but I guess these moments are normal for everyone. Just drink whenever you feel thirsty. Simple as that.
I don't even understand why normies desperately want one trillion apps on their fone. I try to keep my app count as low as possible
>>
>>
>>
>>
File: w7v3uur72mae1.png (492.7 KB)
>>108953626
https://pastebin.com/cAn47wq6
just wrote this catastrophe to automatically create header files and insert a header guard with a uuidv7 appended to it, since i couldn't find anything online to do this and got tired of doing it manually.
>>
I am stuck in tutorial hell, maybe. But maybe I am not stuck. I am not sure.
I have a very hard time just doing things myself with "no" other influences in between.
For example I want to build a compiler. I know most of the basic stuff for lexing and parsing, but I still keep going back to see what others did and then try to adapt.
The result is always some clusterfuck that I don't like.
How do I force myself to do my own shit and fight through it? I am just a weak fuck with no willpower
>>
>>108954525
i think you're getting impatient with yourself and thus not fully absorbing/understanding the material you're reading, then when you can't remember what to do you get lost. try giving yourself time to fully encircle a concept before moving onto the next one, and create a strong association between concepts and the code that deals with them. from there it's just repetition.
>>
>>108954549
yeah sounds about right.
I just want to move as fast as the 100x AI engineers in my head, but I do know that's not possible if you don't do webapps. So yeah, gotta learn how 2 be patient or do more amphetamines
>>
>>
>>108954651
I do have a clear dream, but not a clear vision.
I'd like to build a retro-ish style computer with my own language and hopefully self-hosted some day.
But the internet tells me I have to learn AI.
But AI suck. Tho learning to deploy AI on an FPGA would be nice, too. But I have no concrete goal for that, so I keep overthinking.
And this shit is going round and round in my head spinning circles all day like meatspin.
I should just say fuck it, I am neet, I am allowed to follow retard dreams and go down the terry route without getting schizo hopefully
>>
>>108954525
There is no point in reinventing the wheel.
But then again there are far more bad examples than good ones. And the trick is finding the good examples.
And it's a trick because the Dunning-Kruger effect will lead you to not recognize the good examples when you see them and will cause other people to tell you they are bad examples.
>>
File: 1775396161929666.jpg (57.1 KB)
>>108954619
Everybody's putting their pants on one leg at a time.
>>
>>
File: nonononononon.png (304.6 KB)
>>108954703
oh no no no no no no
HAHAHAHAHAAHAHAHAHAHAAHAHAHAHAHAAHAHAHAHAHAAHAHAHAHAHAAHAHAHAHAHAAHAHA HAHAHAAHAHAHAHAHAAHAHAHAHAHAAHAHAHA HAHAAHAHAHAHAHAAHAHAHAHAHAAHAHAHAHA HAAHAHAHAHAHAAHAHAHAHAHAAHAHAHAHAHA AHAHAHAHAHAAHAHAHAHAHAAHAHAHAHAHAAH AHAHAHAHAA
>>
>>
>>
>>108954724
Why does it matter what the dragon identifies as when:
>It's literally just hatched
>already knows if its gay or not right out of the egg
>if its a pet why would you care what its sexuality is?
This is giving off way too many sus fucking vibes man.
>>
>>
>>108954724
>>108954730
>>108955080
>>108955068 Makes a really good point, it's always children and infants with these freaks.
>>
>>
>>
>>
>>
>>
>>
>>
File: 1355021011308.jpg (125.7 KB)
public static void main(String[] args) {
learn2Code();
}
public static void learn2Code() {
char[] string = { 73, 102, 32, 121, 111, 117, 32, 100, 111, 110, 39, 116, 32, 114, 101, 112, 108, 121, 32, 116,
111, 32, 116, 104, 105, 115, 32, 112, 111, 115, 116, 32, 121, 111, 117, 114, 32, 109, 111, 116, 104,
101, 114, 32, 119, 105, 108, 108, 32, 100, 105, 101, 32, 105, 110, 32, 104, 101, 114, 32, 115, 108, 101,
101, 112, 32, 116, 111, 110, 105, 103, 104, 116, 33 };
System.out.println(string);
} >>
>>
>>108954525
You have to come to eace with the fact you may never figure it out. You may not have what it takes cognitively or dispositionally. Maybe you are incapable of focusing.
The space you're looking to explore is _vast_ and extremely tricky, Again, you may never achieve anything, and you may not be as smart as you think you are. So you have no reason not to glow slow and thoroughly.
Stop looking to the future.Master what's immediately in front of you. Who gives a fuck if it takes ten years. Who gives a fuck how long it took or didn't take other people. Stop worrying about literally everything but mastering what is literally right in front of your nose.
I've been there. I talked my way into a job I had no business doing and was balls deep in gcc guts freaking the fuck out. I had to "give up", in that I had to accept that all I control is the "try" part and not the outcome. If I got fired, fuck it.
This opened up some kind of psychological space where I could use more of my brain with less mental chatter. In the end, I figured it out, and only then did they clue me in that the prior four people all failed. I hope you understand what I'm getting at here. Good luck, faggot.
>>
>>108955441
>was balls deep in gcc guts freaking the fuck out.
Ok that reddit spacing and the first 2 lines made me suspicious af, but you saved yourself here.
I'll try. Thanks.
>>108955441
>Maybe you are incapable of focusing.
Doc says I have adhd. Other people say "wow bro you are so intelligent". So le imposter is striking every now and then. And that the space is so vast makes it even harder. There are so many cool things.
But the main thing I realized and I have to constantly remind myself of: I have to do that shit for myself, not for the (You)'s. But unironically.
>>
>>108955414
Your code seems to be buggy.user@desktop:~/ $ python3
Python 3.14.5 (main, May 11 2026, 00:00:00) [GCC 16.1.1 20260501 (Red Hat 16.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> public static void main(String[] args) {
... learn2Code();
... }
...
... public static void learn2Code() {
... char[] string = { 73, 102, 32, 121, 111, 117, 32, 100, 111, 110, 39, 116, 3\
2, 114, 101, 112, 108, 121, 32, 116,
... 111, 32, 116, 104, 105, 115, 32, 112, 111, 115, 116, 32, 121, 111, \
117, 114, 32, 109, 111, 116, 104,
... 101, 114, 32, 119, 105, 108, 108, 32, 100, 105, 101, 32, 105, 110, \
32, 104, 101, 114, 32, 115, 108, 101,
... 101, 112, 32, 116, 111, 110, 105, 103, 104, 116, 33 };
...
... System.out.println(string);
... }
...
File "<python-input-0>", line 1
public static void main(String[] args) {
^^^^^^
SyntaxError: invalid syntax
>>>
>>
File: Screenshot_20241106_191309.png (116.1 KB)
>>108953626
>shitte language and shitte book
>>
File: 1780317122859303.png (28.6 KB)
>>108955538
retarded fuck.
>>
>>
>>
File: Screenshot_20260601_144251.png (27.7 KB)
>>108955538
???
Works for me
>>
>>108955538
The "cc hello.c" command on the book is for the c89 version of the language. The version you are using to compile the file is a newer one, with a slightly different syntax.
You need to keep this in mind at all times when using OPs book.
>>
>>
>>
File: 1723943856848690.png (112.3 KB)
>>108955901
>>
>>
File: videoframe_3838587.png (297.1 KB)
>>108955983
Yes, as a reasonable person, I can analyze other people's ideas and agree with them.
>>
>>108956010
You do realize that most people actually know that this is an old book, right?
And if you're a beginner and believe it when a boomer tells you that this, and only this, book is the absolute truth, then maybe programming just isn't the right thing for you
>>
>>
>>
>"dont reinvent the wheel! dont reinvent the wheel!"
>decide to not reinvent the wheel and use Export-CSV instead of just writing a formatted string in which I parse all my variables using a foreach
>because Export-CSV can't parse a PSCustomObject for absolutely no reason and type conversion in powershell is black magic that I waste multiple hours on and I end up just giving up and going back to a formatted string hackjob anyway
yeah that's the last time i try to avoid "reinventing the wheel"
>>
>>
>>
>>108956427
Are you a newbie or why are you recommending it? This anon here >>108956057 wrote two libraries!
>>
>>108956482
there isn't any 'modern' replacement probably because there doesn't need to be one. even if you only stick to c11 or c99 you still absolutely need to know where ansi c89 stops off because a lot of projects intentionally use c89 to ensure maximum portability (single-header libs for example) or in the case of something critical it needs to conform to a spec based on c89 like misra, jsf, jpl. or if you're studying formal verification this is usually done in some subset of c that's usually close to c89.
>>
>>
>>
>>108956038
>this is an old book
Irrelevant. You still have all the autists flocking to the "Art of UNIX Programming" too, because even if they cognitively understand that the book was outdated by about two decades when it released - they just don't care.
Which is exactly why autists have to be banned from programming. There is simply no other way.
>>
>>
>>
>>108957552
Nope, it's its age.
Everyone who wasn't a complete sub-70-IQ retard with a mandatory death warrant in ANY serious society could've told you that just the fucking way I/O was being conducted is a dead-end, and that's not even getting into memory alllocations IN FUCKING 1990!
This is EXACTLY why autists have to be banned from ANY type of software development in pretty much the same way we ban sex offenders from using the internet. From my perspective the two are interchangeable. In fact I would ban them from the internet altogether. There is NO punishment you can inflict upon autists where I'd say it's going overboard.
>>
>>108955522
I'm glad you're open to the general train of thought I was on, many people really don't like hearing that message, and your ability to hear it and reflect on it bodes well for you. In this lineof pursuit, you only have to win once, you can fail a million times. Your entire strategy is a relentless narrowing down of what is working _for you_ and getting within artillery distance of a crisp win. Then you let a thousand shells fall and try to walk them toward that crisp victory.
I can somehow tell from your writing our minds may work similarly. So, here are two pieces of unsolicited advice. First and most importantly, if you cannot concisely state what you're doing in two sentences, you're currently in the process of fucking up. It should be like the requirement a cop has when they pull someone over: an *articulable* suspicion. Not a feeling or vibe, literally "I'm trying to _______." Keep a text file with your intentions and findings so you can return to them if you context switch.
Second, relentlessly ease friction. By this, I mean: expect to need to instrument everything and take explicit steps to lower that cost. For me doing gcc work, that meant having command line arguments for a variety of dumping purposes ready to roll for gcc, ld, as, and within gcc, for the passes I was most concerned with, mostly front end, gimple, and way far in the back end for the mips variant used. Point was, I never guessed, I just hooked some dump code on one of these and dumped it.
I guess I'll add one final thing. Try to understand the micro-narrative. For example, I was looking at tinycc and trying to figure some change out, which added some $FOO support, then a flimsy excuse to use $FOO. But why? Eventually I figured out, "fuck, tinycc is its own test suite! FUCK". Sounds dumb, but taking the time to smell the flowers helps contextualize "YOU ARE HERE" in the overall map of the space. Godspeed.
>>
>>108953626
I'm writing a BitTorrent downloader and supporting library (and maybe a tracker later) in Zig. I'm still just writing the bencoding parser, using std.json.Scanner for reference. Comfy language with some really nice features and conveniences, and this is a fun project to learn it with.
>>
>>
>>108958064
Alright, one more important thing before I go and stop procrastinating my own work today. When you are absolutely up shit creek without a paddle, there is value in understanding what something _isn't_. At one point I was so absolutely fucked, unbelievably fucked, in some quagmire adjacent to the register allocator, that I couldn't even figure out what questions to ask for an entire week. Finally, I thought, "fuck, uhhhh let me count how many hits each top level branch of this thing gets, then recompile all company codebases from scratch, then use a script to spit out the aggergate numbers".
I kid you not, it was something like 8 billion of one branch, 148 of another, and 4 for the third. All others were zero. I can't remember the details, but knowing what *wasn't* important saved the day. And it also provided me with some flower smelling, because all the few-but-taken cases were cases where some previous pass "went exponential" or failed and that was recovery code from that, but I was too stupid to know it.
And here's a tip for handling
>COPE
feelings, try to structure everything you're doing as if someone who truly knows their shit is on their way to help you, but they've been delayed for a month. Make sure all your shit is clean and well formatted, and make sure you can explain everything casually. Maybe that person materializes, maybe not, maybe in this case I am that person to you at this exact moment, maybe you will be that person to someone else in the future. Who knows.
>>
So i've been learning the basics of C++, and i thought it'd be fun to fool around a bit with a free WebAPI, make some HTTP requests and all that, and so i decided to have a look at curl and see if i can understand what's going on in there.
And holy shit what a maniacal gargantuan fucking codebase with magical shit everywhere. It immediately demotivated me to look any further.
How do people even work with this? Do you read the "it just werks" documentation and never look back? I'm depressed now.
>>
>>
>>
>>
>>108958296
>And holy shit what a maniacal gargantuan fucking codebase with magical shit everywhere. It immediately demotivated me to look any further.
Oh yes, that's what a full HTTP implementation looks like these days. They're awful, with stupid amounts of complexity in there.
Fast though. The complexity's there for a reason.
>>
>>
>>108958943
https://en.wikipedia.org/wiki/M4_(computer_language)
>>
>>
>>
>>108953626
I'm working on a fitness app in Android Studio. I'm aware there's a million of them already, I'm just building it as an exercise with the added bonus of maning a little better version of FitNotes for myself.
>>
>>108959000
They're absolutely cancerous in C++ though.
>auto
>auto*
>auto&
>auto const
>const auto
>const auto&
>auto* const
>const auto*
>const auto const
>const auto* const
>constexpr const auto&
>wtf_am_i_dereferencing.cpp
>>
>>
File: 1751395592158880.png (18.6 KB)
>>108959109
C++ is a mutant.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>108959282
>>108954662
Stop. You know nothing. You have shipped 0 features by hand. No one has ever depended on your code. You are a finger-wagging "AI wrote this" type in an era where you hide in plain sight coasting on the moral high ground of writing toy projects and scripts from scratch. Can't ship, can't adapt, can't even realize that an issue tracker is not the place for this kind of attitude.
>>
>>
>>108953728
I never get thirsty! like ever. maybe I'm an actual retard. STORY TIME:
>be me constantly get migraines
>go to store buy a bottle of coke, tylenol, and a redbull, advil
>"youre gonna get a heart attack haha" - clerk lady
>"haha this is my headache cure. I get them a lot"
>"oh you should drink 2L of water every day"
>"oh really? okay thanks"
this was the first time in my entire life anyone told me I need to drink water. I was 25. literally an adult. my parents never told me to drink water and gave me pills every time I complained. I just never made the connection.
>>
>>
>>108959588
Did I hit a nerve Rajeesh?
>>108959619
What's wrong with nasm?
>>
>>
>>
>>
File: file.png (96.6 KB)
>>108959741
Gas features like local and anonymous labels are also quite nice, unlike nasm's. Do you really want to name every single loop branch and have it appear in the final binary?0:
...
jmp 0b
.Lnamed_local:
...
jmp .Lnamed_local
Also, somehow autists will defend this.
>>
>>
File: 1780356166036638.png (58.3 KB)
>>108959734
>>108959832
You just made a sale.
>>
>>
>>
>>
>>
>>108959143
This really isn't a compelling argument when our feet are modified hands and our backs are actually still designed for 4 limb locomotion, it just got "pushed up" over time to be straighter rather than hunched and a rib caged narrowed.
Which is why so many people have feet, knee, lower back, and lung problems. All of these things are literally just nature slapping duck tape and superglue on it and going "that's good enough".
>>
>>
>>
>>
>>
>>
>>
>>
>>108960576
I haven't needed anything other than python... ever
I've accumulated a 6 figure nw just knowing it, sql, and other basic stuff
C++? Maybe I can remember hello world. Maybe I can remember the vector gotchas I learned this winter too. Will I type it out or use it? Not likely.
>>
>>
>>
>>
>>
>>108960576
People shit on it because the amount of amateurish code that comes out of India, but Python accidentally hit the sweet spot between flexibility, utility, and readability; make it a crazy powerful language to use. The only valid criticism I've ever heard about Python is that its slow and it can be very memory hungry even if programmed efficiently.
And hey, that's okay, no language is the end all, be all, no language is perfect but Python is probably one of the few programming languages that comes close.
>>
>>
>>
>>
>>108961049
Yes but it depends on the operation and the language and the variables floating around in the environment. It could also speed up a language if you have so many variables stored and you're afraid of conflicts to just slip them up to prevent crashes.
>>
>>
>>
>>108958296
More than a decade ago I wrote my own HTTP parser. In hindsight I can say it was quite hideous because I didn't even attempt to make it non-blocking, or to have multiple outstanding requests at the same time, or keep Boyer-Moore jump tables around, or used SIMD instructions for searches - but at least I kept the current parsing state outside of the stack, so that I wouldn't have to re-parse the entire thing from the very beginning when the kernel added another block.
Then I saw an actual retard programmer reading and processing one byte at a time, "because that way I don't have to allocate memory".
Point is, no matter how bad you think you fuck up, there is NEVER a bottom.
>>
>>
>>108958296
>networking is hard
yup. here's a netcat mirror. its a simplier utility, but its still 2000 lines. turns out working with sockets is a lot of code.
https://github.com/sjz123321/netcat1.1-mirror
>>
>>
>>
>>
>>
>>
>>