Thread 105870428 - /g/ [Archived: 340 hours ago]

Anonymous
7/11/2025, 4:43:39 PM No.105870428
pointers
pointers
md5: db9e4c6ab6f925804af8a5ed77800e0e🔍
you aren't real programmer if you don't fully understand pointers.
Replies: >>105870466 >>105870493 >>105870552 >>105871124 >>105871208 >>105871268 >>105871319 >>105871320 >>105871559 >>105871829 >>105872156 >>105873861 >>105876176 >>105879595 >>105880244
Anonymous
7/11/2025, 4:48:33 PM No.105870466
>>105870428 (OP)
>you aren't real programmer
you are not a real programmer cnile. Rust has superseded your toy language.
Replies: >>105870491 >>105870580 >>105871026 >>105872076 >>105873853 >>105877610 >>105879268
Anonymous
7/11/2025, 4:51:37 PM No.105870491
>>105870466
Competent rust programmers understand pointers and you don't.
Anonymous
7/11/2025, 4:51:45 PM No.105870493
>>105870428 (OP)
Ok but they're not hard to understand. It's just that C made it complicated.
Replies: >>105871188 >>105879387
Anonymous
7/11/2025, 4:58:05 PM No.105870552
>>105870428 (OP)
>POINTer POINTS to memory address
that's it really.
Anonymous
7/11/2025, 5:01:36 PM No.105870580
>>105870466
fpbp, op utterly fucking destroyed.
Replies: >>105870685
Anonymous
7/11/2025, 5:13:28 PM No.105870685
>>105870580
Bot post. Rust has pointers.
Replies: >>105870884
Anonymous
7/11/2025, 5:36:34 PM No.105870884
>>105870685
which you aren't really supposed to use in normal cases since references > pointers.
kys faggot
Replies: >>105871159
Anonymous
7/11/2025, 5:47:19 PM No.105871000
pointers are literally 1st year CS undergrad shit
how could someone learn to program and not understand pointers?
Replies: >>105871107 >>105871118 >>105871559 >>105877474
Anonymous
7/11/2025, 5:50:48 PM No.105871026
>>105870466
>Rust has superseded your toy language
this
plus trans women are real women and being attracted to minors is valid and completely sane
deal with it
Anonymous
7/11/2025, 5:59:24 PM No.105871107
>>105871000
you can program without understanding anything at all
Anonymous
7/11/2025, 6:00:36 PM No.105871118
>>105871000
because most techlet "coders" have only ever used javascript or python so the simple concept of "thingie points to place in memory" is foreign for them.
Replies: >>105871559
Anonymous
7/11/2025, 6:00:57 PM No.105871124
>>105870428 (OP)
Whoever wrote your slide doesn't really understand pointers either. Pointers to pointer aren't really about the value of 'var', they're about the value of 'ptr', and the ability to point 'ptr' to something new. This is a bad example because it's lazy.
Anonymous
7/11/2025, 6:03:41 PM No.105871159
>>105870884
Unless you do FFI, allocators, containers or any sort of low level stuff. You know, things that systems programming is good at. It's all pointers then.
Also references in Rust are just pointers with lifetime semantics. They aren't a special thing like in C++.
Replies: >>105873548
Anonymous
7/11/2025, 6:06:33 PM No.105871188
>>105870493
C did not even make it complicated. The only "difficult" parts are a) the meme that pointers are confusing causing new programmers to not even try to understand them and b) people who do not understand how memory accesses work. (a) filters retards who have not yet learned how to adopt a learning mindset. (b) filters retards who never even learned how to do algebra.
Replies: >>105871229 >>105876258 >>105879387
Anonymous
7/11/2025, 6:06:51 PM No.105871196
Sometimes I feel bad for not being a real programmer. But there are so many things I regret not being. Like a mozart genius musician, a brain surgeon, a millionaire..

