Thread #108582544
File: Dpt - April 2026 - Colorized.jpg (403.6 KB)
403.6 KB JPG
What are you maids working on?
Last one: >>108561805
325 RepliesView Thread
>>
>>108582544
>>108561805 (OP)
Next thread:
>>108582544
>>108582544
>>108582544
>>
>>
>>
File: 78A7BF30-FCB7-446B-8840-5E5539C7B1ED.jpg (1.3 MB)
1.3 MB JPG
>>108582544
You should all learn to vibecode
>>
>>
making another library/manga downloader like everyone else except it supports plugins
kinda complex on the design part to get it right. and I still don't know if it is
Also I added in api too so you can easily intergrate it with whatever
>>
>>
File: 1603861915977.jpg (10.6 KB)
10.6 KB JPG
>>108582475
This code compiles, but gives the following warning:test.c: In function ‘f’:
test.c:4:26: warning: ‘sizeof’ on array function parameter ‘a’ will return size of ‘int *’ [-Wsizeof-array-argument]
4 | size_t s = sizeof(a);
| ^
test.c:3:12: note: declared here
3 | void f(int a[], char *id) {
| ~~~~^~~
And when I try to run it I get a segmentation fault.
I don't understand what are you trying to accomplish, you're declaring a variable s in f, but this variable is popped from the stack when the function exits so f(arr1, "arr1") should do nothing, and p() is trying to print the uninitialized pointer *id, so it gets a segfault because it's trying to access a pointer with a garbage address that probably points outside the program.
>>108582516
So what is best practice? For example, If I have a string, should I declare it as a pointer or an array?char s[] = "Hello World";
char* s = "Hello World";
Is there any practical difference?
>>
File: 1750897030742208.png (109.5 KB)
109.5 KB PNG
>>108582829
also do the icons look ok? I'm actually using drawn SVG paths and not images, thinking they don't look as sharp and have a thick look
>>
>>
>>
>>
>>108582764
I use it regularly for fitting tasks, for example rewriting this:
```rust
mod get_entity_mesh_data;
mod get_entity_mesh;
mod get_entity_aabb;
mod get_entity_material;
mod get_entity_name;
mod children_query_ext;
pub use get_entity_mesh_data::*;
pub use get_entity_mesh::*;
pub use get_entity_aabb::*;
pub use get_entity_material::*;
pub use get_entity_name::*;
pub use children_query_ext::*;
```
into this:
```rust
mod get_entity_mesh_data;
pub use get_entity_mesh_data::*;
mod get_entity_mesh;
pub use get_entity_mesh::*;
mod get_entity_aabb;
pub use get_entity_aabb::*;
mod get_entity_material;
pub use get_entity_material::*;
mod get_entity_name;
pub use get_entity_name::*;
mod children_query_ext;
pub use children_query_ext::*;
```
>>
>>
>>108582836
> char s[] = "Hello World";
> char* s = "Hello World";
Those are actually the same, they're both pointers to string in static memory.
Just remember that arrays with fixed length are special.
Neither of those is array with fixed length.
>>
>>
>>108582836
C does not have arrays at runtime. Arrays in C are purely a compile-time thing and, when you understand this, you'll see through the stupid nonsense of "C arrays" and "C strings". Neither such things exist after compile time in the language's semantics.
Stop thinking about the "decay" nonsense because it provides a strictly incorrect framework. Think of arrays and strings in C as a compile-time convention to provide the compiler information as to how to memory should be laid out. Once compiled, they *do not exist*. You only have pointers to that memory which the compiler laid out.
>>
File: Heart hands.gif (795.6 KB)
795.6 KB GIF
>>108582750
>>
>>108582832
That's correct.
AI can be helpful in certain areas. Relying on it is stupid. Fighting against it is stupid too, because it's getting pushed to hard by THEM anyways.
So yeah, AI is okay-ish. Vibing is retard brainlet shit
>>
File: 1775461997322061.png (275.7 KB)
275.7 KB PNG
>luddite
>>
>>
>>
File: 1775821479503769.jpg (375 KB)
375 KB JPG
>>108582475
>>108582836
Some static checking of array parameters is possible by adding the sizevoid f(int x[4])
{
return;
}
int x[] = {1, 2, 3};
f(x);warning: ‘f’ accessing 16 bytes in a region of size 12
7 | f(x);
| ^~~~
note: referencing argument 1 of type ‘int[4]’
note: in a call to function ‘f’
1 | void f(int x[4])
| ^
>>
>>
>>
>>
>>
File: screencapture-deepseek.png (67.7 KB)
67.7 KB PNG
>>108583691
>>
>>
>>108583691
If you're asking why C doesn't store array size along with the pointer, it's because it evolved from B where everything was an integer and a pointer was just an integer that stored an address.sizeofis a compile-time macro, so it only gives you the array size when the compiler can resolve the array size..
>>
>>108583015
>>108582958
That's wrong. "char s[]" is an array. You can try it yourself. do "s[0] = 'b';" on both. with "char s[]" it will work, but for "char *s" it will crash the program because you try to write to read-only memory region.
>>
>>
>>
>>
>>
>>108584408
Wait until you discover that in some languages static type information can be used to choose diffent code paths, and types combined together like legos can be used as codegeneration spec.
> C++, Rust, Haskell
>>
File: pepe-der-frosch.jpg (97.5 KB)
97.5 KB JPG
Hmm, every time I want to start this project, I get some pace for half a day and then I realize how much that actually is.
So the question is: Should I really go down the fucking path building an entirely self-hosted computer running on a risc-v cpu with an FPGA?
Or should I just make a fun OS, written in C/Cpp and just have fun?
But self hosting would be good. I have never done self-hosting. But damn it's gonna be tuff
what do?
>>
>>
>>108583075
I think this explains a lot for me, thanks.
>>108583015
I tested, there is no difference, it's 12 in both cases#include <stdio.h>
int main() {
char s1[] = "Hello world";
char s2[12] = "Hello world";
char* s3 = "Hello world";
printf("%d\n", sizeof(s1)); // prints 12
printf("%d\n", sizeof(s2)); // prints 12
printf("%d\n", sizeof(s3)); // prints 8
return 0;
}
So >>108582958 is wrong, they are at least treated differently by sizeof.
>>108583260
Okay that is cool, thanks for this tip.
However, I still don't get what >>108582475's original intention was because his code segfaults, did he miss a static keyword somewhere?
>>
>>108584934
I meant to reply to >>108583193 instead of 108582958, and I meant to say that s1 and s2 are treated the same, but s1 and s2 are treated differently by sizeof
>>
File: pepe-hat-einen-plan.png (550 KB)
550 KB PNG
>>108584661
Ok I got a plan to keep the motivation up. I don't have to go too hard on myself.
> Write more peripherals for the FPGA first (VGA, PS/2 (i should have them already working. just need to connect them to the new soc), possibly sdcard or spi flash for permanent storage)
> Test peripherals with normal C
> Write basic OS in assembler with gcc, such that it hopefully should be """easy""" to port it to a self-made assembler
lets see how far i get... Lets get le epic screen up and running
>>
>>
>>
File: PXL_20260411_214224875.jpg (2.4 MB)
2.4 MB JPG
>>108585103
good. VGA is working.
Still got some issues with my PSRAM. I think the byte and half word access don't work as intended, but i have to pee really hard rn. Lets make coffee
>>
>>
>>
>>108585610
>https://en.wikipedia.org/wiki/Perl?useskin=monobook#Perl_6_and_Raku
Oh that's actually pretty cool and I can see why it might be better than standard perl.
>>
>>
>>108585665
I don't know.
I just like the mascot. I wanted to try it once and their webpage says it has super cool features.
I remember especially a lot of shit you could theoretically use to build parsers super easy. Can't find the examples that I once saw, but something like this:
https://docs.raku.org/language/mop#parametric
Tho, I had no good excuse to learn it too and it looks so much different than other languages, that i just didn't make it in the end (tfw gotta listen to memekin park now)
>>
>>108582836
>>108582958
Ok, after watching this I finally understand the difference between arrays and pointers
https://www.youtube.com/watch?v=H18yIPSsgLg
tl;dr an array is the address itself, not a pointer to the address
>>
File: 1711070011774.jpg (1.8 MB)
1.8 MB JPG
>>108585697
This is a maidposting site and everyone in this thread is a cute maid with huge boobs, just like you.
>>
>>
>>
>>
>>
>>
>>
>>108585987
I didn't watch the second half but he is obviously not thinking about technical differences since after "an array is not a pointer" he has now said "an array is an address", which arguably is LESS true (e.g. if an address isn't a pointer and is literally just an address, then an address presumably doesn't have size or type information) and he obviously isn't talking in a "these are different language constructs even if one decays to a pointer and is used extremely similarly" kind of way
he is unaware of const pointers
he then goes into some insane strawman about the address of the array, as if anyone likening arrays to pointers has ever suggested that it pointed to anything other than element 0
>>
>>
>>108585798
yes. Here: https://godbolt.org/z/Pz5ab38of
>>
>>
>>
File: 1772445520283947.png (104.4 KB)
104.4 KB PNG
today's leetcode problem is another dynamic programming hard
>>
File: mctools.png (79.9 KB)
79.9 KB PNG
Two small programs, one that will fully erase the memory card in slot 2, the other that will dump the entire contents into memory (which can be dumped across ps2client) and should then be able to be loaded as a memory card in PCSX2.
>>
>>
>>
when unit testing, if I need to create files, where am I supposed to place them? I was hoping I would have the option to create a synthetic file system that only exists within my program, but doesn't look like that's an option
>>
>>
>>
>>108586563
C++
no, the files are not a function of the test itself, just things that are expected to exist in the real environment which don't exist in the testing environment / if I try to use the real one in the testing environment I can't test effectively (sysfs files, input event files, etc)
>>
>>108586539
if the real code is supposed to create files in some fixed path within the application folder, your unit tests should also have a base application folder with the same structure as the real application, and create temporary files at same subpaths as the real code
if the application writes to completely arbitrary paths then just make a common folder for unit tests, wherever
>>
File: 1757950917560189.png (206 KB)
206 KB PNG
>>108586216
YOOOOOOOO
>>
>>
>>
>>
>>
>>
>>
>>
>>
File: 1504879690673.jpg (8.9 KB)
8.9 KB JPG
why are so many of the rust maintainers into touhou and are also women
>>
>>
>>108585798
> tl;dr an array is the address itself, not a pointer to the address
Nah, pointer and address are the same thing. So when you're saying pointer to the address, it's the same as pointer to pointer, which isn't the case here. Because in case of pointer here, it's pointer to the first element of array. No double pointers. Also print sizeof of char[] and char[10], when they are function parameters instead of local variables.
>>
>>
>>
File: 1751930001455403.png (92.4 KB)
92.4 KB PNG
chat is it really that simple? did they have it figured out in 1995?
>>
>>
>>
File: leet1320.png (588.6 KB)
588.6 KB PNG
>>108586216
I liked this one! for /dpt/ maids I highly recommend the maidreamin maid cafe! they were super cure and they nyan!
>>
>>
File: MaidcafeexperienceMaidreamin(Hokkaido).jpg (89.2 KB)
89.2 KB JPG
>>108587676
nah its just a regular cafe chain with cute girls dressed as maids that say nyan. you might be projecting.
>>
>>
>>
>>
>Rarely would a builder think about adding a new sub-basement to an existing 100-story building. Doing that would be very costly and would undoubtedly invite failure. Amazingly, users of software systems rarely think twice about asking for equivalent changes.
>>
File: 19-2519.png (552.6 KB)
552.6 KB PNG
>>108587805
>Did you seriously mistake Mayuri for Lukako? You should probably kill yourself.
based okabe-san poster
>>
>>
>>
>>
File: 1758629045900882.png (310.8 KB)
310.8 KB PNG
>Specifically, programming without inheritance is distinctly not object-oriented; that would merely be programming with abstract data types.
I was secretly a procedural programmer all along
>>
I dislike how in C/C++, the standard convention that I see most people use when declaring pointers is to do:
>int *p;
instead of
>int* p;
You're declaring a variable that has the type "integer pointer". Why would you put the separator (space) between the two different parts of the type definition and then have no space between the name and part of the type definition?
At a first glance, it looks like you're declaring an integer with the name "*p".
There's literally no reason to do this. It's objectively worse in every way. Why do people do it?
>>
>>
>>
>>
File: file.png (166.4 KB)
166.4 KB PNG
So basically corporate slopware jobs replaced real software engineers with low paid unskilled jeets and subsequently AI because corporate slopware became a solved problem that just required mindlessly filling in the blanks.
>>
>>
File: smallcock.jpg (34.9 KB)
34.9 KB JPG
Not long before AI people were hyped about the spaceship operator.
They said the spaceship operator will change everything. It will revolutionize coding.
Now what did it change? Nothing. Everything got worse. The spaceship operator started the downfall.
>>
>>108588648
don't matter. You just read it right to left and everything makes sense.
int *p - p is a pointer of int
int const * p - p is a pointer to a constant int
int * const p - p is a constant pointer to an int
int const * const p - p p is a constant pointer to a constant int
>>
>>
>>
>>108588765
The good thing is that AI can replace all the junior devs.
Now I don't have to bother teaching them pesky juniors anymore.
And when I go to pension there will be no more juniors that can move up to replace me. Based.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>108588987
>use INI configuration files
>they just work
>oh wait, we actually don't like the way they work
>use the registry instead
>which is such a gargantuan glumblefuck that even Microsoft doesn't know how to drive it properly (if the registry schizo is to be believed)
It's a miracle that company survived its first ten years.
>>
>>
>>
>>
>>108589120
actual coding is frustrating because shit goes wrong and half the time its not obvious whats happening so you have to spend time debugging to fix it and that's annoying
in your head everything works perfectly the first try
>>
>>
>>108589120
You are a normal human bean.
Fantasy is much more exciting than real life. But real life can be much more rewarding.
But you have to start and starting is always cringe unbased 0/10.
People don't want to do sports every day. God said sports are homo. Tackle a horse. Yet they still convince themselves that it's good and still do it.
Just do it (tm)
>>
>>
>>
>>
>>
>>
>>
>>
>>108584934
sorry anon, you are right. it does segfault indeed when compiled with gcc, it totally works no problem when compiled with tcc, which i have nasty habit to use via :!tcc -run % in my favorite editor(tm) when doing throw-away stuff. my point was to illustrate how stack doesn't clean stack frame data after popping previous frame. so you can pass data without explicitly stating in arguments of a function. sorry again for bad illustration.
>>
>>
>>
>>
File: 1773920918546349.png (571.6 KB)
571.6 KB PNG
>>108589655
Wait, you're telling me they have to specify both auto and the type now? What kind of cuckery is this?
>>
>>
>>108589882
https://en.cppreference.com/w/cpp/concepts/floating_point
koding with koncepts
>>
File: mv_sp.mp4 (3.2 MB)
3.2 MB MP4
>>108587669
These maids are very cute. Thank you for telling me about this cafe. I hope to go there some day.
>>
File: twitter_fail_whale1.png (52.2 KB)
52.2 KB PNG
>>108589278
man I really hope fucking docker dies out. it only exists because people were too retarded to do their own sys admin. now that we have ai maybe we can just go back to not being shit.
>>
>>
File: Gvf5vqDXAAAYgIV.jpg (159 KB)
159 KB JPG
>>108589655
>>108589882
>>108589921
> https://en.cppreference.com/w/cpp/concepts/floating_point
Oh wait, I finally realized what they did when I noticed both functions are called x2. So they overload it for all floating point types in first declaration and for all integral types in second one. This is actually based as fuck. It's quite hard to do the same in Haskell: it requires OverlappingInstances and problems don't end with that.
>>
>>
File: 1751303532925394.gif (19.8 KB)
19.8 KB GIF
Before I knew it, I had mastered C++ without having ever written a single line of code.
>>
>>
>>108590134
Ya they're super cute IRL and they came and asked what to draw on the omurice and they did the oishiku nare moe moe kyun thing and they say nyan a lot. as a casual anime enjoyer it was a 5/5 for me. I'm sure the other cafes are fun too. I definitely get the maid hype now haha!
>>
>>
>>
>>
>>
>>
File: 1765311372449972.webm (2.2 MB)
2.2 MB WEBM
>>108590564
You just described my Sega Genesis game before I gave up
>>
>>108590564
>>108590564
All of terry's code is position independent you little dumb fuck nigger.
Do you even know what a compiler is???
>>
>>
>>
>>
>>
>>
>>
>>108590761
brother, your goal is not to be mad at your lecturers. Your goal is to win the game (get a degree).
Why do people not understand it? No matter how shitty the game is, just play it the best you can. Stop complaining, retard
>>
>>
>>
>>108590876
That has nothing to do with your racism.
The problem is rather that people cannot get into their mind that you can give everyone equal opportunities while still keeping competition up and acknowledging that not everyone can make it.
Making everything easymode is just a stupid way to cope with this dilemma
>>
>>108590781
Fussing about style and code structure at such a small scale is a novice trap. It's just a nested loop, a conditional and a with statement.
Until you've written at least 10,000 lines of Python for solving real problems you shouldn't worry about this kind of thing.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>108590761
What are you taking? Also what country? I think utf8 and casefold is pretty rare in America. I think you can do it all inline basically if you want.def word_list(file):
return open(file).read().strip(string.punctuation).casefold().split()
>>
>>
>>108589647
>my point was to illustrate how stack doesn't clean stack frame data after popping previous frame
Is this something specific to TCC? I'm guessing GCC handles stack frames more cleanly and that's why it segfaults no?
>>
>>108593322
Dunno what tcc does, but gcc also doesn't segfault if you bother telling it to optimize your code. Because rather than loading whatever nonsense is on the stack:mov rax, QWORD PTR [rbp-8]
mov rsi, rax
it simply zeroes RSI (the second parameter register):xor esi, esi
And now that the string is NULL printf rather prints out "(null)". Why it bothers with the XOR? Beats me. UB is UB.
>>
>>
>>
>>
>>
>>108587176
https://www.youtube.com/watch?v=Be4bLNa15hk how long boat car could float in rain
>>
>>
>>
File: 0c59492ff1a924ce6b47ba1caba50748.jpg (2.2 MB)
2.2 MB JPG
>>108593809
Aristotle had the same problem categorizing zebra
>>
>>
>>
>>
>>
>>108594052
99.9% of them basically attend Java trade school. They aren't computer scientists or software engineers. They don't know any theory. They don't know any math. They can't write algorithms. But if you just need someone who can go down a list and call a bunch of functions they'll do it for pennies.
>>
>>
>>
File: 1751047646195077.jpg (120.9 KB)
120.9 KB JPG
>>108594493
>you shouldn't optimize your code to the max because then the optimizer won't be able to apply its half-assed "optimizations"
>>
File: brainjak.png (77.1 KB)
77.1 KB PNG
a car has a tire
the car owns its tire
a car has an owner
the car does not own its owner
>>
>>
File: constprop.png (10.9 KB)
10.9 KB PNG
>>108594728
Or constpropped functions.
>>
>>
>>
>>
>>
>>
>>
>>
>>
File: 1758953470263999.jpg (68.8 KB)
68.8 KB JPG
x86-64++
>>
>>
>>
>>
>>108593591
>>108593609
The CPU you braindead retards
>>
>>
>>
>>108593609
You mean a calling convention? The thing that is logically mandatory to support any high level programming language on any platform?
I swear you retards watch other retards on YT and then just regurgitate shit you don't even understand. No wonder you're terrified of AI replacing you.
>>
I don't know shit, but I'm trying to teach myself Rust.
I need other people to see this so I know I'm not just retarded or something.
I was using .connect() on a TcpStream, but I wanted to add a timeout check so it doesn't hang.
connect() let me just pass my two constants that are a &str for the url and u16 for port.
using .connect_timeout() I have to do this:
.to_socket_addrs() on the tuple, get a result
unwrap result, get a iterator
iterate over the iterator, get a option
unwrap the option from the iterator, get a result
finally unwrap the result to assign it to a variable.
there has to be a better way to do this, I have to be retarded. Please tell me this isn't the proper way, because it seems insane to me to have to do all that.
>>
File: 1762513919658965.gif (3.6 MB)
3.6 MB GIF
>>108595792
>trying to learn rust by making a network application
>>
>>
>>
>>
>>
>>
File: 1772793643145099.jpg (103.7 KB)
103.7 KB JPG
If they really wanted me to use C++ modules then the entire Windows SDK would be available in module form.
>>
>>
>>108595922
that would require microsoft creating and maintaining an entirely separate c++ implementation of all those libraries since they can't just deprecate the c versions that every other language relies on for interop
>>
File: 1749838314128883.jpg (12.8 KB)
12.8 KB JPG
>>108595935
If Copilot is so amazing that you should pay for it then surely it could handle such a trivial task on its own?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
File: 1757550318794504.png (16.3 KB)
16.3 KB PNG
>>
>>108596481
teaching abstraction in programming using non-programming examples has been a disaster for teaching object orientation
any tutorial or learning material that does the Dog extends Animal example should be immediately abandoned
>>
>>
File: 1772854286566600.png (92.5 KB)
92.5 KB PNG
>>108596500
>If man is actually a Man object and you force it into a Female, that’s undefined behavior.
>>
>>
File: shizu think.png (184.2 KB)
184.2 KB PNG
>>108582544
anyone use flutter?? i want to get rid of all the themeing stuff in my app at work because it was bloat when i started working here and now its even more bloat but i was looking at moving to flutters theme data stuff and it just seems ass. especially for text you define a few font styles like header body etc then it magically pulls colours out of its ass or something. it doesnt seem like a nice system.
currently all theming is handled by a static class and i do like appadding.val, appcolors.val which works well but the ux guy creates too many colours and styles etc i jsut dont know how to make this neat, especially when hes talking about introducing a light mode. when i did theming in a personal app recently i did it all using custom classes + state management but chatgpt says this is a bad idea even though i think its better than the built in stuff
https://github.com/NO-ob/classiclauncher/tree/master/lib/models/theme
>>
>>
>>
>>
>decide to clean up codebase
>look at all types I declared myself to check if I can't use standard headers and definitions for internal Windows types and structures
>e.g. search for REALIZATION_INFO
>is being used twice in ntgdi.h, in declarations for NtGdiGetRealizationInfo
>the header doesn't include or declare the types it needs, including REALIZATION_INFO and ARCTYPE (e.g. for NtGdiArcInternal)
>which, according to ReactOS's source code, is some enum that the provider of these headers never seems to have heard about
>suddenly remember why I provided my own types
>>
File: 1745988522226438.jpg (26.7 KB)
26.7 KB JPG
>Rust deliberately does not have a goto statement.
toylang
>>
File: 1753145464490763.png (123.4 KB)
123.4 KB PNG
I did it
I watched every programming tutorial on youtube
>>
>>108597652
>I did it
>I watched every programming tutorial on youtube
do you have any recommendations? I haven't found anyone enjoyable to watch and when I do its usually like super basic comp 101 stuff. pretty much sicp is the only good tutorial.
>>
>>
>>108597693
>do you have any recommendations?
https://youtu.be/m_Dp4nMr_AY
>>
>>108597771
nta but there's something about fucking heaps that's unlearnable to me. no matter how many fucking times I watch the little how to implement a heap video I can't remember how to when I sit down to code it. also its just in most standard libs so there's really no reason... but the concept is so easy I feel like I should be able to. practice really is the only way :(
>>
>>108597801
Well, I can't tell you much about it either and I don't really care that much.
I have never implemented a heap sort or anything like that.
I have never implemented a malloc.
I don't care. If I need that, then I will look it up. I know what a heap in theory is and that's about all I need at this point in time.
For me it's not about actually learning and remembering stuff. It's about knowing what's available, having heard all of the terms at least once and roughly know what they mean and being able to look it up fast.
The memory will come by itself when you use shit regularly
>>
File: aliens-on-mars-attacks-1gqw8bmplm8ela9g.gif (1.4 MB)
1.4 MB GIF
>>108597791
>>do you have any recommendations?
kek this is somehow way worse than a rick roll. its crazy there's billions of people who speak a language somehow WORSE and MORE annoying than the mars attacks aliens.
>>
>>
File: 1764958780643763.png (17.4 KB)
17.4 KB PNG
chat, are unions esoteric?
>>
>>
>>
>>
>>108597931
>>108598063
You have to use std::union and std::volatile now
>>
>>
>>
File: file.png (18.1 KB)
18.1 KB PNG
>>108595922
they started once but then they gave up
>>
>>
>>
>>
File: 1775136101813791.jpg (67.7 KB)
67.7 KB JPG
>>108598502
cool story goldberg, now get back in there and die so the US can get that oil
oh, and don't forget to pay your toll fee for using the strait of Trump
>>
>>
>>108598170
Text I am okay with but emulating typewriters less so.
I use columns in my editor to cope with the lack of respect for modern horizontal screens that is otherwise just wasted since text lines flow vertically.
We're not utilizing the full range of the monitor to our benefit, but I think simple spatial associations could help with this, like you see in note taking applications and shit like that.
Even basic things like images within the source code like Terry's editor has, has taken a long time of fucking around with old ass terminal extension standards to hack in support, meanwhile we can't even have variable width fonts in most terminal editors that also render dogshit slow.
What I'm saying is multiple aspects and layers of development tools being stagnant or lackluster - frustrate me too.
>>
>>
>>
>>
>>108595052
Not quite. They invented it because C++ was bad. I think it was Rob or Ken that said they did development of Go (both the meetings and implementation) during the times it took for C++ projects to build. This is not a joke or hyperbole, they actually used the hours of waiting for builds to do this because all the waiting was a waste of time.
Go was popular within Google because it was simple and easy and this extended into the public release.
It's always extremely strange when people talk about this. No aspect of it makes sense.
You have the people complaining that Go is too easy, as if tools should be hard.
Then they attack the users, as if the authors and users did not invent C and Unix. Not that you should appeal like that, but if you're making that argument clearly prestige matters to you, but these guys are well respected veterans of the field, not unknown inexperienced amateurs.
If juniors can use this tool to great effect why wouldn't a senior be able to, the principles of the tools and language are merits to both sides of the gradient.
It always seems like people are unironically arguing that C++ is supposed to be better because it's more complex, more difficult to utilize (while also impossible to master), harder to be cohesive across standards and team boundaries, tooling that gets the funding and attention from the world while still being beat by Literally Who's hobby project, and so on and so on.
I'm borderline convinced that the people arguing that programming should be harder instead of easier, that tools should be more complex instead of simpler, are people that don't actually write many programs that matter to many people. Probably just salaried devs doing no-nothing work for decades that dies with their company, not ambitious novel software that the public ends up using at scale.
>>
File: 1756773039445848.gif (1.6 MB)
1.6 MB GIF
>>108597340
>Work for multimillion dollar company
>CTO pushes LINQ queries heavily, first thing new hires are screened for.
>Work on speeding up some slow processes in the codebase.
>Culprit is nested .Where() LINQ queries doing linear searches over million+ sorted item collections
>Ctrl+F ".Where("
>343 results
>Ctrl+F ".BinarySearch("
>0 results
>>
>>
>>
>>
>>
>>108596385
>>108593591
Cdecl and fastcall both work on Windows. Fastcall uses registers for the first few parameters instead of sticking them on the stack. This worked fine as early as Watcom in MSDOS.
>>
>>
>>
>>
File: confusedbird.png (3.4 KB)
3.4 KB PNG
>>108582544
I want to make an expense tracking/budgeting app for my own personal uses. I'm imagining a desktop application, with potentially a mobile app later on for scanning receipts. I've only ever done Web Dev and that was like 10 years ago, so I have no idea what I'm supposed to use for this sort of thing. I'm developing on Ubuntu, but I'd like to be able to build to cross-platform. I'd also like it if whatever technologies I'll use are actually used in the real world, so I can get some valuable experience on the off chance I plan on including this project as a resume piece (I don't really plan on going into this industry, but it's just a nice bonus). I've seen all sort of odd sounding technologies, I really have no idea which one I should use. I assume /g/ can set me straight on what's worthwhile out there right now.
>>
>>108598904
>Cdecl and fastcall both work on Windows
Did you just wake up from a coma, boomer? https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions?v iew=msvc-170
>>108598998
Enjoy your energy crunch then. The Strait will NEVER open again.
>>
>>
>>
>>
>>108598680
Go follows a different design philosophy to keep the language small and simple. That is why it doesn't support stuff like operator and function overload. C++ follows a different view, where freedom is more important than keeping the language small and simple.
If you believe C++ is bad is because you have a skill issue.
Simple as.
>>
>>
>>108599628
>If you believe C++ is bad is because you have a skill issue.
>Simple as.
You bested yourself. Saying that C++ requires skill to use effectively is a demerit against it.
Somewhat ironic too since simplicity doesn't have such issues in the hand of a skilled person.
>>
>>108599628
>If you believe C++ is bad is because you have a skill issue.
Nah, it's garbage just on a code-generation basis - which is ignoring its libraries. Which, if we don't, turns it into absolute-clusterfuck territory.
>>
File: dbsgm.jpg (68.4 KB)
68.4 KB JPG
>>108598513
Nice cope.
Trump is going to force a world war to keep his ass in power and away from prison where it belongs. He already has a private army loyal to him that will take citizens from the streets and drop them in the front lines. It worked in Ukraine, it will work in the US.
>>
File: urw.gif (443.4 KB)
443.4 KB GIF
>>108599641
>>108599651
Non coders' opinions discarded.
>>
>>
>>
>>
File: 1773440660530647.png (346.3 KB)
346.3 KB PNG
>>108582544
how do you become an employable DEVELOPER?
I'm tired of these stupid faggot tutorials and guides and books when in reality I still can't even make my way around a codebase
all tutorials teach gay syntax which no one gives a fuck about and especially no stupid HR roastie or a teamlead who needs someone to write code for his shit
really seems like another catch 22
>>
>>
>>108599868
You really just have to work on a big project to get used to the abstractions and design patterns. Enterprise codebases are on a totally different level than some fizzbuzzer named Chubek writing 200-line C files.
>>
>>
>>108599470
It helps if you've done some tracking of that sort of thing on paper. Knowing The Domain turns out to be real useful for doing apps.
You need an abstract model of what information you are working with. It might be trivial, or it might not be. Depends how complicated you want to go. The model doesn't say how the data is formatted; it just says what sort of information is in there.
You then figure out how to store an implementation of that model in a database. Databases are good at that. (For personal use, SQLite's pretty great.)
Then, you just need to write basic things for putting data into the DB and getting it out. Think "fill in a small form" for putting things in, and "get a table of some sort" for getting things out. Can be GUI. Can be web. Can be command line. For fancy-pants stuff, do all three; you have a common data model, so you can think about working that way.
>>
>>
>>
>>108599868
>all tutorials teach gay syntax which no one gives a fuck about
In my honest opinion you can't learn to program by force.
You have to want to write software first and then learn how to do that.
I mean you have to want a specific piece of software to come into existence and then you need to learn how to make it.
You can not do this in reverse order. You don't learn how to paint and then create a masterpiece, you want to create a masterpiece and you learn how to paint.
Nobody can teach you how to create something of value conceptually, they can only tutorialize you on how to implement fundamentals close enough to what you need to know for you to extrapolate.
That said none of this matters in regards to employment. Most programmers, just like with most employees in all fields, are terrible at their job if they even work at all.
And being a good programmer doesn't really help you get employed as a programmer most of the time. But I don't think it hurts to be good at the thing you're trying to get a job for, and in this case I think to get good you need to have real passion from yourself not just lessons from others.
>>
>>
>>
>>108582836
>So what is best practice?
in terms of type alone, the pointer version
when you need read-only strings, the pointer version
if you need to allocate on the stack or have read-write permissions, the array version (you do what you have to do), and you cast it to a pointer type when passing to a function that uses it
char s[] = "Hello World"; will allocate the string on stack and write it at runtime if s is a local variable, if it's a global variable it will be stored at compile time in a read-write .data section. For char *s = "Hello World"; the data will be put in .rodata, a read-only section. The stack has read-write permissions so you can overwrite it without segfaulting. Segfault or not and read-write permissions have nothing to do with array vs pointer.
>>
>>108600077
>char s[] = "Hello World"; will allocate the string on stack and write it at runtime if s is a local variable, if it's a global variable it will be stored at compile time in a read-write .data section. For char *s = "Hello World"; the data will be put in .rodata, a read-only section.
Oooooooh so you're telling me the array version is writable but the pointer version is read-only? I thought string literals were always read-only and used to do stupid things like duplicating a string to make it writable or initializing each character manually, I didn't know I could just use the char s[], well I guess I learned something useful, thanks.
>>
what the fuck is that?void func() { char *array_of_strings[] = { "first", "second" }; }'0000000000000000 <func>:
0: 55 push rbp
1: 48 89 e5 mov rbp,rsp
4: 48 83 ec 20 sub rsp,0x20
8: 64 48 8b 04 25 28 00 mov rax,QWORD PTR fs:0x28
f: 00 00
11: 48 89 45 f8 mov QWORD PTR [rbp-0x8],rax
15: 31 c0 xor eax,eax
17: 48 8d 05 00 00 00 00 lea rax,[rip+0x0] # 1e <func+0x1e>
1e: 48 89 45 e0 mov QWORD PTR [rbp-0x20],rax
22: 48 8d 05 00 00 00 00 lea rax,[rip+0x0] # 29 <func+0x29>
29: 48 89 45 e8 mov QWORD PTR [rbp-0x18],rax
2d: 90 nop
2e: 48 8b 45 f8 mov rax,QWORD PTR [rbp-0x8]
32: 64 48 2b 04 25 28 00 sub rax,QWORD PTR fs:0x28
39: 00 00
3b: 74 05 je 42 <func+0x42>
3d: e8 00 00 00 00 call 42 <func+0x42>
42: c9 leave
43: c3 ret
>>
>>
>>108600169
>Oooooooh so you're telling me the array version is writable but the pointer version is read-only?
Indirectly, because of where the string is stored.
>I thought string literals were always read-only
They are, unless you do char string[] = "....". If you do char *array[] = { "first", "second" };, string laterals are still read-only.
ok:char *array[] = { "first", "second" };
printf("%s\n", array[0]);
array[0]="hello";
printf("%s\n", array[0]);'
segfault:char *array[] = { "first", "second" };
array[0][0] = 'a';
>used to do stupid things like duplicating a string to make it writable
You can do that, manually. You would allocate and do a memcpy, but in C there is no array copy operation/semantics. When you do char string[] = "hello";, "hello" doesn't even exist as static data, it only exists in code as immediate value that are stored to memory.
But in a scripting language for example, typically "hello" would indeed be a constant string and implicity memcopied. Unless there are optimizations which would turn the constant string into immediate value in the bytecode.
>>
>>
>>108600290
>>thread locals
what's what the fs:0x28 thing is?
>>function calls
>Those are not the same code.
exactly my thinking$ cat array.c
void func() { char *array_of_strings[] = { "first", "second" }; }
$ gcc -c -std=c99 -Wall -Wextra -Wpedantic array.c -o array.o
array.c: In function ‘func’:
array.c:1:21: warning: unused variable ‘array_of_strings’ [-Wunused-variable]
1 | void func() { char *array_of_strings[] = { "first", "second" }; }
| ^~~~~~~~~~~~~~~~
$ objdump -d -Mintel array.o
...
>>
>>
>>108600326
ah, it's stack protector bullshit/tmp % cat array.c
void func() { char *array_of_strings[] = { "first", "second" }; }
/tmp % gcc -S -std=c99 -Wall -Wextra -Wpedantic array.c -masm=intel
array.c: In function ‘func’:
array.c:1:21: warning: unused variable ‘array_of_strings’ [-Wunused-variable]
1 | void func() { char *array_of_strings[] = { "first", "second" }; }
| ^~~~~~~~~~~~~~~~
/tmp % cat array.s
.file "array.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "first"
.LC1:
.string "second"
.text
.globl func
.type func, @function
func:
.LFB0:
.cfi_startproc
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
lea rax, .LC0[rip]
mov QWORD PTR -32[rbp], rax
lea rax, .LC1[rip]
mov QWORD PTR -24[rbp], rax
nop
mov rax, QWORD PTR -8[rbp]
sub rax, QWORD PTR fs:40
je .L2
call __stack_chk_fail@PLT
.L2:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func, .-func
.ident "GCC: (GNU) 15.2.1 20260209"
.section .note.GNU-stack,"",@progbits
>>
>>
>>108600326
>what's what the fs:0x28 thing is?
Specifically it looks like a sentinel, i.e. a random value with which addresses on the stack are "encrypted" via xoring. An attacker not knowing the sentinel doesn't know with what to xor his payload when smashing the stack, and as such is likely (not guaranteed!) to jump to some invalid address.
>>
>>
>>108582544
Next thread:
>>108600579
>>108600579
>>108600579
>>
new thread >>108601674
>new thread >>108601674
new thread >>108601674
>new thread >>108601674
old one reached bump limit