[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 / qa] [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: gunrs5iuh5181.png (49 KB, 620x531)
49 KB
49 KB PNG
Previously >>92150590
What are you working on?
>>
>>92165696
As soon as I'm done watching these youtube shorts I'm gonna start my web project in java spring boot
>>
File: rust=trannylang.webm (630 KB, 1280x720)
630 KB
630 KB WEBM
>>92165696
>Rust
>>
I wanted to make a c89 project just because
but I keep getting bogged down because I find that all the shit I do is incompatible with windows
I wanted to be cross-compatible with windows using mingw or something
if I discard windows now, how hard will it be to add windows support in the future?
>>
>>92165780
Nene, no!
>>
File: 0_JZlUW7vHB8CZeWuD.png (249 KB, 1005x1005)
249 KB
249 KB PNG
Basically you make a site using HTML/css/js then hook it up to a cloud provider and do a bunch of shit to send data back and forth to demonstrate comptency, I'm told its enough to get a foot in the door for entry level cloudshit. Currently wading through the piss ocean that is Microsoft azure support docs
>>
>>92165780
When you attach a tranime screenshot or a video to your post, your opinion counts 1/3rd of a human being.
>>
>>92165696
>C++
>exception specifiers
my nigga lives in the past. also got filtered.
>>
>>92165891
the graph clearly shows rust is for OOfags
>>
what's up with the insane amount of rust shilling that's been going on in dpt OP? trannies are absolutely insufferable.
>>
boys, I am FINALLY going to do some coding today!
>inb4 runs cyberpunk 2077 and wastes the rest of the day
>>
File: 1459078146481.png (1.31 MB, 1000x1400)
1.31 MB
1.31 MB PNG
>>92165887
Go back to whichever site you were on before 2016.
>>
>>92165780
How come vtubers still have glitching eyes and mouths? I thought that was fixed years ago.
>>
>>92166051
I think they just use a smartphone for tracking when streaming from home. Hololive's motion capture even in the studio isn't exactly the peak of technology though.
>>
>>92166012
Go back to >>>/lgbt/. Funny how your kind now complains about trannies when you actively normalized tranny fetish in programming.
>>
>>92166170
Implying half of /pol/ doesn't love femboys
>>
Lets make a program /g/, ill start

public static void main(String[] args) {
>>
>>92165696
how is memory shared between threads? most of my experience with concurrency is with golang and in go there are channels and also mutexes etc, but in other languages, which doesn't have mechanism like channels, are mutex the standard way to do what is usually accomplished by channels, in go i still use mutex for things like global maps, slices etc, but some things i just don't know how could be done without buffered channels, what i want to ask is how do languages other than golang accomplish things that usually require channels, select etc.
>>
>>92166269
  string s = "N"
>>
What is the difference between md5.Hash and the hash returned by md5.ComputeHash method in dotnet?
>>
>>92166340
you can have channels or similar things as libraries, it's not like they're a go exclusive.
>>
what's the easiest and fastest skill to learn that can land you a job?
>>
>>92166413
Lying.
>>
>>92166413
Not programming
>>
>>92166390
so problems that require channels are done same way everywhere? apparently rust also has stuff like channels but what about c++ java etc how do they do this, maybe promises/futures are what i am talking about.
>>
>>92166413
Bootcamp and a firm handshake
>>
>>92166413
bending over
>>
>>92166439
idk, some problems probably have solutions using other primitives, but in cases where a channel is the right tool you can just write one if the language doesn't provide one. as far as I can tell go channels are based on mutexes too, so it's not like channels are that fundamental.
>>
>>92166521
oh thanks, i am reading about them now and apparently some java libraries do exist that provide similar things, so channels are not fundamental primitives that i thought them to be
>>
>>92166435
>>92166437
I am not jewish/indian/minority
>>92166453
the reason I want a decent part time income is to move out and get into uni
>>
>>92166554
yeah. rust also heavily uses channels but they're part of the standard library, not primitives like in go

the reason for them to be primitives in go is very ideological, go really wanted to push concurrency and multithreading as its foundational paradigm
>>
whats the current state of c++ modules?
i tried gcc 12, c++20/c++23 and looks like nothing like that exist
>>
You guys are probably tired of faggots like me but i came to say i feel really genuinely sorry for you guys
Your job (outside of highly specialized branches like optimization) just became completly economically non-viable, its nothing more than somewhat autistic hobby now.
>>
>>92166720
shit
>>
>>92166720
horrible. recently wanted to use them, but support across compilers is spotty and support in CMake is still highly experimental. IMO it's still too early to use them, especially if you want cross-platform / cross-compiler portability.
>>
>>92166836
If I got 100 bucks each time one of you jelly faggots says this it would be still less than my paycheck
>>
>>92166836
>became completly economically non-viable
I've been coding long before it's been economically viable to me.
>its nothing more than somewhat autistic hobby now
Good.
>>
>>92166170
a cute gay guy isn't a tranny
a tranny is a mentally ill person
do you also think shemale = futa = trap, nigger?
>>
>>92166943
himegoto isn't gay, he just crossdresses
>>
>>92166836
It is what it is.
Google and MS just released new products to replace all of sales and management personnel.
Truck drivers are only hanging on to politicians keeping AI off the roads, which is only going to last until politicians get replaced too.
>>
>>92166907
No buissness owner will be willing to pay you a salary if they just can spend 10 minutes explaining what they want to gtp to get something that is good enough
I just spent some time with the chat and while being quite simple and probably unoptimized as fuck programs it wrote just fucking worked, first time with no errors
Sure big corporations will keep small teams of high functioning autists but everyone else will just settle for good enough
>>
File: tranny_scholar.jpg (241 KB, 1350x800)
241 KB
241 KB JPG
>>92166943
>>
File: 1668230793727067.gif (233 KB, 363x302)
233 KB
233 KB GIF
>>92166943
>do you also think mental illness = mental illness = mental illness
hmm
>>
>>92166943
Fuck off faggot.
>>
>>92167016
It's gonna be a new golden age
Fixing and maintaining code right now is the vast majority of the programming job market. I'm hyped for all you pseuds to hop on a chatbot and generate more work for me
>>
>>92167173
Chatbot can also fix shit
Jou just give it the code and an error message and it either fixes it or tells you whats fucked
>>
>>92166943
Tranny: |:
Tranny, japan: O:
>>
>>92167275
anon please, you shall not covet
>>
Python question:

What's the deal with all these @propety, @setter?
Is it somehow better than simple getters/setters?
>>
I still don't know how to build C software
>>
>>92167615
./configure
make
make install

there
>>
File: 1667864729656460.jpg (63 KB, 507x525)
63 KB
63 KB JPG
>>92165887
anime site
election tourists and newfriends are not welcome
>>
bros... I just realised what the name C++ means...
>>
>>92167902
We have to kill you now, sorry.
>>
>>92166836
Optimization is one of the only forms of programming AI can do you retard
>>
>>92166413
Flipping burgers
>>
File: 1669790222195.png (122 KB, 765x661)
122 KB
122 KB PNG
>want to learn basic image processing operations in openCV
>learn how to create dark skinned anime girls instead
not gonna complain
>>
#include <stdio.h>

#define lowkey int
#define finna main
#define fr (
#define nocap )
#define sheesh {
#define senpai }
#define ayy printf
#define clapback return
#define W 0
#define rn ;
#define senpai }

lowkey finna fr nocap sheesh ayy fr "Hello World" nocap rn clapback W rn senpai
>>
>>92168368
This has never been thought of before in the history of programming.
>>
>>92168368
you defined senpai twice
>>
>>92168487
It's mean to be senpai, anyway
>>
>>92168514
Apparently full width alphanumeric no longer bypasses the filters, f@m
>>
>>92168514
kek
>>
Does anyone else get jealous of people using/working with more "trendy" languages/tech? I work with .NET Core which is about as modern as it gets, I guess, but it's not exactly sexy or exciting.
>>
>>92168368
>not defining false = cap, true = fr
>>
>>92168643
No. I get jealous of people working in the one area I'm interested in that I constantly get filtered by.
>>
>>92168665
I actually use this one daily
>>
>>92168765
what area is that?
>>
So if I have a concurrent task that queries the database, and while I want to prevent many of them from being created and run at the same time there can be one pending task. Whats the best way to ensure this?
>>
>>92168643
how is c,f or cppshart modern or trendy
>>
>>92168813
make posting a task block until the task slot is free
>>
>>92168829
i don't mean any of those, but i'll have peers who leave to work on some startup that's destined to fail but get to fuck around on some really hip and niche language that never gains any traction. like i said, working with C# isn't the most exciting thing in the world, but it's like marrying your highschool sweetheart who's a solid 6. it's stable but boring
>>
>>92168840
I don't want to block the thread because it will created on the UI thread
>>
>>92168790
I guess embedded, specifically homebrew.
Yes, I complained about this a day or two ago
>>
>>92168643
Only when it comes to desktop development.
New stuff is 90% for browser-in-a-disguise frameworks.
>>
>>92168643
ide/tooling >>> language
>>
>>92165696
When learning, at what point do you look up a solution and work backwards to understand it after trying and failing to come up with your own? I want to work my brain to build a solution but at the same time I don't want to waste many hours on something that might not be that important long term.
>>
Almost finished my 2nd hash table implementation.
It's separate chaining except that it uses a single array of struct HashEntry instead of an array of linked list of HashEntry, both because of cache locality and for avoiding using malloc each time a new entry is inserted.
Also only one function is used to found hash entries by insert(), lookup(), delete(), rehash(), etc..

The hashing function is probably shit/imcomplete though. Do you know good hashing functions? And do you need to add a big prime number at the end for randomization? I'm not concerned about security, it's just to have a good hashing function that minimizes collisions.
int hashing_function(char *string) {
int hash = 0;
int i;
for (i = 0; string[i] != '\0'; i++) {
/* hash = hash*33 + string[i]; */
hash += (hash << 5) + string[i];
}
return hash;
}
>>
>>92169847
just don't use strings, and use open addressing.
>>
>>92169863
Like using pointers? This really doesn't help me if I want to look up thing by string name though.
I've never made open addressing yet, I still need to learned about how linear probing works exactly.
>>
>>92167016
It's only the non-creative, non-engineering oriented programmers getting replaced
Basically if you do websites it's already over for you but any other case is probably outside of the AI's scope
>>
>>92165696
Faggot. Pust shill... (:
Every /dpt/ starts with Pust.
Nice marketing...
>>
>>92169847
>>92169957
Imagine still bothering with all this shit KEK.

Just relax and ask ChatGPT to do it?
>>
>>92166943
i'm trans and i'm cute
who cares if i'm a little mentally unwell? all the best people are
>>
>>92165696
>C with classes
I will stay here
>>
>>92169847
>Do you know good hashing functions?
https://orlp.net/blog/worlds-smallest-hash-table/
>>
>>92170012
> using incredibly versatile neural network, that requires just 20% of energy taken in by dissolving organic matter, with many many millions neurons in it organized in neural groups for efficiency, capable of comprehending wavelength as sound, visible light spectrum as image, and having amazingly advanced FPU and ALU, not to mention concepts like emotions, religion and art...
VS
> typing "please make a hash please" into semi-random word generator...
>>
>>92170076
Thanks, this is interesting.
I should have precised that this particular hash table library I'm making is for an interpreter/langugae so most of the time you really need to hash strings. I will make another hash table for the case where you can use pointers as key though, that's the plan.
>>
>>92166349

;
>>
File: 4chan_sickos.png (519 KB, 600x1003)
519 KB
519 KB PNG
I've been using Mayriad's EH Master Script for Sadpanda and I've fallen in love with the alternative rating system.
It calculates a score for galleries based on the number of ratings and the times they have been marked as favorite. Unfortunately, the score currently only shows up inside the galleries and not on search pages.

Would it be possible to modify the script so that you can see that value in search as well?
The lines of code specific to the function appear to be between lines 2048 and 2143: https://openuserjs.org/scripts/Mayriad/Mayriads_EH_Master_Script/source

Sorry for asking to be essentially spoonfed. I am not yet a programmer so please forgive my noobness.
>>
you guys have any guidance on how to figure out the tables in my 4chan-like imageboard?

what confuses me is how I would divide posts to threads and simply posts and have them share the same auto-incrementing ID and also all of them having their own replies

Isnt this pretty heavy?
>>
>>92168643
No I want to start shifting to less trendy tech. ANSI C and vi is all I want
>>
>>92170463
It's C# so you could have continued the line.
>>
>>92170567
one table for posts, what the posts reply to is not important
post id, thread id, subject, body
one table for threads
thread id, board id
one to many threads to posts relationship
>>
File: asdf.png (602 KB, 1920x1080)
602 KB
602 KB PNG
My "Xarbon" program can now output C, C++, Ada, Python or Rust source code as PNG image (right) and in terminal (left) with syntax highlighting for those 5 languages...
Adding assembly syntax soon, and I would need suggestions on what else to add, that won't be niggerlicious... I'm already preparing for alternative non-TempleOS font.
>>
File: fdsa.png (638 KB, 1920x1080)
638 KB
638 KB PNG
Here's game of life in Ada language, written by Tsoding Daily, heavily indented...
>>
>>92171626
Terrible than C syntax caught on instead of this
>>
>>92171814
I also like Ada (Pascal-ish) syntax way more, but I only use Ada when I'm writing my toy compilers and assemblers.
But keep in mind, Ada can look way better than Tsoding's example, this is just too heavily indented, it's funny.
>>
>>92171814
end end end end end end end end end
>>
>>92172079
} } } } } } } }
>>
File: 1631018906344.jpg (12 KB, 271x186)
12 KB
12 KB JPG
>>92172145
>>92172079
)))))))))
>>
>>92172079
>>92172145
>>92172180
All of those could be implicit, similar to Python, but it's a source of accident bugs sometimes.
>>
>>92172180
Lithp has an excuse since it's homoiconic.
>>
>>92171626
>>92171814
case is when
seems a little weird.
case Today is
when Mon => Compute_Initial_Balance;
when Fri => Compute_Closing_Balance;
when Tue .. Thu => Generate_Report(Today);
when Sat .. Sun => null;
end case;