My life is pretty disappointing
Anonymous
7/11/2025, 6:07:56 PM No.105871208
1746169488274618
1746169488274618
md5: fe569dab445427c5bee1d18dcca33bfb🔍
>>105870428 (OP)
>
Anonymous
7/11/2025, 6:10:19 PM No.105871229
>>105871188
There are people out there who consider themselves programmers who do not understand how CPUs work and how memory addressing works. This sometimes blows my mind.
Replies: >>105871312 >>105871379 >>105871559
Anonymous
7/11/2025, 6:13:55 PM No.105871268
>>105870428 (OP)
pass by value
pass by ref
zzzzzz
Replies: >>105871282
Anonymous
7/11/2025, 6:15:25 PM No.105871282
>>105871268
Pointers are passed by value in C. C does not have reference semantics. Pointers allow to implement referential access.
Anonymous
7/11/2025, 6:19:03 PM No.105871312
>>105871229
I have no idea how MMU works but it never was a problem to me, no matter how high or low level stuff I was working on.
Replies: >>105871379
Anonymous
7/11/2025, 6:19:58 PM No.105871319
>>105870428 (OP)
I understand them
I haven't had the need for this knowledge in over 7 years working for a few different companies
>You're not a real programmer
Bet I make more money and deliver more code than you
Anonymous
7/11/2025, 6:20:06 PM No.105871320
>>105870428 (OP)
Pointers are unsafe cnile slop
Rust deprecated C/C++
Anonymous
7/11/2025, 6:26:18 PM No.105871379
>>105871229
>>105871312
For the most part building a usable mental model for the CPU is pretty simple. You do not need to know the details. A big part of the problem is people who equate "contemporary CPUs are too complex to understand completely" with "it is impossible to build a useful mental model of how computers are organized and function." Programming education in general makes this even harder with the insistence on abstracting programs from hardware (e.g. when in university I had many CS teachers who would say the hardware is irrelevant and not to bother trying to understand how an algorithm is computed, which made sense in the context of the course, but was not generally good advice.) Languages like JavaScript and Python also have more difficult semantics to really understand and are generally explained extremely poorly, and as those are often the first languages new programmers see, well, a pattern is set and continues throughout their lives.
Replies: >>105871559 >>105872477
Anonymous
7/11/2025, 6:44:21 PM No.105871559
>>105870428 (OP)
You need to understand pointers to be a real programmer, but C syntax has nothing to do with pointers. C shills constantly lie and act like pointers are some kind of C invention.

>>105871000
>how could someone learn to program and not understand pointers?
Because they are C programmers. C makes it impossible to understand pointers because they're constantly confusing them with arrays and bewildered by the C syntax. An array is not a pointer. A string is not a pointer. The character * has nothing to do with pointers.

>>105871118
>because most techlet "coders" have only ever used javascript or python so the simple concept of "thingie points to place in memory" is foreign for them.
JavaScript and Python use that concept more than C does because they're based on Lisp. At the time Lisp was made, pointers were considered a domain-specific feature for list processing. Mainstream languages didn't have pointers.

>>105871229
>>105871379
CPUs work however the designer makes them work. A CPU doesn't have to resemble the C abstract machine or PDP-11 at all. C programmers don't understand that.
Replies: >>105871581 >>105871662
Anonymous
7/11/2025, 6:46:38 PM No.105871581
>>105871559
>A CPU doesn't have to resemble the C abstract machine or PDP-11 at all. C programmers don't understand that.
All CPUs in commercial use in current year do.
Replies: >>105871620 >>105871662
Anonymous
7/11/2025, 6:50:08 PM No.105871620
>>105871581
>All CPUs in commercial use in current year do.
Normal science
>based on how the universe works
Computer """science"""
>based on "commercial use in current year"
Replies: >>105871663
Anonymous
7/11/2025, 6:53:53 PM No.105871662
>>105871559
Correct. Processors are implemented however they are implemented. The point is that building an understanding of "oh hey, this is how I can think about a memory and this is how I can map my operations onto it and this is how I can think about how the machine uses the memory" does not require to understand precisely how the machine is organized, or what specific instructions are used to actuate the MMU or how the OS uses the MMU to provide address spaces or how different clock regions are organized or what specific instructions will cause a bus stall. A basic understanding of how the machine can implement the abstract concepts goes a long way regardless of what language you are writing in.
>>105871581
This is not necessarily the case in embedded. While ARM MCUs dominate, especially for new projects, weird 8 bit MCUs like PIC16F are still in use and people still write code for them. These MCUs typically have instruction sets that do not map all that well to C abstract machine.
Replies: >>105871761 >>105871771
Anonymous
7/11/2025, 6:53:53 PM No.105871663
>>105871620
Instead of just saying
>you're right, of course, but there is nothing *requiring* them to do so
you just devolve into your usual tranny rage. You seem like you used to be smart, it's sad what those chemicals did to your brain.
Replies: >>105872073
Anonymous
7/11/2025, 7:03:00 PM No.105871761
IMG_0387
IMG_0387
md5: 3957644c2fa867e9c9aeb2413c95099e🔍
>>105871662
>do not map all that well to C abstract machine.
You're not totally wrong, but it's worth noting (picrel)
>Since the most widely used high-level programming language for PIC microcontrollers is C, this document will focus on C programming. To ensure compatibility with most PIC C compilers, the code examples in this document are written using ANSI C coding standard.
It's really the only language used, unless you consider assembly to be a language. I think C is the only language even available for these chips.

So although you're "right", I don't consider you to really be all that right.
Replies: >>105872033
Anonymous
7/11/2025, 7:03:35 PM No.105871771
>>105871662
>map all that well to C abstract machine
the only abstractions C has are function calls and loops, they map to the instruction set in the same way you'd write them in assembly
Replies: >>105871799 >>105872033 >>105872097
Anonymous
7/11/2025, 7:05:55 PM No.105871799
>>105871771
>C abstract machine
He's talking about the C language ISO/IEC standard's usage of the term "abstract machine".
Replies: >>105872033
Anonymous
7/11/2025, 7:08:50 PM No.105871829
>>105870428 (OP)
I don't need to, ASM doesn't have pointers
Replies: >>105871893
Anonymous
7/11/2025, 7:14:40 PM No.105871893
>>105871829
You sound like one of those guys who is
>it's all just atoms and molecules bro
then uses this to justify fucking a dude's asshole
Replies: >>105871962
Anonymous
7/11/2025, 7:20:33 PM No.105871962
>>105871893
Everything is easier in ASM, the abstraction is minimal. The processor does exactly what you tell it to and not a command more.

Nothing is obfuscated by some obtuse bloatware library OOP users like so much.
Replies: >>105872031
Anonymous
7/11/2025, 7:25:59 PM No.105872031
>>105871962
For instance pointers, pointers are a pain because their behavior is complicated in how the compiler handles it, meanwhile functions in ASM take variables either via registers, memory, stog (fancy memory structure) or definition behind BL (fancy memory again).
Replies: >>105872053
Anonymous
7/11/2025, 7:26:03 PM No.105872033
>>105871761
Yes. I will admit the last time I wrote for PIC was 20 years ago in university and perhaps the state of the art has advanced since then; however, we used a mix of C (the C compiler we used was absolute garbage) and ASM. The C was largely computation and glue. The fact that C is the most widely used "high level" language for these MCUs is more due to the fact that "everyone" knows C and there is a vast respository of knowledge on how to write C. Rolling your own language that better maps to the hardware, especially for machines as small as this, just is not feasible or smart.
>>105871771
See >>105871799 and consider, too, that C supports a number of "abstractions" such as types, pointers, structs, unary and binary operations (e.g. &&, !, +, ?:, etc), switch/case/if/else, variables, variable scoping. The list goes on. All of these are concepts abstracted from whatever machine a given compilation of a C program targets, even if many of these abstractions can map cleanly.
Anonymous
7/11/2025, 7:28:03 PM No.105872053
>>105872031
No shitty ass "this is a pointer to this adress meanwhile this a a variable, this a pointer pointer that you need to derefrence to pass to..." ah shit, you pass variables to function either via registers or memory
Anonymous
7/11/2025, 7:28:51 PM No.105872063
why do people act like this is some great filter in the programming world lol
Anonymous
7/11/2025, 7:29:56 PM No.105872073
>>105871663
>>you're right, of course
But that's not right at all. They don't actually resemble PDP-11s. The PDP-11 is a specific model of computer