Reading it literally just doesn't make much sense to me and seems backwards. Like `is` should be swapped with `when` or something else entirely.
>>
>>92172241
when Today is case Mon case Tue
>>
>>92165696
the better C(++) is C++ syntax 2 by Herb.
Rust is for trannies.

https://www.youtube.com/watch?v=ELeZAKCN4tY
>>
>>92172310
C++ needs to be abandoned, this is beyond a joke
>>
File: c_syntax_rainbow.jpg (300 KB, 1013x928)
300 KB
300 KB JPG
>>92172145
>>92172202
>>
>>92172359
this image really demonstrates how useless brackets and curly braces are
>>
>>92172241
>>92172281
when Current_Day is
Monday then Put_Line "Oh no! It's Monday."
Friday then Put_Line "Oh yeah! It's Friday."
else Put_Line "I couldn't care less..."

^ my ideal syntax, no semicolons, brackets, etc.
>>92172359
>>92172422
Anon, I... Yes.
>>
File: 1568983981452.png (65 KB, 871x913)
65 KB
65 KB PNG
>>92172359
>>92172180
>>92172145
>>92172079
lets get this started
>>
>>92172207
>this homoiconicity cope
Manipulating program with macros is just manipulating trees, and trees don't care about parentheses.
Webshitters fuck around with trees everyday and they can conceptualize this just fine without S-expressions. Why can't you?
>>
>>92172504
>Why can't you?
I can, I just don't care. M-expressions are uglier.
>>
Question: in C, if I initialize a variable in one source file, how can I access that same variable in another source file?
In a little game I'm making, I have the textures initialized (reading .jpg files from another folder) along with the window, renderer, etc, in a file called init.c. So I want to access those same textures in another file which handles the main game loop called game.c. Although I can declare the textures as extern variables in a shared header file, and game.c recognizes it (as can be seen from the lack of a compiler error), they're empty. So it looks like that isn't the solution.
I could pass the textures to the main game function as arguments, but I think that'd make it look sloppy and I want to avoid it. Surely there's a way to simply access a variable initialized in another file, probably by using pointers somehow. I could pass the textures to the game function as arguments, but I think that'd look sloppy and I'd like to avoid it. Does anyone here know of a solution to this problem?
>>
I discovered a new metal music genre... I like it. (:
https://www.youtube.com/watch?v=Uqr7-OM4VG4&ab_channel=GoreGrinder
>>
>>92172560
just declare the variable in another file and it'll be accessable
>>
>>92172560
Global state is arguably the sloppiest.
>>
>>92172535
>M-expressions
For function calls only.
Otherwise there is C style block syntax for control flow, unary prefix/postfix and binary infix operators for expressions and finally, some additional syntax for regex/pattern matching/tree searching (one and the same).
See? Much better.
>>
Oyasumi Pun Pun...
>>
>>92172578
I guess this would normally work, especially since I stopped getting compiler errors when I did it, but it looks like the graphics library I'm using (SDL2) has some nuances that I'm not fully aware of, so I'll have to find another solution.
>>92172626
Fair enough. I think my idea of initializing all the textures in a single file, along with the renderer, was bad in the first place. I think I'll initialize them in game.c instead, in a separate function.
My first jury-rigged solution was to initialize the textures in the main game loop, but that crashed my computer because it'd keep defining and clearing a bunch of different textures every time the loop run (lol).
>>
>>92172490
kek
>>
>>92172310
In my opinion C++ should look more like C, not less.
>>
>>92172755
It already looks like C
>>
>>92172775
C#, at least until recently looks like C. C++ doesn't.
>>
The Linux port is coming along nicely bois, made some progress last night before falling asleep. We now have a separate GUI path and CLI path depending on program argument. The core is almost finished. I will probably use Iced-rs or dioxus for the UI.
But now I gotta wait for the next weekend ;(

I will keep coming back to it every now and then though.
>>
>>92172798
finally someone posted some code that doesn't look ugly as sin
>>
>>92172816
Why thank you. I have organized the code for maximum maintainability. So someone can drop by and understand what's going on just by looking at it. I'm a believer of clean coding.I did my best to make the code look as pleasant as possible to work with.
>>
>>92172868
writing Rust code that doesn't look like shit isn't easy, so well done
>>
>>92172798
>>92172868
looks pretty good, anon. Godspeed.
>>
>>92172560
Don't use a shared header, or don't have init.c include it. For whatever reason it allows an extern variable and file scope variable of the same name to exist (at least in my experience).
>>
>>92167824
Only on projects that are made by sane people.
>>
Is there even a single idea for a mobile game that hasn't already been made?
>>
>>92172982
Thanks, that's good to know. Explains some of the problems I've been having.
>>
>>92173045
yes
>>
>>92172798
what font is that?
>>
>>92167843
1/3rd
>>
>>92169847
>The hashing function is probably shit/imcomplete though.
I'd use a smaller shift; empirically, 3 works very well for ASCII text. I used to have the performance data.
>>
File: 1521193855332.jpg (34 KB, 645x729)
34 KB
34 KB JPG
>>92169863
>just don't use strings
>>
>>92169986
Pycт* cyкa блядь
>>
>>92172798
What are you working on?
>>
I was trying to write some stuff using Raylib in C++, just to freshen out my coding skills and trying to both learn C++ and graphics programming. For some reason I am currently kind of "aiming" to get an entry job in the gaymen industry, it'd be my first job.

Holy shit graphics programming is hard. I am getting seriously demotivated. I am honestly not sure how to continue. Is there some other area of software development I should focus if I am too much of a brainlet for gamedev?
I would want to avoid webdev if possible.
>>
>>92173529
I'm porting a popular Elden Ring Save file editor to Linux. The original is written in C# Winforms.
And it has a ton of bugs. I think the author is not a very good programmer. Nonetheless, he did work hard to extract the indices of useful data in savefile.
>>
>>92173208
Cascadia Mono.
>>
File: segfault.png (37 KB, 771x298)
37 KB
37 KB PNG
Coding a C programme. Got a segfault. I presume my accessing of areas I malloc()ed was bad, and I tried to access a region of the heap I shouldn't have.
I remember ages ago doing aocg and an Anon told me about a debugging tool which printed a pretty table that showed the memory region where I tried to do an out-of-bounds access. It was part of the standard gnu C toolchain. What is that command? Does it only show the stack?
Aaaaa
>>
>>92174115
>C
>Segfault
Ah yes lmao
>>
>>92170803
That's Java.
>>
>>92174115
-fsanitize=address maybe?
>>
made a shitty booru scraper that downloads all the basedjaks from the onions booru, currently making a similarity matrix on all the tags for it to be a Twitter bot that normies can just ping and it'll respond to the replied post with a relevant image.
my question is, would it be best to pay for Google Colab for a month so I can train the images to make a Onions Diffusion model? I don't have a good graphics card or anything.
>>
>>92173316
Thanks, that's perfect.
I was just about to reply to you that I'd prefer not fiddle with with the hash function myself since I don't understand how that works and heard of the warnings "it's hard to find good hash functions", but I looked at various hash function used in scripting languages and find exactly the one you are proposing, with an interesting comment too.
https://github.com/tcltk/tcl/blob/main/generic/tclHash.c#L817

FNV pops up a lot in hash table talks, I might check this out, and there are a shit load of other ones here
http://burtleburtle.net/bob/hash/doobs.html
>>
>>92174115
There are lots of debugging tools available.
But they were probably recommending the address sanitizer (pass -fsanitize=address to the compile command).
Or maybe it was a more traditional debugging tool like gdb or valgrind.
>>
>>92172422
I thought the function's variables were K&R arguments. Kek.
>>
File: segfault2.png (10 KB, 729x262)
10 KB
10 KB PNG
>>92174190
>>92174244
This seems familiar. But, uhhh... what am I meant to do with picrel?
Just look at all my dereferences? Is the printout normally more informative than this?
>>
>>92173995
what do you mean by "graphics programming"? Like you're using OpenGL or you're just drawing some squares with Raylib? Because if it's the latter you need to try harder, that's easy
>>
>>92174336
turn debug symbols on (-g), and it should tell you where exactly in your code the segfault happened.
Sometimes it will show you a sort of heap map or tell you which allocations are near the fault, but it looks like your bad access is too far away for it to make much sense of it.
>>
>>92174409
Ty Anon. I am too tired to debug this now, but now I am able to start debugging it when I wake up tomorrow. :)
>>
>>92174381
The latter, and I'm finding it quite hard.
>>
>>92174493
What do you think is hard about it? Do you have any prior programming experience?
>>
>>92174336
use -g for debug information.
-Wall -Wextra -Wpedantic for sane warnings.
-fsanitize=undefined for bad behavior (but false positives exist). But usually you don't want to avoid it with ASAN because UBSAN doesn't give as much info as ASAN.
-fsanitize=address for memory and other checks like memory leaks on linux (use the enviroment variable "ASAN_OPTIONS=detect_leaks=0" if you are using a library that causes a memory leak which is a false positive).
Also debuggers are very important, using an IDE like vscode you can use the gdb debugger (you don't need to use cmake or anything, you just need to make a folder with a folder called .vscode and it should have settings.json and inside that json folder you can specify the executable and parameters you want to pass to it, and in vscode you just need to press the debug button, you can also debug core dumps in vscode's debugger as well (you need to find the settings.json for that one).
Pretty much every vscode tutorial has a settings.json for a debugger, just ignore the cmake part.
>>
>all that gymnastics
lmao
 cargo check
done. Fucking boomers when will they learn.
>>
>>92174524
>Do you have any prior programming experience?

Yes, but I have to admit I've never been a great programmer.

I would paste some code here but deleted what I was working on out of frustration.
The other source code files I have are just, random examples in where I try to apply some stuff, like in the screenshot I shared in my first reply.
>>
>>92174635
so what are you having difficulty with
>>
>>92174550
forgot to mention, with a debugger you can use breakpoints, which basically lets you pause the program and inspect the variables while stepping over lines, stepping into functions (enter function frame), and stepping out of functions (leaving function frame).
You can also hover your mouse over variables to get their values, see a variable list which you can expand the contents of structures, and you have a debug prompt so you can type in global variables so you can print their contents, and I think you could even call functions arbitrarily (I rarely do this).
The annoying part is that ASAN and UBSAN will block your debugger's abillity to debug, but generally you have all the information needed to break to a early position so you can step through the code and see what odd variables you have.
>>
>>92174620
>Fuck
DRINK SOME COFF
and chill on link below
https://www.youtube.com/watch?v=htIuSWBnmok
>>
>>92174671
Is coffee good for me?
>>
>>92174648
Thanks for the interest in helping. Really appreciate it, man.
Unfortunately I have to leave (I'm working right now). Hopefully I can join in back later or in another thread. Thanks a lot.
>>
c is the worst language the devil ever created
>>
>>92175134
How is that possible when sepples is worse?
>>
>>92174336
You could also use
zig run --c-source MusWeb.c
and get all of this good stuff >>92174550 with the ease of >>92174620 but without having to switch to a retard nigger language.
>>
I want to join the distributed systems team at the company I'll be interning at this summer. The thing is I have no dist. systems projects under my belt.

Any cool ideas?

Right now I'm thinking of making an image database but specifically for txt2img AI images. I essentially use the text prompt for indexing. Generating AI images is computationally expensive so I think it'll be cool to save results like that.
>>
>>92166720
non-functional

>>92174037
i'd maybe write that parse so it returned a Result<Self> instead of asserting, or an option if you don't feel like dealing with error types

the for loop can be something like this. you might also want to check the length of the source byte iter being 8 by doing source_byte_iter.clone().count() == 8 or use a counter and regular for loop
for (id, src) in id_bytes.iter_mut().zip(source_byte_iter) {
*id = src;
}
>>
>>92175759
90% of "distributed systems teams" work on a basic CRUD app that gets run on k8s in several instances that all connect to a single database.
>>
>>92176153
It's a big tech company, and their dist. systems team is run by famous people
>>
>>92176264
If they aren't core erlang devs then they're babies
>>
>>92174550
unfotunately -Wall is only really useful for gcc
-Wall enables what gcc hides behind -Weverything on clang, -Weverything enables all the literally useless warnings like -Wc++98-compat
>>
What's better for starting out, C++ Primer or learncpp.com?
>>
File: disappointment.png (377 KB, 925x676)
377 KB
377 KB PNG
It seems an odd thing, but if a class truly does one thing and one thing only, then it really only needs the call operator being defined for it....


Right?
>>
>>92176503
neither
pretty sure both of them are really out of date
any books from before 2011 are not worth reading
2011 is the start of "modern" c++
use Programming: Principles and Practice Using C++ 2nd ed
it's by the guy who actually made the language
>>
>>92176544
okay thanks
>>
>>92176647
be warned it does only go up until C++14
you'll need to use supplimental materials to catch up to current standards
isocpp.org is a good place to find some
C++17 is the last fully complete standard and C++20 is only complete on microsoft's compiler but buggy
C++23 just came out

oh and use https://en.cppreference.com/ for reference instead of the other site that comes up, i forget what it's called but it's really really out of date, despite this it sometimes ranks higher in search results
>>
>>92167902
I never considered the implication of
c == c++
: if they already improved it it would be called ++c.
>>
>>92176521
Otherwise known as a closure.
>>
>>92167902
What do you think C# means?
>>
Is memory mapping 2x 28 mb files worth the unsafe block? I'm doing a lot of parsing and indexing.
>>
>>92176800
++C would just be a C update.
>>
>>92176967
>2x 28 mb files
>parsing
Binary parsing? or like XML?
>>
>>92176946
I've heard C++++ arranged in two rows.
>>
>>92177000
binary parsing.
>>
>>92176967
just read it into a Vec<u8> for now and if you absolutely need it then later it's trivial to switch. the performance difference isn't going to be huge
>>
>>92176967
No. Implement a serde deserializer and stream the file into that.
>>
>>92176503
Primer.
>>
>>92166012
>>92166943
You will never be a woman.
>>
>>92178182
Yeah, that's the point, retard.
>>
File: file.png (6 KB, 608x258)
6 KB
6 KB PNG
would it be better to use .reset() in this smart pointer /dpt/ ?
>>
is it preferable to keep a file open, or would closing and opening at need be better?
like, does 7z have the zip file open for the whole duration of the program or does it open to read the file entries, then closes it and whenever you choose to extract a file it reopens the zip and takes out the file?
>>
>>92176312
Weverything probably also enables Wconversion which conflicts with undefined behavior sanitizer.
The only way to suppress Wconversion warnings is to put it into a cast, but the cast will suppress undefined behavior errors (like overflowing and signed integer due to narrowing).
Personally I like having implicit cast warnings, but I don't use the compiler warnings, I use clang-tidy and use NOLINTNEXTLINE(bugprone-narrowing-conversions) for every time I implicitly cast a number (because diagnostic suppression pragmas are worse) and I want undefined behavior sanitizer to be triggered some sort of overflow or underflow.
I also enable individual flags for both gcc and clang using cmake's CHECK_CXX_COMPILER_FLAG macro (but you need to write your own caching function for it).
>>
If I initialize a variable in a function, how can I access that same variable with the same value in another function? Pointers?
>>
>>92176503
>>92177540
>Primer.
This. Stroustrop will hold your hand through a bunch of WRONG practices and it gets annoying fast. Plus in order to solve said examples he brings in features from C++ that he doesn't explain. There are also way too many exercises per chapter. Primer is more concise like a reference book. The only issue with Primer is that it's dated so you'll definitely need to learn modern practices to supplement it
>>
>>92179250
why? it goes out of scope.

unless you intend to re-use it there...
>>
there's a certain feeling of satisfaction when you write disgustingly ugly code that works perfectly, and is fast
it's like jerking off to the most perverted, degenerate doujin you can find and coming buckets, knowing your friends would probably stop talking to you if they knew about it
>>
>>92179575
yes
>>
>>92179462
keep it open for the duration of use, there's no cost to having a file descriptor/file handle open
you don't want to allow another program to mess with the file while you're using it, do you?
>>
>>92179575
depending on the language the variable is going to fall out of scope and the memory is going to be freed, but it depends on the language for example in python you can initialize a member variable and it'll be available anywhere
pointers won't help you if the variable falls out of scope, what will they be pointing at? either freed memory or something else entirely if the address got allocated
>>
>>92179481
these are my flags I use (but half don't work on gcc and half don't work on clang).
-Wsuggest-override
-Wnon-virtual-dtor
-Wduplicated-cond
-Wmissing-variable-declarations
-Wduplicated-branches
-Wrestrict
-Wunreachable-code-aggressive
-Wlogical-op
-Wloop-analysis
-Wtautological-constant-in-range-compare
-Wimplicit-fallthrough
-Wredundant-decls
-Wimplicit-float-conversion
-Wshadow-all
-Wshadow
-Wenum-conversion
-Wunused
-Wundef
-Wmissing-declarations
-Wvla
>>
I've only ever made CLI programs but I want to make a GUI one. I'm not going to make it from scratch so I guess I'll use a GUI library. Can you just slap any arbitrary GUI out there onto your code, or at least with minimal adjustment? Or do you have to start a program with the intention of tailoring it to a specific one?
>>
>>92180022
Which proglang? And not even trying to meme but if you're OK with guiding ChatGPT through some prompts and showing it your API/code it will make a pretty workable GUI for you to use as a base because 90% of GUI work is boilerplate and ChatGPT excels at boring boilerplate. As long as your CLI programs aren't super fucking complex like ffmpeg or some shit.
>>
>>92180022
>Can you just slap any arbitrary GUI out there onto your code, or at least with minimal adjustment
yes and no
first of all libraries only work with specific languages, so if you're making your program in C++ you can't use WPF for example
then, each GUI framework has its own way of doing things, so you should at least be somewhat familiar with it
for example Qt is pretty straightforward with signals and slots, WPF uses model view viewmodel, electron uses any of the javascript UI frameworks like react, etc
you could in theory ignore that, but it's going to be painful because those GUIs are designed with those patterns in mind
>>
Can I have a null pointer key in my hash table?

ht_set(t, NULL, val);


How do I implement this
>>
>>92180061
>>92180090
I was thinking of starting off with some baby simple program you could quickly replicate in any language and slap a GUI on just to get my feet wet. I've got one where it gives you an easy addition problem and you just type the answer and hit enter, then it tells you correct/wrong and moves on to the next. How come I can't just make a GUI in any language with a text box for the prompt/results and a field to enter the answer into, then just pipe the data between the window and the program that handles the actual logic?
>>
>>92180297
if you want
presumably null is its own distinct value
this implies you can't use null as a sentinel
>>
>>92180022
>Can you just slap any arbitrary GUI out there onto your code, or at least with minimal adjustment? Or do you have to start a program with the intention of tailoring it to a specific one?
Unironically MVC.
Mixing the reporting/logging/graphics code with the logic of your program makes for shit code.
Both because it will be hard to modify the logging part and because you won't be able to use your library elsewhere and will have to rewrite it but without the logging part.
>>
>>92180022
depends on the library
Qt, the library the other anon mentioned, needs to run a precompiler called the moc as it has language extensions to make gui programming easier
so it's easier to work with if you're using a build system that supports it, like msbuild (with a VS extension), cmake, or Qt's own project system

other libraries are more simple, for example this is an example using tgui https://tgui.eu/tutorials/0.9/sdl-backend/

oh and if you're on windows and using C or C++ you need to set the subsystem to windowed and manually specify that it uses main() or else the console window will still pop up
you can do it in source code via
#pragma comment(linker, "/SUBSYSTEM:Windows")
#pragma comment(linker, "/ENTRY:mainCRTStartup")


>>92180298
you can, there's nothing stopping you aside from figuring out how to launch both seamlessly which is a pain
>>
>>92180298
>How come I can't just make a GUI in any language with a text box for the prompt/results and a field to enter the answer into, then just pipe the data between the window and the program that handles the actual logic?
the short answer is that interop between languages is a very hairy topic, and even though it's not completely impossible, it's ridiculously complex and definitely not a beginner's project
some languages have bindings to other languages, which makes this interop a big less painful, but it's still hard
>>
File: cpp2.png (65 KB, 450x283)
65 KB
65 KB PNG
>>92172310
>Rust is for trannies.
>posts a video of some guy trying to turn C++ into Rust
I don't even hate rust, but I think it's funny when this is what he thinks C++2 should be like and it's basically Rust
>>
File: 1678747329706534.jpg (90 KB, 675x1024)
90 KB
90 KB JPG
>feel tempted to switch to C because someone called C++ a tranny language
should I be using C?
>>
>>92180418
that's worse
>>92180492
you swap languages faster than genders tranon
>>
>>92180298
zenity --entry
would work, but the window will open/close for every question which could be annoying.
>>
File: 1679157089995567.gif (1.93 MB, 300x300)
1.93 MB
1.93 MB GIF
>>92180518
I JUST WANT TO BE AUTISTIC IN PEACE
>>
>>92180022
Usually you use frameworks for retained mode GUIs, which means you don't write main function yourself.
>>
>>92180298
>>92180522
Zenity and bash was my very first experience coding back in college, should be easy for a babby to learn.
>>
File: 1586981884564.jpg (304 KB, 1080x1118)
304 KB
304 KB JPG
>>92180492
>>
>>92180492
all languages have troons or pajeets, pick your poison
>>
Java is my favourite programming language
>>
>>92180377
>>92180392
Thanks. Guess it's like travelling abroad and expecting your power cords to fit into every wall in the world without an adapter. I'll probably take the path of least resistance for now and use things that are made to work together. I'm guessing the command line can read and write data from any language because its close to the operating system, while a GUI made in a different language would need to transform the data in some way to make sense of it.

>>92180353
>>92180522
>>92180544
I'll keep this info handy for experimenting.
>>
>>92180797
>I'm guessing the command line can read and write data from any language because its close to the operating system
not really
>>
>>92180620
>>92180756
which is least pozzed?
>>
File: 1660499975078424.jpg (36 KB, 798x644)
36 KB
36 KB JPG
>>92172868
>look as pleasant as possible
>most of the code is on fourth indentation level
>pub, fn, mut
>>
>>92180919
>most of the code is on fourth indentation level
Are you retarded?
>>
Was Dennis Ritchie stupid or malicious?
>>
>>92180890
all languages you pick will eventually get invaded by troons, just stay with one and be as unwelcoming as possible to the troons.
>>
>>92180959
yes
>>
File: gol.adb.png (15 KB, 888x680)
15 KB
15 KB PNG
>>92171495
good
I added the templeos font and a templeos like theme to mine
>>
File: ioccc_2001_rosten.c.png (14 KB, 568x928)
14 KB
14 KB PNG
>>92181007
oh, and terminus
>>
File: 1200px-Fortran_logo.svg.png (30 KB, 1200x1200)
30 KB
30 KB PNG
>kills C
why is it slept on?
>>
>>92181030
>Fortran
Anon I don't know how to tell you this
>>
>>92180797
>I'm guessing the command line can read and write data from any language because its close to the operating system,
sort of?
text data is probably safe-ish, not sure about how different languages handle binary IO from the standard streams
at least on windows, you have to be careful of things like automatic locale conversion
for example i think C# uses utf-16 by default while c++ reads/writes in whatever the current locale is if you're using cin/cout or "wide characters" (utf-16 on windows/utf-32 on linux) if you're using wcin/wcout
if you just want something simple manually sending commands would be fine, but for a robust solution for something like piping function calls in-between programs you'd probably want to use some sort of library that adds support for a text-based RPC (remote procedure call) framework like jsonrpc
as for the OS "closeness" the process loader, at least on windows, does allocate the standard input handles, but there's a fair amount of abstraction over those depending on the language and the runtime

you also could use a pipe instead of just the standard streams, both linux and windows support anonymous and named pipes, although they work somewhat differently on each
or you could use a local socket, either a normal one, or both windows (10+) and linux support unix domain sockets which are meant for interprocess communication
the advantage of this is it would be very easy to make your backend run over the network and you'd be able to use normal RPC frameworks
>>
>>92165780
source? xD
>>
>>92181092
Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining God 東方不敗 Master Ginga Victory Strong Cute Beautiful Galaxy Baby 無限 無敵 無双 Nenechi
>>
>>92180492
highly intelligent people are usually associated with mental illness because they choose to do difficult things normal people wouldn't bother with, so if you use a language that is notoriously difficult, you are likely to find people with mental illness.
>>
>>92165832
Just use Msys2 GCC with -std=c89, MSVC is for more modern shit
>>
File: 668.jpg (40 KB, 600x722)
40 KB
40 KB JPG
>>92167435
>getter/setters
https://www.youtube.com/watch?v=_xLgr6Ng4qQ
>>
>>92180492
There are plenty of trannies writing C
https://casual.agency/
https://github.com/jart
these are 2 that immediately came to my head
>>
>>92181182
oh wow... but i just wanted this video with audio
>>
>>92181323
this is a really stupid and cnile take. i hate dogmatic oop of getters and setters that are no different than public access, but his example is such a toy it just makes him look like a child. there are absolutely cases where you want to encapsulate data because it has invariants which are upheld internally that users don't need to care about
>>
>>92179822
Even trannies have less pronouns
>>
Is inferring everything but forcing return type specification for functions reasonable?
>You’re just too stupid to infer the return type for recursive functions.
Yes. Also compile times.
>>
>>92181546
yes, rust does this and more languages are converging on it. local inference, top level explicit specification
>>
>>92181007
TempleOS theme is just too much for me, I like it dark, but good work Anon... (:
>>92181030
Other programming languages are killing C since 1980s apparently... They can't.
>>92181338
> There are plenty...
> 2...
Please Anon, go write Pust toy programs.
>>
>>92174037
Based Elden Ring enjoyer. Do you have a public repo?
>>
File: RealCat.gif (214 KB, 128x128)
214 KB
214 KB GIF
>>92181615
cnile damage control in FULL GEAR
>>
>>92181574
So something like this? I don’t need the parameter types, just the return type.
sum a b -> int = a + b
>>
File: sIAVMJi.jpg (209 KB, 2092x1179)
209 KB
209 KB JPG
>>92169986
>>92170178
>>92171495
>>92171626
>>92171971
>>92172202
>>92172466
>>92172577
>>92181615
>>92088674
>samefagging cnile nocoder's best attempt at a "program" is a ~200loc libpng toy project
EVERY. SINGLE. TIME.
>>
>>92181716
sum a b > i = a + b
>>
>>92181849
>nocoder
Whenever I hear someone say this, I'm always inclined to thing they're a javascript or python """developer""".
>>
File: aaaa.png (462 KB, 1525x1365)
462 KB
462 KB PNG
>>92181893
no im a c++ dev, here's one of my latest projects(std::expected<T, E> implementation)
>>
>>92181929
Imagine posting that as something you're proud of.
>>
>>92181947
no its a small polyfill for a path tracing engine, never said i was proud of it
>>
>>92181929
>FIXME: can't be arsed
it's fookin' RAW.
>>
File: engines.png (133 KB, 1920x1018)
133 KB
133 KB PNG
>>92181849
> Samefagging cnile nocoder's best attempt at a "program" is a ~200loc libpng toy project.
Or 30 different 2D/3D game engines written in C and my custom languages, using Xlib, XCB, SDL2, OpenGL and Vulkan... Image related.
The only thing in which I differ from other "cniles", it that I don't support free and open source software, even tho I use it (parasite on it).
>>92181893
I used Python when I was 2009, inside Blender to make games, but never used it after 2011. And I haven't wrote a single line of AnyScript in my life.
--
I have a lot of projects, some are over 6000 SLOC long, but I'm not chasing ego or GitHub stars or some other crap, I write for fun. (:
>>
>>92181984
>Or 30 different 2D/3D game engines written in C
Holy shit you mean that “rewriting C++ game engine in C” spam wasn’t just meme larp?
>>
>>92182018
Yes, I have parts of Cube Engine from 2005 (C++) rewritten in (ANSI) C, but it's not complete, because I project-hop (and distro-hop), half of the files is ported. It compiles quite faster now.
>>
File: 1660497490056763.png (160 KB, 981x949)
160 KB
160 KB PNG
>>92181929
>brags about boilerplate
>lines longer than 80 characters
>>
>>92172868
Can't you replace lines 22-27 with just
data.iter().skip(...).take(8).copied()
?
Can't that just be a slice? I don't actually use trannylang.
>>
>>92182067
K lad, here's another project im working on.
>>
>>92182262
all I see is random words and numbers in a shitty ascii table
>>
>>92182290
no retard im just showing you the size of my project
>>
>>92182221
A slice of 8 bytes? Why?
>>
>>92181323
low IQ take, there are good reasons to encapsulate and instead of continuing his journey of becoming a good architect he apparently has decided to just avoid all of it and remain a mediocrity?
>>
>>92182432
Because that's SteamID.data's type? I didn't write that code.
>>
>>92182221
The result of
 data.iter().skip(...).take(8).copied()
is an iterator, so no.
>>
>>92182549
Again I don't fucking know rust, but apparently yes .collect() already exists.
>>
>>92182565
Arrays don't implement collectable for obvious reasons.
>>
>>92182574
>collectable
or FromIterator or whatever the trait is
>>
>>92181323
>encapsulation? that's just some oop retardation
>now let me just take this here file descriptor
>how do you use it? you can't access any data directly, you have to use functions like read, fcntl or getsockopt
>ahhh, what a great design, so nice to know I can't fuck up the state of a socket
>>
>>92182574
Meme language. Zig doesn't have this problem.
const ID_LOC = 99;
pub fn parse_from_game_data(data: []u8) [8]u8 {
return data[ID_LOC..][0..8].*;
}
>>
>>92182711
I mean, that rust code is very unnecessarily verbose and could done much more concisely, but what that dude wrote will compile down to just directly copying those 8 bytes so I doubt anyone cares. If your goal is just to do it in a oneliner, you can.
>>
>>92181546
It is somewhat reasonable to require top level definitions to have type annotations, because it's considered a best practice among functional language users even if it isn't usually necessary. However...>>92181716 is a bit weird. Usually it's way more common for it to be the other way around, where argument types are provided and the result type is inferred, e.g.
sum (a : int) (b : int) = a + b

For decent type inference with polymorphism etc. you should already have some constraint solving machinery implemented, and it's trivial to use that to solve type inference for recursive definitions (aside from polymorphic recursion).
>>
>>92182318
>quantity over quality
good morning sir
>>
>>92182711
https://iamkroot.github.io/blog/zig-memleak
It's already over.
>>
>>92182711
What happens if the iterator underflows or overflows the resulting array?
>>
>>92182831
There is no iterator. [ID_LOC..] gives a slice (panicking if out of range), [0..8] gives a pointer to an array, .* dereferences it, copying if needed.
>>
>>92182221
yes, you could do
data[start..=end]

which will give you a slice you can then convert to a fixed-size array with
try_into
>>
>>92182862
>copying if needed.
i thought there was no hidden control flow???
>>
>>92172868
>>92182549
You can just use a slice, which you can then convert to a regular array using try_into (which fails if the length doesn't match). So:
// this also makes the assert redundant
let id_bytes = data[STEAM_ID_LOCATION..][..8].try_into().unwrap();
>>
>>92182774
the rust code comes from c# in the original which was written that way
>>
acropalypse is scary
>>
>>92182938
yes, googlers are retarded for changing APIs like that
>>
>>92182945
android APIs always seemed like an absolute dung pile
>>
File: 1663045711800267.png (528 KB, 526x536)
528 KB
528 KB PNG
>>92182818
>author: krut patel
>two pages of esl babble
>>
>>92182955
true, the chain of how that shit got """"reviewed"""" and accepted with no tests and just managers saying LGTM is hopefully opening peoples' eyes to the quality of work and developers there
>>
How can updooters justify their position when companies introduce bugs so often?
>>
>>92182818
>Pajeet doesn't understand what a bump allocator is, uses it wrong
>eventually learns his mistake, writes about it
>faggot on 4chan pretends this is a problem with Zig
>>
Scala > Rust > Java
>>
>>92182906
But there's an 8 right there! The compiler should know!

Zig's comptime just makes sense.
>>
>>92181984
>ada0
>ada1
>ada2
>ada3
>..
>ada8
lmao this dude never learned what version control is
>>
>>92182991
Software developers are mostly incompetent in regards of logical and analytical thinking, for the lack of a better term...
They can make an update to fix 1 bug, and then introduce 10 new bugs, that's why I try to keep my programs small in size.
It's easier to catch bugs, and I try not to share my more serious project, until they're finished, I share only toy or mock ones.
> Just push/pop (I'm not a Git user) a commit or something, it'll give us stars and forks.
> Oh, a bug, no it's a feature, I won't change it, you can fork it dude, fix it yourself.
Back in the day, 90% of programs were published when they were finished (in most cases). Today it's reversed, 10% are finished.
I don't idolize Johnatan Blows, but he was half-right about his presentation "Preventing the Collapse of a Civilization".
>>92183162
Yes, as I said, there's 105 files there, and more in other folders, I'm messy, but only 30-ish different game engines. I don't use Git. (:
>>
File: algo problems 2.png (76 KB, 595x849)
76 KB
76 KB PNG
I don't want to be a dumbass anymore. Where can I find courses that provides solutions and explanations to DSA problem like these so I can grind? I failed my algorithm class and then my data structure class a year ago, and now I suffer from it by spending my weekends preparing for mid exam in April and final exam in July. I'm currently on an internship every Monday to Friday and I commute to office as early as 5 and got home at 19.30. I just need to get this over with.
>>
>>92183132
If Zig can use its comptime to determine that the length of the slice is static and convert it to an array as a safe no-op then that's pretty good. Rust isn't quite there yet since it's const generics are still too primitive to support e.g. getting an array reference from a slice made using a const range with the length of that range.
>>
>>92183210
>he was half-right about his presentation "Preventing the Collapse of a Civilization"
i think he was totally right
>>
>>92182812
My point wasn't "i shat out a lot of code", stop being so retarded.
>>
>>92183257
Yeah x[i..j] where i and j are comptime known isn't even a slice, it's a pointer to an array (which can implicitly convert into a slice if needed). Comptime known isn't just literals, but quite a lot of things, including const decls.
>>
>>92183210
>Software developers are mostly incompetent in regards of logical and analytical thinking
> I don't use Git. (:
Explains everything lmao
>>
>>92183298
Half of that talk was supposed to be (in my opinion) dedicated to faults of von Neumann architecture and lacking of other alternatives that would resemble Data Flow or strictly incorporate general immutability into hardware directly.
I suggest you read John Backus's paper on von Neumman languages, if you already agree with Johnatan Blows. It'll give you a great insight into programming language structure, design and parsing.
>>
>>92183254
>first one
Think about it brute force first, you just need to arr[0] - arr[1], then arr[1] - arr[2], then arr[2] - arr[3], and whatever number appears twice is your pattern.
Now just figure out an 0 N solution where you can iterate through the entire array, while looking for number that is i-1 + (2 * pattern).

You just need to stop letting your brain tell you something is way harder than it looks.
>>
>>92183337
> Explains everything lmao
Explain...
Yes, I don't use Git, it's a bad piece of software, and a bad practice in my opinion, because "software developers" (text typing people) are encouraged to just make new changes, and if it compiles, it's good.
Not many people write in Ada programming language (I do), or use Splint and Valgrind when developing ANSI C programs. Most of them don't even enable all compiler warnings, I do.
>>
>>92183392
>new changes, and if it compiles, it's good.
You are absolutely insane if you thin that modern devs don't leverage automated test so that they aren't just adding changes that create more bugs.
>>
>>92183428
Are you aware of how many programs have tons and tons of glitches, bugs, and crashing errors?
And no, Pust, automated tests, OOP, TDD, whatever else next they "invent" won't change that.
You can't replace a smart programmer with a paradigm or a set of rules to follow to "correctness".
>>
welp, back to writing algo/find/sort/memory-layout stuff

better yet, I'm going to take a friggin nap, it is 2:45 AM after all.
>>
>>92183392
>"software developers" (text typing people) are encouraged to just make new changes, and if it compiles, it's good.
That has nothing to do with Git, retard.

>>92183463
>You can't replace a smart programmer with a paradigm or a set of rules to follow to "correctness".
Yet you use Ada..?
>>
>>92165696
Is there a better/non-unsafe way to read in raw data to a str in Rust?
>>
>>92183515
> That has nothing to do with Git, retard.
It is my opinion that systems like Git encourages it as I said. Don't share unfinished programs.
> Yet you use Ada..?
Yes, and Ada is 5% of my projects, I use C for 90%, which is the majority, and 5% other languages.
>>
Up at 1AM after sifting through nonsensical java framework documentation where every version deprecates a previous version's annotations and methods. Also started work on a personal project to move an old game that has to be compiled with VS6.0 to work with Cmake and eventually work with SDL for cross platform purposes. There's already something that does this but its ran by retards that break everything and make the game less stable than it was 10 years ago.
>>
>>92183595
>Don't share unfinished programs.
How else is a team supposed to collaborate on software development?
>>
>>92183595
>git
>don't share unfinished programs
you are confusing git with github and it is making you look very very very stupid
>>
>>92183564
Just don't use the unchecked variant...
>>
>>92183564
ignore the if statement there, the code in the else clause I experimented with is useless and doesn't work
>>
>>92183428
>aren't just adding changes that create more bugs
look around
>>
>>92183564
what do you mean raw data? you might want to be using osstr/osstring or vec<u8> then write it to stdout after as bytes or convert it. the string lossy methods are useful
https://doc.rust-lang.org/stable/std/?search=lossy

that err function is weird. i recommend some kind of try_main and main so you don't have to do that and can just bubble up
fn main() {
if let Err(e) = try_main() {
eprintln!("{e}");
std::process::exit(1);
}
}

fn try_main() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
>>
>>92183628
No it panics if the file isn't UTF-8. I'm trying to read in binary data.
>>
>>92183564
>unwrap_or_else(err)
the very same people moaning about go result handling
>>
>>92183652
Strings in Rust have to be valid UTF-8. If you're dealing with arbitrary data then you have to use arrays/slices/vectors of bytes (u8).
>>
>>92183648
Oh thanks, I'll look into osstr
>>
>>92183652
i can't tell what you mean, do you know about files? you can use OpenOptions to build and open a file
https://doc.rust-lang.org/stable/std/fs/struct.OpenOptions.html
https://doc.rust-lang.org/stable/std/fs/struct.File.html
>>
>>92183676
I actually like Go error handling, I think it's simple and nice
>>
>>92183615
Don't collaborate online with friends or strangers, open source has failed with the inclusion of Pust into Linux, and HURD not being finished.
Blender, GIMP and many other good (usable) programs are bad because they're cross-platform.
>>92183627
No, when I say Git, I mean on GitHub, GitLab and stuff that's using Git, in order to keep it shorter, don't cherry-pick.
If you're not sure what I meant (which was obvious), they kindly ask?
...
I give up, this is beyond irredeemable, I'll go write programs...
>>
>>92183107
All the languages with the worst compile time, how nice.
>>
>>92167435
Wow, this looks useful.
Always disregarded property() since I don't need encapsulation. But moving conditional statements into the attribute saves me from typing it out in every function.
>>
>>92183799
>I don't need encapsulation. But moving conditional statements into the attribute saves me from typing it out in every function.
Bro, that's exactly the kind of thing encapsulation is for.
>>
>>92183564
why is it so ugly? what the hell is wrong with trannies
>>
>>92183299
but that's what your little screenshot says
>>
>>92183930
> What the hell is wrong with trannies?
People with mental illness developing (any)thing.
You spend more time reading than writing programs.
Good thing is, C and C++ people got rid of them! (:
>>
>>92183890
Guess I skim over things too much then. Should probably read up on the other builtins and see if there's more I missed.
>>
>>92183723
>Don't collaborate online with friends or strangers
>many other good (usable) programs are bad because they're cross-platform
>No, when I say Git, I mean on GitHub, GitLab and stuff that's using Git

Sometimes I wish you'd post less.

>I give up, this is beyond irredeemable, I'll go write programs...
I think that would be the best thing for everyone.
>>
>>92183930
>why is it so ugly?
Because they fucked up strings. They thought it was easy, when no, it isn't. Now they've got to live with their mistakes, and the result is terrible.
>>
>>92184184
No they didn’t. They have a different string for every possible use case. C fucked up strings and gets railed on about it eternally, deservedly too.
>>
File: noon.jpg (34 KB, 397x284)
34 KB
34 KB JPG
>high-level objects are:
>stable
>low dependency

>low level objects are:
>malleable
>volatile
>high dependency
>>
>>92184213
>>
>>92184213
Low level worship is a nocoder thing. If genuine cniles tried to be as low level as possible they wouldn’t use functions but they do.
>>
>>92184239
idk what you're talking about, but it's essentially arguing that most top-level objects in an architecture should be free functions, which I suppose I don't really have a problem with.
>>
File: worth.png (103 KB, 435x318)
103 KB
103 KB PNG
>>92184281
>>92184219
somewhat more complex of a question is, what responsibility do you leave the classes with?

The answer, of course, is code that can benefit from the class-local lifetime of data, and (presumably) functions that would be too much a pita to call via the function-arg interface (i.e., too many damned arguments to the function).
>>
>>92184597
and on top of that, anything benefiting from RAII, which I happen to have a use for presently in the little project I'm working on.

It is a good purpose, and a good design, I think. For one thing, my new design makes testing much much simpler--and I don't mean unit testing, I mean function testing of the primary components of the system, which is probably just as, if not more, important.
>>
>>92184219
If you cut the crap, you get
algorithm = logic + control  (+ data structure)
>>
>>92165891
Yes genius, the graph shows the history of Sepples. Exception specifiers were in fact considered in the past.
>>
>>92184219
It was perfectly fucking fine before they drew this shitty god damn diagram
>>
File: compare.png (12 KB, 1334x648)
12 KB
12 KB PNG
Ada / C / C++ / Pust
>>
New thread:
>>92185474
>>92185474
>>92185474
>>
>>92165732
> spoiler : he's still watching his shorts



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