>you just devolve into your usual tranny rage. You seem like you used to be smart, it's sad what those chemicals did to your brain.
That's all projection like you C shills always do. There was no rage at all in that post, just facts that are uncomfortable for you. The rage you feel is your own. Computer """science""" is based too much on what is popular instead of what we have discovered and know how to do like real sciences. It wasn't always like that. Designing hardware, programming languages, and operating systems used to be a big part of computer science. Now it's how to use C or how to use Google.
Replies: >>105872107 >>105872149
Anonymous
7/11/2025, 7:30:19 PM No.105872076
>>105870466
t. visajeet
Anonymous
7/11/2025, 7:32:34 PM No.105872097
>>105871771
>the only abstractions C has are function calls and loops, they map to the instruction set in the same way you'd write them in assembly
And operators, types, structs, variables, expressions, assignments, etc. All of those are abstractions. In C, they're leakier and weaker than most languages, but they're still abstractions, except C programmers are not aware of that.
Replies: >>105872149
Anonymous
7/11/2025, 7:33:44 PM No.105872107
>>105872073
You're the only "person" talking about PDP-11s, troon. And the pure seethe from your words wafts from the screen. I don't think you even know why you seethe so hard. Maybe you're an experimental SeetheAI for next-next-generation 4chan warfare.
Anonymous
7/11/2025, 7:38:21 PM No.105872149
>>105872097
>>105872073
You guys aren't understanding this. The "C abstract machine" is what the ISO/IEC standard targets, and "implementers" map this abstract machine to real machines, with variable "quality of implementation" which loosely translates to efficiency/execution speed/code size or whatever attribute of code generation required by users of said implementation.

You guys keep listing C abstractions, that was never the point.
Replies: >>105872922
Anonymous
7/11/2025, 7:38:55 PM No.105872156
der_it_is
der_it_is
md5: daa160a226e447d82a7932f4483beaad🔍
>>105870428 (OP)
Do you fully understand monads.
Replies: >>105872168
Anonymous
7/11/2025, 7:40:47 PM No.105872168
IMG_0116
IMG_0116
md5: 5d2612d39184f7f20ac1336d80ce93a2🔍
>>105872156
oblig
Replies: >>105873715 >>105876516
Anonymous
7/11/2025, 8:12:12 PM No.105872477
>>105871379
Yea, I know how CPUs work, I designed simple ones in GHDL/VHDL and some games. I just never had to do anything related to modern MMU.
Anonymous
7/11/2025, 8:18:14 PM No.105872530
can anyone explain the "C abstract machine"?
Replies: >>105873619 >>105875764
Anonymous
7/11/2025, 8:59:11 PM No.105872922
>>105872149
>>the only abstractions C has are function calls and loops,
>You guys keep listing C abstractions, that was never the point.
Pick one, Ctranny.
Anonymous
7/11/2025, 10:01:57 PM No.105873548
>>105871159
sounds like bad code smell, do better and you won't have to use pointers cnile :^)
Anonymous
7/11/2025, 10:08:27 PM No.105873619
>>105872530
academic nonsense
Anonymous
7/11/2025, 10:14:50 PM No.105873691
You aren't a real programmer if you don't understand virtual memory
#include <iostream>

int main()
{
int val = 0;
*((int*)(((int64_t)&val) | (1 << 53))) = 12345;
std::cout << val;
}
Replies: >>105873720 >>105873761 >>105876628
Anonymous
7/11/2025, 10:17:33 PM No.105873715
>>105872168
Thank you for posting the muse. Never not funny.
Anonymous
7/11/2025, 10:18:06 PM No.105873720
>>105873691
C/C++ brain damage has nothing to do with virtual memory.
Replies: >>105873735
Anonymous
7/11/2025, 10:19:28 PM No.105873735
>>105873720
Two different addresses lead to the same location. That's virtual memory.
Replies: >>105873846
Anonymous
7/11/2025, 10:22:17 PM No.105873761
>>105873691
>int64_t
>not uintptr_t
Nocoder detected
Replies: >>105873815
Anonymous
7/11/2025, 10:26:42 PM No.105873815
>>105873761
>posts code(good or bad)
>nocoder
I bet you have a ``diagnosis''. Am I correct?
Replies: >>105873872
Anonymous
7/11/2025, 10:30:19 PM No.105873846
>>105873735
Addresses wrapping around have nothing to do with virtual memory. Computers with no virtual memory can have that, and it's sometimes used for memory tagging in languages like Lisp because it means they don't have to remove the tag because the hardware just ignores it. Virtual memory is when you can use space on a secondary storage device (like a disk or flash drive) as if it was memory. The computer handles moving data between the RAM and the device. Mezzano uses virtual memory the right way because all the valid data in the whole partition has a memory address. Instead of files, you just use paging.
Replies: >>105875454
Anonymous
7/11/2025, 10:31:00 PM No.105873853
Anime is for trannies
Anime is for trannies
md5: 46972750cf75918f4fa04120c9551f1c🔍
>>105870466
Anonymous
7/11/2025, 10:31:31 PM No.105873861
>>105870428 (OP)
They literally store a variable with a * as decorator to retrieve it, not different from doing arr[2] which is in fact the same as *(arr+2). You're most likely a newfag nigger in programming
Replies: >>105874697
Anonymous
7/11/2025, 10:32:44 PM No.105873872
>>105873815
Anyone can generate some code nowadays. But not everyone can understand what is wrong with it.
Replies: >>105875506
Anonymous
7/11/2025, 11:50:03 PM No.105874697
>>105873861
>They literally store a variable with a * as decorator to retrieve it, not different from doing arr[2] which is in fact the same as *(arr+2).
C enshittified your brain. Pointers are not arrays. Pointers have nothing to do with *.
Replies: >>105875376
Anonymous
7/12/2025, 1:02:15 AM No.105875376
>>105874697
guess you felt attacked as the newbie programmer retard you are, the difference doesn't fucking matter. you can tell some fag is coming straight out of college or in college or underage by these retarded discussions
Anonymous
7/12/2025, 1:13:16 AM No.105875454
>>105873846
>Virtual memory is when you can use space on a secondary storage device (like a disk or flash drive) as if it was memory
No, you're using virtual memory even when you have no swap.
https://youtu.be/dFIqNZ8VbRY
Anonymous
7/12/2025, 1:20:26 AM No.105875506
>>105873872
>Anyone can generate some code nowadays.
>But not everyone can understand what is wrong with it.
No, if anyone can generate code, then anyone can understand what is wrong it. I am guessing low functioning aspie with a bit of retardation and adhd.
Replies: >>105875517
Anonymous
7/12/2025, 1:22:04 AM No.105875517
>>105875506
>No, if anyone can generate code, then anyone can understand what is wrong it.
Lol. Have you even heard of LLMs?
Anonymous
7/12/2025, 1:58:24 AM No.105875764
>>105872530
A flimsy justification for undefined behavior.
>Your operation's result is not defined in our abstract machine, therefore we can delete your code.
Anonymous
7/12/2025, 2:55:37 AM No.105876176
>>105870428 (OP)
This is the worst image that i have ever seen which tries to explain ptrs
Anonymous
7/12/2025, 3:04:43 AM No.105876258
>>105871188
The concept itself is simple but C made the syntax horrible and unsafe. The asterisks back and front that can be double and this shit & I forgot the name aren't exactly easy to remember for newbies. At the time it was done that way because computers weren't fast do the syntax had to be closer to machine code. It's the same reason we use ; instead of nothing and why some compilers force you to have a newline at the end, because it's easier for the computer.
Replies: >>105876529 >>105876993 >>105879387
Anonymous
7/12/2025, 3:39:23 AM No.105876516
1724527485182120
1724527485182120
md5: 6374c5ad239516f2e9edad44ec9d3557🔍
>>105872168
Anonymous
7/12/2025, 3:41:27 AM No.105876529
1709895728808362m
1709895728808362m
md5: d1889195be203d9333340cd90f6c4831🔍
>>105876258
im sorry you were filtered by C.
take another code camp, you'll get there.
Replies: >>105879387
Anonymous
7/12/2025, 3:54:16 AM No.105876628
>>105873691
Use case?
Anonymous
7/12/2025, 4:53:29 AM No.105876993
>>105876258
>At the time it was done that way because computers weren't fast do the syntax had to be closer to machine code.
No it's not. C syntax has nothing to do with machine code. C is dumbing you down even now.
>It's the same reason we use ; instead of nothing and why some compilers force you to have a newline at the end, because it's easier for the computer.
That's actually a feature. FORTRAN and BASIC had one statement per line with a continuation character. ALGOL had ; because it lets you have multiple statements on one line and statements that span multiple lines more easily.
Replies: >>105879567
Anonymous
7/12/2025, 6:15:49 AM No.105877474
>>105871000
exactly like why zoomers don't know what a directory is
Anonymous
7/12/2025, 6:43:00 AM No.105877610
>>105870466
>I win because I said cnile
Replies: >>105878203
Anonymous
7/12/2025, 8:22:23 AM No.105878203
1730385920610750
1730385920610750
md5: a523f7f023515add76c716e17012e09c🔍
>>105877610
this is what happens to your brain when you cut your dick off
Anonymous
7/12/2025, 11:24:51 AM No.105879268
>>105870466
rust haven't superseded shit, delusional tranny
Anonymous
7/12/2025, 11:40:21 AM No.105879365
I wish I could be smug and say "who doesn't understand pointers?" but some anons make me wonder..
Anonymous
7/12/2025, 11:45:31 AM No.105879387
>>105870493
>>105871188
>>105876258
>>105876529
The thing that C makes nonintuitive is the storage of the type in the pointer itself, e.g. the fat that you can have an int*, char*, and all these different types of pointers, rather than just having one pointer type.
It would be better if every pointer acted the way a void* does. If you only specified type when dereferencing, it would make it much clearer that a pointer is just an address, which might point to meaningful data.
>b-but that's unsafe
Pointers are inherently unsafe, there's a way to have strict type safety, it's called not using pointers. The only time you should ever be passing something by reference instead of value is when it's a data structure, in which case the behavior needs to be encapsulated in syntax that doesn't allow manually dereferencing.
The different types of pointers are not only needlessly complicated but an illusion of safety. You have no idea if it's safe to cast something at the address to that specific type. Basically any time you get the pointer of a variable (like with &) you should be bypassing type checking entirely and the language should support it as just raw dogging memory.
Replies: >>105879434 >>105879589 >>105879611
Anonymous
7/12/2025, 11:55:54 AM No.105879434
>>105879387
>pointers are unsafe
go away
Replies: >>105879443
Anonymous
7/12/2025, 11:57:28 AM No.105879443
>>105879434
They are, and having types attached to them like long long dong* doesn't make them safe
Anonymous
7/12/2025, 12:22:39 PM No.105879567
>>105876993
> Does not know how compiler history
It's designed that way to make compiler's job easier.

> That's actually a feature.
No it's not. It's also because it was easier for compilers to know when a statement ended.
Anonymous
7/12/2025, 12:26:24 PM No.105879589
>>105879387
> Have no type in pointer would make it more intuitive
That would be a solution yes.

> Pointers are inherently unsafe.
They are but they could have some sort of protection when developers fuck up. Today that would be possible.
Anonymous
7/12/2025, 12:27:05 PM No.105879595
>>105870428 (OP)
I never understood what people find hard about them. this should be an obvious concept for anyone with >85IQ.
Replies: >>105879624 >>105879889
Anonymous
7/12/2025, 12:30:07 PM No.105879611
>>105879387
>, and all these different types of pointers, rather than just having one pointer type.
because having one pointer type to fit all would be insane bloat. fuck off, tranny.
Replies: >>105880539
Anonymous
7/12/2025, 12:32:13 PM No.105879624
>>105879595
it filters people new to programming that don't know shit and can't read manuals. if you had programmed in assembly languages before you can instantly understand the idea behind pointers and how they're used. baby level knowledge.
Anonymous
7/12/2025, 1:12:36 PM No.105879889
>>105879595
Some people are simply incapable of understanding fundamental programming concepts.
I couldn't find the source but I remember there being an old study or publiction or something that showed that in any given programming class, there will almost always be a subset of students who won't ever be able to form the mental model required for understanding what a basic snippet of code does and will struggle even with things like reassigning variables and intuit their values between each statement.
Explaining concepts like pointers or recursion to those kinds of people would be impossible.
Anonymous
7/12/2025, 2:04:26 PM No.105880244
>>105870428 (OP)
First time I read about them I had a hard time understanding them because there was no mention of WHY you wanted to use them. It seemed really pointless (heh) to me (I was quite young at the time)
So I blame the learning materials
Replies: >>105880362
Anonymous
7/12/2025, 2:21:32 PM No.105880362
>>105880244
this is a good point (heh). I guess rationale for their existence wouldn't be obvious to a beginner.
Anonymous
7/12/2025, 2:45:35 PM No.105880539
>>105879611
>bloat is when there's fewer features
Replies: >>105880815
Anonymous
7/12/2025, 3:15:10 PM No.105880815
>>105880539
> not coping
sad