[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: [g] meetup - Jan 2026.jpg (446 KB, 850x1133)
446 KB
446 KB JPG
What are you maids working on?

Last one: >>107911916
>>
File: what.png (9 KB, 202x253)
9 KB
9 KB PNG
>>107948319
>>
working with Angular. kill me
>>
>>107948272
I like the canon gender swap art this artist makes. gives me hope
>>
File: file.png (23 KB, 621x346)
23 KB
23 KB PNG
dude these cocksuckers are fucking cheating
>>
File: CPP.jpg (36 KB, 743x434)
36 KB
36 KB JPG
>>107948272
I know absolutely fuck all about , C#, or C++. How accurate is pic rel?
>>
>>107948846
Not accurate because youre supposed to use visual studio
>>
>>107948846
if you write anything low-level and run into a problem, and ask someone about it, you'll get a suggestion like "just strace it to see what it's really doing here". Lotta 'just' suggestions like that, which amount to "just develop on Linux".
If you only targeting an already-ported high-level environment it's not as true. The last time I seriously tried to use Windows, I spent most of my time in Emacs Lisp to make it tolerable.
>>
>>107948875
>youre supposed to use visual studio
nta but I use vscode while developing on and for windows.
Am I doing this wrong?
>>
I have to rewrote and -factor a fuck-huge part of my project, which is killing my motivation.
How do I approach this? This sort of refactor doesn't seem like something you can approach piece-wise.
>>
>>107949410
a. go back in time and write in a language that makes jobs like this both easily and confidently done. OCaml or F# are amazing here because the idiomatic style means you have to touch very little code to make huge changes to types. Statically typed languages in general give you confidence, but rarely much ease. If you wrote this in some shit like Python or JS, just give up now. You don't need that refactor, man. Think of your health.
b. write a bunch of tests and then ask an AI to rewrite it for you, then fix that.
c. find a way to refactor bits at a time. The intermediate results don't have to be cost-free or even an improvement over the initial codebase, as long as they're getting you to the improved final result.
>>
>>107948846
C++ is for faggots, doesn't matter the system.
>t. spent way too much of his life understanding how shitty C++ abstractions are
>>
>>107949141
If youre doing c++ yes
Youre missing on debugging, nuget,cmake and whatnot
>>
>>107949410
>This sort of refactor doesn't seem like something you can approach piece-wise.
that's why you "overengineer" everything in the first place to be modular and low on coupling, so it's easy to refactor
>>
>>107948272
What is it with programmers and trooning out?
>>
>Ultimately, the heroic aspect inherent to writing an efficient compiler is even clearer when one is generating assembly code rather than C.
what did they mean by this
>>
Building a CSI camera decoder with a shitty proprietary toolchain.
Feels good. Feels like real engineering.
Fucking microchip provided examples on how to use cameras for their super expensive dev boards, but almost nothing for their low range one (mpfs discovery kit). So now i have to do everything myself

Why is it so hard to count spikes tho?
>>
>>107948846
generally, programming on windows is painful regardless of the language, c and c++ are specially painful because projects usually expect you to manage dependencies with your system package manager, instead of managing dependencies locally with an ad-hoc package manager (like cargo for rust). you're not supposed to do that on windows, you're supposed to write self-contained programs

c# is the exception because it is a microsoft product and although it isn't pleasant to use on windows, it is even worse on linux

microsoft sells tools to work with c++ on windows, but they are bloated and complex, for example, it's hard to figure out how to fix your build process when the build-scripts are thousands of lines of automatically generated boilerplate. everything is slow and clunky, you can't iterate or stay in a creative flow because you're constantly interrupted by minute-long build times

for all the os-related stuff, like reading files and such, linux is simple and straight forward, windows has very verbose and roundabout way of doing things. for example, if I want to use an event loop with files, sockets, and a gui (x11 or wayland), I can just use epoll or io_uring (liburing): it just works. with windows there are no easy solutions: you have to assign an event to each socket (because they don't have the same interface as files or the gui) and then use one of the os polling functions - all of them have limitations and verbose APIs. microsoft is now trying to replace iocp with a port of io_uring

my guess is that microsoft likes verbose and bloated interfaces because it looks and feels corporate, official even. because it isn't like linux is hiding the complexity of the machine from you and windows exposes it; it's the other way around, windows has interfaces that obfuscate rather than simplify what the machine is actually doing
>>
>>107950019
Meanwhile in the real world Windows is actually used and Linux is a toy for hobbyists who want to stick it to Microsoft epic style by wasting their own time.
>>
>>107950067
it's not 2005 anymore
>>
>>107950136
wait until he finds out that valve will sell linux gaming machines to normies
>>
A=3
For in…a:
Print(profit!)
>>
>>107949747
if you generate C then there's a lot of optimization still pending that you don't see in the compilation result, but your compiler will still give you good performance outcomes because of it.
if you generate assembly then you skip all that optimization and now have to live with the quality you're bringing.
this is even more of a true statement if you're targeting cheap embedded CPUs that won't commit witchcraft with your machine code.
>>
>>107950136
nta and I agree but I WISH it was 2005 again
>>
>>107949500
>If you wrote this in some shit like Python or JS
even worse... it's in C...
>find a way to refactor bits at a time
I've tried "unrolling" a "function call chain" into a single huge function. They originally served quite a nice purpose, but unforeseen requirements hade them acquire loads of side effects which gutted their original encapsulation.
But the other "call chain" branches a decent bit, so honestly I'll have to understand how it works in the first place, lmao. Worst thing is that the last time I properly worked on this was in September.
>>107949723
originally it was quite decoupled. Every function just added its own little node without affecting any other. But then requirement creep set in...
>>
>>107950067
windows let a girl redesign the right-click menu so that you have to click twice to get to the real right-click menu.
windows is now betting everything on it being a really cool feature to have AI see everything you do.
it's dead, bro. Move on. I've gone my entire career without having to use windows. The Windows UI is such shit now that nobody cares anymore if you don't use native toolkits, either.
>>
>>107949747
who said that?
It just means that C code get optimized by optimizing compilers and the generated can get quite good, while assembly doesn't get optimized, it just gets assembled.

It's possible to some optimizations of assembly code though, like instruction scheduling, peephole optimizations and branch displacement optimization. Of course can always lift the assembly to IR for further optimization but then there is no point in writing in assembly in the first place.
>>
>>107949984
>Why is it so hard to count spikes tho?
With an event camera? Because they tend to come in bursts all at once. The data rate goes crazy then, even with tiny messages for the spikes. It's particularly a problem when you rotate the camera about a vertical axis (side-to-side).
>>
>>107950798
>With an event camera?
No as a human solving nu age retard captchas.
All the captchas are easy as fuck, but the star counting takes me way too long
>>
>>107951056
Skill issue, just feel the angles between the spikes.
>>
>>107948272
Anything that ruins the life of reddit moderators is a good thing.
>>
>>107949984
that shit looks harder than anything I've ever done, and I have a hunch you don't make nearly as much money as I do (could be wrong though).
>>
>>107950067
>in the real world Windows is actually used
In the real world of Betty the Butch sending her shitty corporate emails every Monday morning and then fucking off for the rest of the week. The world runs on Linux. When you're shopping on Amazon, buying a plane ticket, stalking your ex on Instagram or watching something on Netflix (or maybe Crunchyroll for you), there's a Linux server behind that.
>>
>>107948272
After implementing string interpolation at the language level for this little dsl I'm working on, I've decided string interpolation at a language level is a terrible idea.
>>
>>107951432
>string concatenation "at the language level" is a bad idea
severe skill issue
>>
Has anyone been in a similar situation? I took over a project to build an automation system for a major retailer about 2 years ago and had it running within weeks and have improved it since. Despite being in a non technical role, and every hand over to those in technical roles designated for it for a year+ could never do it, I was the only one who could build it. Now I have all these skills, and experience/portfolio but its not evenly spread across every expected skill or tech stack of a software engineer etc and I'm trying to get into something proper role elsewhere
>>
>>107951302
>muh servers therefore you should use Linux as a desktop os
>>
>>107951432
>little dick sucking lips???
What did he mean by this
>>
File: 1704073328790363.webm (1.79 MB, 1920x1080)
1.79 MB
1.79 MB WEBM
>>107950589
>Of course can always lift the assembly to IR for further optimization but then there is no point in writing in assembly in the first place.
Emitting machine code directly means dealing with linking address resolution and variable width instruction insanity
>>
>>107948272
Apparently I am doing OOP in C now or is it MOP Modular Orientated Programing?
>>
>>107951533
>linking address resolution
>variable width instruction
>insanity
indeed. by IR I mean optimizting compiler's IR and by assembly I mean writing instructions using mnemonics (add, mov, etc..), not literally 01 d8
>>
>>107951547
have you tried using vim?
>>
>>107950224
Doesn't matter, because there's no alternative. People WILL stick to Windows.
>>
>>107951695
Yeah but as my configuration grew so did the start up time.

Nano has syntax highlighting, multibuffers and autocomplete which is all I need.
Splits would be nice but eh.
>>
File: 1769177393662.jpg (129 KB, 1155x791)
129 KB
129 KB JPG
>>
>>107951761
>Arduino studio
shiggy diggy
>>
>>107951477
String interpolation using templates as seen in python and js bloats the compiler with shit that could be just a function in the stdlib, like in C, Rust, Go etc.
>>
>>107951912
Most retarded post of the week award.
>bloats the compiler
The amount of code required to transform interpolated strings into explicit concatenation is fucking nothing and even if it weren't, the goal of a compiler is to produce clean code on a clean VM (if any), not to be light and clean itself.
>>
If there's one thing I've learned about PLs it's that making economies on the complexity of the parser, type checker and compiler is legitimately mental retardation. You're not economizing jack shit and you are going to pay the price of the poor language/compiler every single fucking day that you use the language.
>>
File: 1735691887174603.png (99 KB, 711x928)
99 KB
99 KB PNG
>>107951432
a = 1.0
string_compare("{a}", "1.0")

This is false in Finland
>>
>>107948272
testing
>>
>>107952448
Luckily Finland isn't a real country, so who cares.
>>
>>107952534
You're finally awake
>>
File: arduinoide.png (517 KB, 1655x960)
517 KB
517 KB PNG
>>107951761
newer ver
>>
>>107952572
This is why my nokia receives no calls
>>
>>107952421
Yeah but it means only wizards get to contribute new features and fixes, and eventually the compilers stagnate (i.e g++, rustc, ghc).
>>
the humble printf debugger will always outshine gdb virgins
however, i personally am a fan of core dump debugging
i throw in a lovely
volatile int *x = (void *)0xDEAD;
x++;

and take a peek at the resulting core dump to get register values, a stack trace, etc.
>>
>>107953059
>no dereferencing
>>
>>107953106
whoopsie, i typo'd
i meant
volatile int *x = (void *)0xDEAD;
*x++;
>>
>>107953059
>>107953136
oh wait, no
i'm being retarded
i think what i actually do is
volatile int x = *(volatile int *)0xDEAD;

god i need to get more sleep
>>
>>107951547
That's not OOP in C, at least the bits you show us. The Timer-related functions aren't taking (or returning) a Timer or Timer* (or index into an array of Timers) to say which one they're operating on.
>>
File: eyeroll.gif (1.34 MB, 560x315)
1.34 MB
1.34 MB GIF
>>107952448
You're using the system locale to determine ordinary language semantics?
>>
>>107952922
It's really language design I had in mind and in particular scripting languages.
A few of them have simplistic syntaxes and they are a pain in the ass to use: Lisp but also Lua. The rest of them don't mind having complex syntaxes (not that complex is good).
What they share however is an inexistent static type checker (dynamic typing), limited name resolution ("who cares we have late binding"), very bare bones compilation that doesn't even bother afaik to link static data to the code, and the result is a VM and runtime more complex (and slow) that they should be (1 function with 1 loop and 1 switch is all you need).
These absolute cretins don't give a shit about making complex primitive types, VM, GC and libraries, etc.. but they WILL NOT make a proper frontend and bytecode compiler even though it would make the overall interpreter much simpler.

Something similar can be said for imperative languages in general except that it would be the compiler front end that is too simplistic and because of that the language's spec is messy, overly complex and all kinds of bad. With actual compile time stuff and a 21st century type system there is so much bullshit you can avoid.
>>
File: 1749919190923597.png (78 KB, 843x896)
78 KB
78 KB PNG
this is unironically a great interview question
>>
>>107953301
hashtable + binary heap
>>
File: 1754171044446923.png (26 KB, 128x128)
26 KB
26 KB PNG
>>107953494
nigga just failed an swe2 interview
>>
>>107953507
no, it works
>>
>>107953301
i don't know how to do this, and i work in one of the more prestigious fields that it's possible to work in
turns out real life isn't retarded algorithm circlejerking
>>
>>107953535
how?
calling get() moves the key + value to the front of the cache. If you're using a heap to keep track of it's index in the list then it would take at worst case O(n) time to find it's place in the heap, remove it (which would take worst case n(logn) time to repair), and then insert it again into the top of the heap

are you suggesting something else? the first time I saw that problem I tried a heap as well and it didn't work
>>
Most valuable unskill?
>>
>>107953551
alternatively, maybe you could try keeping a count of how many items have been inserted into the cache, and then dumping new items into the heap with an incrementing pointer. If the heap is ever more than N capacity, you would pop the minimum (least used item) from the heap.

The problem there is that you wouldn't be able to keep track of how many unique items are in the heap. So If the capacity of the cache is 4, you put in "faggot", "jeet", "troon", and "nigger", then call get() on key "nigger" 4 times, pruning the least used element each iteration, your heap would end up looking something like

[(nigger, 4), (nigger, 5), (nigger, 6), (nigger, 7)] - which means only 1 unique item, even though the capacity is 4.
So now calling get() on "faggot" would return null.
>>
>>107953551
For get(), I thought I wouldn't need to remove and insert back, but even that would still be O(log n), not O(n).
I think hashtable + linked list would work, where hashtable entry points to link list nodes, or are directly nodes of the instrusive linked list.
>>
>>107953633
>I think hashtable + linked list would work
yeah the solution is a hashtable + double linked list
>>
>>107953301
first pass, would need more time to make it faster
    class LRUCache {
public:
using lru_iterator = std::list<std::pair<int, int>>::iterator;
std::list<std::pair<int, int>> lru;
std::unordered_map<int, lru_iterator> cache;
int cap;

LRUCache(int capacity) {
cap = capacity;
}

void use(lru_iterator& it2)
{
auto i3 = lru.emplace(lru.end(), *it2);
lru.erase(it2);
it2 = i3;
}

int get(int key) {
auto it = cache.find(key);
if (it == cache.end())
return -1;
else
{
use(it->second);
return it->second->second;
}
}

void put(int key, int value) {
auto it = cache.find(key);
if (it == cache.end())
{
if (cache.size() == cap)
{
auto it3 = cache[lru.front().first];
cache.erase(lru.front().first);
lru.erase(it3);
}
auto i3 = lru.emplace(lru.end(), std::pair<int, int>{ key, value });
cache[key] = i3;
}
else
{
*it->second = std::pair<int, int>{ key, value };
use(it->second);
}
}
};
>>
>>107953683
            // auto i3 = lru.emplace(lru.end(), *it2);
// lru.erase(it2);
//it2 = i3;
lru.splice(lru.end(), lru, it2);

beats 88%
>>
>>107953538
FANG web frontend sure is prestigious.
>>
>>107954059
unless he started off as some intern paper stacker monkey half a decade ago when you could get in with just a degree + understanding how arrays work, he can't even do that. fang will ask you leetcode hards for shitty webdev jobs in 2026.
>>
>>107954068
Luckily I don't take Python rat-shops seriously.
>>
File: file.png (109 KB, 650x803)
109 KB
109 KB PNG
>>107951547
>>
File: 1744925905004598.jpg (129 KB, 1080x1097)
129 KB
129 KB JPG
>>107950067
And you are taking someone else's OS choice personally.....why?

>>107951713
As a general purpose daily driver OS for Netflix, gaming, or web browsing, sure. For power user shit or software development, there's a reason a lot of developers prefer Linux or even MacOS (unix based so easy to use if you're already family with Linux) than Windows. Isn't to say developing on Windows is impossible but like the other said it just fucking sucks ass even for small scale pet projects compared to pretty much everything else.
>>107951510
See the above paragraph. Stop treating OS choice like it's some character flaw.
>>
>>107948272
JSLinux now has x86_64, so I forked it and added 16 color mode support and a bunch of other stuff to get TempleOS working in the browser
>>
>>107954595
Thud sounds like heresy to me
>>
File: ring0.png (21 KB, 1258x646)
21 KB
21 KB PNG
>>107954639
Ok
>>
Good morning saars

Question:

Can someone explain to me, in baby terms, what exactly namespaces and classes are in C#? I know what a function is, a function is something that does something. Someone else wrote some functionality that you can call upon and use, or you can make your own shit up, got it. Is the point of classes and namespaces simply to organize things? Console.WriteLine so I get that all "Console" functions probably does some shit in the console, what about the name space though? Is it all simply just a folder structure to keep your functions organized? Do you actually make your own classes normally in a project? I can sorta see the upside of functions being divded into groups, but I'd also find it mildly annoying if you know what function you want to use but you just can't remember which class it belongs to.
>>
File: FishBowlOfTheBetta.jpg (95 KB, 640x480)
95 KB
95 KB JPG
>>107954649
based
https://i.4cdn.org/wsg/1769250210736746.mp4

I just realized these days that there are people that are allowed to post on this forum, that were 12 when terry died. Fuck people.
>>
>>107954663
**Namespaces** = Yes, basically folders. Just prevents name collisions so two `Button` classes from different libraries don't clash. That's it.

**Classes** = More than folders. They bundle data + functions together into a "thing."

```csharp
class Player
{
public int Health = 100;
public void TakeDamage(int amount) { Health -= amount; }
}
```

Now you can create multiple players, each tracking their own health. A blueprint for objects.

**Do you make your own classes?** Yes, all the time. Anything that's a "thing" in your program (User, Order, Enemy) typically becomes a class.

**The annoyance factor?** Real, but IDEs autocomplete everything so it's rarely an issue in practice.
>>
>>107954569
I don't listen to alcoholic cats either.
>>
>>107954780
namespaces a a bit different than folders, in C# at least you can have partial namespaces, that makes them more like tags

didnt read the rest of your post considering the first thing you said was wrong
>>
>>107954780
Alright I get the player thing. But what purpose does it really serve putting it into a class or even a namespace? You *could* just put it in a normal method/function no?

"Game.Players.Player"

and just "Player" are kind of equally descriptive?

can you make a function without putting it into a class?
>>
Are there any implementations of the Burrows-Wheeler transform that operate on 4-byte or 8-byte arrays? All the examples I've seen are for byte arrays (e.g. text)
>>
>>107955351
You should be implement it as if it simply used 4/8-byte chars instead of 1
>>
>>107955013
I don't know. I have never written any C#. I thought C# and Javascript guys are the same, so I just asked AI.
I am busy debugging CSI camera issues. I almost can communicate with the camera over hardware (fpga)
>>
>>107955845
Appreciate the answer either way. I can see sort of why it makes sense.

Last question before you go, is there a leetcode for ABSOLUTE beginners? im talking third grade shit where i can practice
>>
>>107955013
>But what purpose does it really serve putting it into a class or even a namespace?
Putting a function into a class (therefore becoming a "method", not just a function anymore) helps you organize things but also saves you from passing a lot of data as arguments from place to place. Since the method is part of the class, it has access to all the class attributes and you don't need to pass them in when you call the method. Silly example now but just imagine this on a bigger scale:

class Rectangle()
height = x
length = y

def area():
return x * y


otherwise whenever you called area you'd have to do area(x, y)
>>
>>107955872
I think exercism.org is pretty easy, the initial problems come with a guide and explanation. Plus, you should be doing leetcode with chatgpt (free version available) open on the side to explain everything to you. Another easy one could be CodeWars
>>
>>107954780
>**Classes**
>They bundle data + functions together into a "thing."
meaningless nonsense. what thing?
people struggle with OOP because of that saying
>>
>>107955918
Will check it out, I just need some third grade shit so I can slowly work my way up through problems. I know you guys will laugh but I am not ready for fizzbuzz just yet
>>
hi, i’m trying to work on a pull-request manager native app (only for the mac right now because i’m a swift dev mainly) so i can do code reviews without opening a browser because the github/gitlab ui is so fucking slow

i know most native text editors use tree-sitter for syntax highlighting and that's written in rust (but there's an official wrapper for swift)

is it worth only focusing on the mac app rn and using that wrapper to keep it simple or should i split into a library that manages the accounts/etc a user connected written in rust that integrates with tree-sitter and provides the "backend" of my app? I feel its a trade off on speed to solve the problem quickly x complexity but flexibility to create a gtk/qt/etc frontend if i want to port it to linux. What would you do?
>>
>>107956022
>what thing?
whatever you're implementing that is meant to have data + functions (more accurately, state + behavior)

one of the reasons people struggle with OOP is that they aren't taught to design solutions around object orientation, and instead just shoehorn OOP syntax/language into non-OOP problems (and then they conclude that OOP itself is wrong)
>>
>>107956022
>I know you guys will laugh but I am not ready for fizzbuzz just yet
I failed to code a proper fizzbuzz on my first ever real interview. It's ok. We've all been there.
Maybe if you're at this stage then leetcode or whatever are not the best thing, maybe try a book that explains things thoroughly and has you type along to some basic code.
People say your first couple of leetcodes are the hardest, and you shouldn't feel bad if you can't do them and have to look up the answer. It's not cheating to look up the answer, do it enough times and you'll start to understand.

Are you actually starting out your learning journey with C#?
>>
>>107956268
How much, do you anticipate, is GUI performance going to be an issue? And how much of it is going to be solved by working around the abstractions of your toolkit?

There's your answer.
>>
>>107956341

Gui performance is something I wouldn’t deal with in the library, i’d deal in the app. For mac is mostly dealing with TextKit, the trick is to use some form of virtual scrolling and estimating the size/recalculating as its highlighted/layouted.

It's mostly motivated by the fact browsers eat memory like crazy.
>>
>>107956374
In that case I would try with prototypes on each system that are fed garbage data and see how they perform.
>>
>>107956404

I didn’t write the renderer yet because I know its complex, its very initial stages, I’m just thinking how I should structure the project

Option 1: do everything in Swift: connecting to GitHub API (and storing tokens in keychain) + getting list of reviews etc + showing the pull request diff (and using git to do so maybe?) + comments + syntax highlighting is provided by tree-sitter via the existing wrapper + renderer is in swift

Option 2: move api + git management + caching + etc to the library, as well as the interface for syntax highlighting (by using tree-sitter directly) + have uniffi generate the bridging code -> the app is just a wrapper over this library containing ui + renderer

The advantage of option 2 is if i want to write a gtk version of the app/text renderer in the future is a lot easier, but i pay the penalty of having to set-up interfaces myself etc (rust would be ideal because of portabilty)

I’m doing this project out of anger desu, because the github ui sucks

If there’s a tui that lets me review code and idk about it, i’d really love to hear
>>
>>107956475

follow up: i wonder actually if there’s a way to do somewhat distributed reviews on top of git (maybe storing in .git baka and getting it synced)

i know git notes exist, not sure if its possible to build a merge request review system on top of that to say “fuck github”
>>
>>107956475
>I didn’t write the renderer yet because I know its complex
Talk about putting the cart before the horse.
>>
>>107956561

Just trying to solve one problem at a time man. But I guess I can try doing that. It actually makes sense.

Thanks.
>>
>>107956306
>whatever you're implementing that is meant to have data + functions
This literally doesn't mean anything, it's completely incoherent.
Unless you're talking about an actual object in a 3D game engine, nothing you program "*HAVE* data and functions".
You write functions that maniuplates data or state, functions that implements some logic, you implement data structures by (wait for it) writing functions.

You have a semantic gaping hole, fix it.
>>
>>107956967
the "semantic hole" is on your side, Rakesh

>You write functions that maniuplates data or state, functions that implements some logic, you implement data structures by (wait for it) writing functions.
which means fuckall without an actual problem or context of what you're implementing

here is the peak of your "just write functions and structures" mentality:
https://www.youtube.com/watch?v=m_Dp4nMr_AY
>>
SIMD.
Mode switches.

That's enough to never focus on single objects.
>>
>>107957098
>which means fuckall without an actual problem or context of what you're implementing
as opposed to "behavior"? "putting function and data together"?
>here is the peak of your "just write functions and structures" mentality:
No that's what I said, that's not how I would describe OOP. I didn't even try to describe OOP, I merely showed you that your conceptions are incoherent nonsense. You were supposed to rebound on that. If I didn't want you to rebound I would have insulted you, but I refrained myself to do that.
>>
>>107953301
More annoying than it seemed at first.
I don't care to clean this up.
>>
>>107953301
Very fun datastructure, I think I first learned how it is implemented back when the whole refterm thing blew up
>>
File: archbtw.png (592 KB, 492x611)
592 KB
592 KB PNG
CSI/MIPI is fucking disgusting and should've been aborted. Fucking piece of shit bitch.
Holy fuck.
And then the fucking bitch vendors can't even provide datasheets for their cameras so one can use them. Fucking hell man
>>
I am a software developer. I am fluent in several programming languages, including css, js, html, but I have zero design sense. It's an alien concept to me, and my company knows this.
But for some reason, they've put me, and me alone, in charge of converting figma documents into functioning templates and entering the content after it's been approved. I look at it and it's all noise. It's not software development. It's frontend web design and account manager work.
I have explicitly stated on numerous occasions with increasing intensity that I am not suited for this task but I am dismissed at every turn. I even tell them that what I give them is going to be a substandard product, but they still don't care. I don't get it, because it's causing my real work to suffer.
The best part is I haven't gotten a raise in years and at the end of the day, I make less than I did even last year, and there are no raises in sight. Even though I've been told I am critical to the operation of the company, which I believe, but they don't act like it.
How do I make my company understand that I am not a designer or a frontend person? Or is this some kind of silent firing bullshit that I'm experiencing?
>>
>>107958211
maybe just quit?
>>
>>107958236
I live in the good ol' US of A where a missed paycheck means my family has to live in our car that is two missed payments away from being repossessed. And if I can't pay for my hear meds that I only need because I sacrificed my health to git gud, I'll die. And since my name isn't Rajesh or Pablo or Lequinzia, I'm on my own.
>>
>>107958277
What are you new responsibilities with that design review exactly?
>>
>>107958211
You don't need design skills to implement figma designs in front end. Figma gives you all the distances, fonts, etc and data you will need, and your job is to express them in CSS and JS so it properly handles dynamic content, viewports, etc. This is purely programming task with virtually no place for creativity.

>>107958211
>I even tell them that what I give them is going to be a substandard product, but they still don't care. I don't get it, because it's causing my real work to suffer.
This is not your problem. Your responsibility is to inform managment that the task assigned to you is beyond your capabilities. If they are aware of that and still want you to do it then just do it however you can and if anyone questions the quality of your work point them to that snippet of chat where the management said they are fine with possibility of such outcome.
>>
>>107958287
Converting a figma doc into a working template and adding the content once it has been approved. They expect a pretty good match between the design and the markup. And the content will need to be entered correctly.
I don't do content, and never have. I have minimal interaction with the frontend. The most I do is create dummy data with a script so we know what it will look like and build the CMS that the account people use to flesh out the frontend.
>>
>>107949508
That is rust, not C++, you stupid piece of shit.
>>
>>107958393
>Converting a figma doc into a working template and adding the content once it has been approved
So you have to design the frontend in Figma, let them approve it and then apply it in code?
So they want you to be a designer?
>>
>>107958277
>a missed paycheck means my family has to live in our car
you are a fucking adult. Take charge of your financial situation and fix your shit. Stop paying for Netflix, Hulu, Disney and HBO, get serious. Stop eating takeaway slop every single day and start cooking at home. No more $8 Triple Fudge Sundae coffee shit from Starbucks. Sell one of your 3 cars. Just get your shit together man.

And start looking for another job while holding on to your current one, then you can jump ship.
>>
>>107958428
>work harder goy
NEET imageboard
>>
>>107958362
>You don't need design skills to implement figma designs in front end. Figma gives you all the distances, fonts, etc and data you will need, and your job is to express them in CSS and JS so it properly handles dynamic content, viewports, etc. This is purely programming task with virtually no place for creativity.
It is frontend work. I am not a frontend dev and I never have been. This "purely programming task" is alien to me and full of subjective and never ending scrutiny because I don't think like a frontend person.

>This is not your problem. Your responsibility is to inform managment that the task assigned to you is beyond your capabilities.
It is my problem because if I don't deliver, even after I've told them its not something I can do to their expectations, I will suffer for it.

And if you are a 100x rock star that can replace an entire department, good for you. Truly.
>>
>>107958211
Skill issue. Rajesh, Pablo and Lequinzia will take your job, and each one will bring five more of their family members into the US.
Shame on you.
>>
>>107958428
Shut up boomer.
I already live at subsistence level because I get paid less than industry normal. I'm looking for a new job, but you may not be aware, but your generation fucked their children over and it's very hard to find work.

>>107958425
I have to implement the markup based on a figma doc, that then needs to be populated with content. It is purely frontend and account manager work.
>>
>>107958505
I guess it was my fault for only spending 16 hours a day for decades in front of a keyboard instead of 20. Better luck next time, I guess.
>>
>>107958487
>It is frontend work. I am not a frontend dev and I never have been.
Well, you said you know CSS and HTML. So it would be expected that you can take design and implement it. What else it takes to be fluent in CSS? Memorizing properties without knowing how to use them?

>I will suffer for it.
It's self-inflicted. No one can accuse you of bad managment decisions. Just make sure you document the fact that managment was informed beforehand of potential consequences of their decision.
>>
File: card.png (302 KB, 540x841)
302 KB
302 KB PNG
>>107957915
fun suggestion!
>>
>>107958520
What is your role?
>>
File: 1758512276064674.jpg (273 KB, 1085x1080)
273 KB
273 KB JPG
>>107948272
Generating these kind of images (can a anon tell me what they are called?).

At first I tried simply calculating the average red, green and blue value of each image, checking the distance (simple sqrt(x*x+y*y)) between that and each individual region/pixel and used the image with the smallest distance. Turns out that doesn't work well and I instead create a histogram with bins for specific groups of colors and compute the Bhattacharyya difference between the histograms. I think it looks nice, but feels like it could look better.

Link because image is too big: https://fi.c99.st/83bfmvth.png
>>
>>107958553
>Well, you said you know CSS and HTML. So it would be expected that you can take design and implement it. What else it takes to be fluent in CSS? Memorizing properties without knowing how to use them?

Just because I can read html and css doesn't mean I can implement something useful with it, even with guidance. It's alien to me.
I can also read sheet music, but I can't write music.
>>
>>107958592
So you can visually parse CSS. Impressive.
>>
>>107958578
I am a software developer. It is purely a matter of convenience for my company that the interface is usually a web browser. I rely heavily on Foundation and Bootstrap for the interface.
It's not that I can't do web stuff from scratch, it's that it takes forever and is never what the users want because it is a subjective hellscape that is alien to how I think.
>>
>>107958211
>I have zero design sense. It's an alien concept to me, and my company knows this.
>But for some reason, they've put me, and me alone, in charge of converting figma documents into functioning templates and entering the content after it's been approved
It's very simple my dude: They hate you and want to get rid of you, or at the least crush your ego. So they assign you a task they know you'll fail so they can lambaste you for it.
Start looking for other jobs.
>>
>>107958211
>>107958542
lol zoomers are insane. why cry just do it. you can literally have ai write front end and do design. you can literally PASTE IMAGES INTO IT AND GET CODED DESIGNS OUT. someone is paying you to learn to get good. I know you wont though. I know you'll go to reddit and cry there and tell everyone 4chan was mean to you. KEK. Try this at least before you autism rage quit. I'm genuinely trying to help your sorry ass. https://v0.app/
>>
>>107958618
I'd say just learn Tailwind and learn flexbox and then implementing it should be pretty easy. The best situation for you will be if you just learn it.

But probably do start looking for a new job
>>
>>107958609
>So you can visually parse CSS. Impressive.
I don't know if that's sarcasm or a gotcha, but it's accurate. It is also a completely different skill than being able to create something that looks right.
>>
>>107958588
Reducing the amount of bins seems to produce "better" images due to there being less noise.
https://fi.c99.st/nrfdykus.png
https://fi.c99.st/1v9s84mt.png
>>
>>107958419
>every day complete retards manage to get killed by the cops
>yet you survive another day
Fucking grim.
>>
>>107958637
Tailwind is a meme. If I wanted to use that, I would just inline the css and have the template parser inline the values. And I love flexbox. And I am looking for new work. I don't get paid well enough for what I can do, let alone this stuff outside of my job description. Plus, I feel like I'm forgetting how to do the stuff I'm good at.
>>
>>107958472
at no point in my post did I even insinuate anything remotely like "work harder", you faggot. What I said was "consoom less". Are you a little consoomer soi boi who can't give up his triple frapuccinos every day?

>>107958520
alright then, if you're already at subsistence levels then I feel for you. I know the market is fucked, but keep looking, something will come up eventually. Best of luck, bud. And don't forget: a firm handshake can do wonders!
>>
>>107958634
>zoomers
That is a deep cut.
>AI
lol. I already have enough work I don't want to do. Why add more?
>git gud
I am already good at my job. This isn't my job, no matter how much they try to insist otherwise.
>>
>>107958733
>This isn't my job
Then this isn't your money either.
>>
>>107958733
ngmi
>>
>>107958588
Lol that's pretty good honestly. They're called Photo Mosaics I think. I thing you did pretty good honestly. I think the image you chose to create is just a bit hard because you're reproducing every single pixel. I'm gonna link you this ascii art thing. It might not seem related, but basically they break the image into a grid and try to reproduce each grid space with an ascii character.

https://alexharri.com/blog/ascii-rendering
>>
>>107958733
I want to take this opportunity to appologize to Trump. I thought deporting illegal mexicans and importing millions of indians on tech visas was insane, but now I understand. Honto ni gomenasai Trump-dono.
>>
why does everyone outside of india hate object oriented programming?
>>
>>107958856
>>107957163
>>
>>107958856
Because all the people recommending it overengineer their programs.
>>
>>107958745
>ngmi
That has been perfectly clear for some time now.

>>107958744
>Then this isn't your money either.
There used to be a time where making someone do something outside of their job description wasn't allowed.
>>
>>107958856
Because India has thousands of gods, so they like to think in that system and have thousands of classes to maintain

But a white man has only one God and only one paradigm - a Function
>>
>>107958869
>There used to be a time where making someone do something outside of their job description wasn't allowed.
Lol. Lmao
>>
>>107958807
Maybe I should just discard my shame and monkey-typewriter this shit. Clearly, that's all they expect anymore. Quality and pride be damned.
>>
>>107958884
>Lol. Lmao
Care to provide any meaningful input, or have you forgotten how?
>>
>>107958869
Honestly, it could be their attempt at getting you to leave. And if you do this >>107958362, especially the "inform managment that the task assigned to you is beyond your capabilities" part, you are giving them exactly what you want.
You know you have to leave this job. Just find a way to stay afloat until you find something. But are you looking? Are you applying? Are ya winning, son?
>>
>>107958856
I like OOP has a feature but hate it as an all-or-nothing paradigm. It's not a paradigm.
>>
>>107958856
We do data oriented programming now, chud.
We are enemies of (the) state.
>>
>>107958925
>Honestly, it could be their attempt at getting you to leave.
That is now painfully obvious now that I've sat down and thought about it.
>But are you looking? Are you applying?
Oh, yes. I am.
>Are ya winning, son?
:(
>>
>>107958923
>Care to provide any meaningful input
Get to work zoomie. I wouldn't fire you for bad web front end. But I would definitely fire you for "I won't even try" attitude.
>>
>>107958954
I am trying. That's the problem. In the time it will take me to deliver a half-assed product I don't understand, a frontend person could do it 6 times. I try to explain that, but they don't care. Maybe they don't care and are using that as an excuse to charge more. Because it makes no sense otherwise.
>>
>>107958978
Maybe you should just get over your fucking autism.
>>
>>107958978
>In the time it will take me to deliver a half-assed product I don't understand, a frontend person could do it 6 times.
Not your decision, not your problem.
>>
>>107958990
>>107958999
I'm beginning to realize that pride in my work and competence really are old fashioned notions that I need to let go of.
>>
Rewriting libc in Rust.
>>
>>107958947
trying to help here: find an ai that can help you with design, it's what they do (they just copy the design from other sources). Then stall as much as you can without jeopardizing your job, and put as much time as you can into your job search. You can do it anon, I believe in you.
>>
>>107959058
What platform?
Redux OS already has Rust libc rewrite for their system.
>>
>>107959067
All of them, except I write better code instead of copy pasting cnile slop
>>
>>107959065
Thanks. I avoided using an AI because I take pride in my work and it usually causes more problems than it solves, but I think those are outdated notions that no longer apply. Slop garbage that is unmaintainable and malfunctions at every turn is better than nothing at all, even if it causes scores more work down the line.
>>
File: maxresdefault (9).jpg (147 KB, 1280x720)
147 KB
147 KB JPG
>>107958856
>why does everyone outside of india hate object oriented programming?
I'm "maintaining" and object oriented indian code base. Nobody can do anything because of how abstract and hard to follow it is. Even AI can't help. Noobs think its good because they see OOP 101 class Dog :: Animal :: Friend deal. But in practice its actually a fuck ton of service objects and business logic layers abstracting things like security and permissions. Web is just REST and CRUD that's it. It's a solved problem. When each fucking database entry has to be represented as its own special class that inherits from a main class and permissions and business logic get their own service objects you're gonna have a bad time. It's the same reason game programmers use entity component pattern. With objects you end up essentially writing a digital representation of everything in your process and emulating it when all you ACTUALLY need is the data and the result of that process. It's complexity for complexity sake. Imagine making Apple Crumble by first making a complete Apple Pie step by step and then squishing it into crumble. Then the PM comes in and tells you actually we're making Apple Tarts now.
>>
>>107959100
Once you're out of the danger zone and steady in your new job, take the time to internalize that your employer doesn't give a shit about you. They are not loyal to you, and you shouldn't offer them any loyalty either. I was also severely underpaid at my first job while colleagues from other departments were getting great salaries. I just found another job and left, no remorse. You should only be loyal to your family. Chin up bud, you can do this.
>>
>>107959078
libc is the interface between your platform and C. You don't write libc for all the platforms, you write them separately.
>>
>>107958588
Maybe reduce the number of colors as a first pass?
>>
>>107959142
Thanks. I'm applying to jobs that pay literally double for a fraction of the skillset I have, so hopefully something comes of it.
It has been hard to come to terms with the fact that no matter how well you think you know your boss and coworkers, at the end of the day they would sell you to the devil for a nickle. Which is fine. Less people for me to care about at the end of the day.
>>
>>107959220
Personally, I love that the era of zero-interest capital is over. Means that useless faggots like you have a much harder time justifying their salary.
>>
>>107959238
Enjoy nothing working ever again once people with skill and pride in their work are driven out of every sector of society.
>>
>>107959289
Don't threaten me with a good time.
>>
>>107957636
what's confusing you about the word "behavior"?

>what is behavior in the context of oop
>In object‑oriented programming (OOP), behavior refers to what an object can do—the actions it performs or the responses it gives when interacting with other objects.
>
> What “behavior” really means
>Behavior is expressed through methods (also called functions or operations) defined inside a class. These methods describe how an object acts based on its internal data (attributes) and the messages it receives.

>No that's what I said, that's not how I would describe OOP. I didn't even try to describe OOP, I merely showed you that your conceptions are incoherent nonsense.
what you actually did was just show that you're prejudiced against OOP either out of extreme ignorance or extreme lack of skill (and i don't really care which one it is)

ok, you don't "get it" - too bad for you. you're not entitled to have someone explain it to you until you get it.
>>
>>107958856
not "everyone"
just NEETs that got filtered by it and are unable to land a job as a programmer
>>
>>107959103
you're blaming the paradigm that's been used for indians writing shit code
look at it another way - you can still recognize services and abstraction layers at all. if it were purely procedural code written with the same amount of skill, you would not find fucking anything

>When each fucking database entry has to be represented as its own special class that inherits from a main class and permissions and business logic get their own service objects you're gonna have a bad time.
it really depends on how well it's implemented, and how well it fits the actual requirements
the enterprise software i'm working with does basically this (but way more complex than what you describe) and the result is a delightfully transparent persistence layer for working with business data objects
it's been designed and implemented mostly by white people, though
>>
File: lru.png (662 KB, 1314x2527)
662 KB
662 KB PNG
>>107958557
>val=0
>return -1
I thought this only looked ugly, but after rewriting it in OCaml I truly see. The types are incoherent; an empty cache and a populated cache are subtly incompatible.
truly those that write Python wander in darkness, committing great sins with no awareness of what they do.
anyway nice code and lib.rs/silicon sucks with OCaml holy shit
>>
>>107959365
It was overused, but it also makes expressing some problems a lot easier. I figure that makes it a good tool to have in my toolbox, but only an idiot has one tool for everything.
There's a lot of midwits about who can't handle needing to think about when to apply something. They aren't even at the level of a journeyman craftsman. Good thing they're easy to replace with AI, unlike people with an actual brain.
>>
>>107959460
Returning -1 to say that a key isn't in a map is bad Python too, and there's an LRU cache in the standard library.
>>
>>107958856
It's just fucking stupid. I've been playing with C# recently because the workstations at my job all run Windows, and for all the cool it brings it also brings stupid. Lisp has this figured out just fine; a class is just like a closure. Inheritance is stupid and pointless and bloat. There's no reason to force everything to be an object when it doesn't need to be, especially in the case of C# when you're manipulating C or C++ functions.
>>
>>107959460
:O wow I'm not gonna lie your OCuml looks pretty nice. like some sort of typed lua haskell baby. every blue moon I try to switch to some functional or typed language... but the python std's are too strong. It always pulls me back.
class LRUCache:
def __init__(self, capacity: int):
self.capacity = capacity
self.dic = collections.OrderedDict()
def get(self, key: int) -> int:
if key not in self.dic:
return -1
self.dic.move_to_end(key)
return self.dic[key]
def put(self, key: int, value: int) -> None:
if key in self.dic:
self.dic.move_to_end(key)
self.dic[key] = value
if len(self.dic) > self.capacity:
self.dic.popitem(False)
>>
>>107959536
I actually like Go's version. You get Structs and thats it. Structs are just data and you can attach functions to that data in a way that makes OOP people think its classes... which is oddly similar to javascript now that I think about it.
>>
>>107959541
>import solution;
>>
>>107959536
>force everything to be an object
and there's your problem - instead of making proper objects, you make non-object constructs and then force them to be an object
which, completely expectedly, doesn't work
>>
>>107959674
>>import solution;
this! but the ; isn't needed so its a little shorter.
>>
File: lru2.png (379 KB, 1106x1108)
379 KB
379 KB PNG
>>107959536
>Inheritance is stupid and pointless and bloat.
what do you mean by "Lisp"? Not Common Lisp. That has fairly in-depth OOP.
>>107959541
the OCaml's compromised a bit by trying to follow the structure of the Python. opam has at least five LRU caches. A good OrderedDict is not as common, but Base has an array-backed queue.
(this version also removes the correct node)
>>
>>107959766
You don't have to use CLOS, but I usually think more in a Scheme direction.
>>
>>107959331
It's the wrong fucking POV you fucking idiot.
Get that into you thick skull.
>>
I never delved into GUI programming before but AI tools are nice for deciphering the Win32 madness
>>
>>107959331
and I like OOP for some use cases.
The reading comprehension I swear
>>
>>107959766
>side effects
yikes!
>>
>>107959892
you're not a better programmer and your programs aren't safer from you always doing a little rain dance with types before you get the exact same work done. There's a balance to these things.
>>
>>107960009
there's 0 rain dance once you understand Haskell
the stdlib gets in your way infinitely more than monads do
>>
>>107954663
>Is the point of classes and namespaces simply to organize things?
namespaces are the folder structure, but classes (in c#) do more than just organize functions

classes usually include functions _and_ some of the data the function will use, so you don't have to pass that data as a parameter, it is passed implicitly. and then there is the oop stuff like inheritance and encapsulation, whatever book you're reading will eventually explain this stuff

and it's good that you learn about them because they are still widely popular concepts, but bear in mind that oop is on it's way out. so if you ever find yourself wasting time thinking about to what class does a function belong, or if a member should be private or protected, and similar nonsense, remember that don't have to, you can just do things
>>
>>107956022
>meaningless nonsense
it's called abstract thinking. do you also think the number 5 is nonsense because it doesn't actually exist?

>what thing?
depends on the implementation
>>
If it's so useful to learn all the astruse bullshit about OOP, then how come Rust is just as expressive with just structs, method syntax and traits? Checkmate, atheists.
>>
>>107960114
>traits
aka, typeCLASSES
>>
>>107960114
Rust takes best parts of OOP and replaces others with Haskell derived stuff.
It's best of two worlds.
>>
>>107959766
that actually looks pretty nice! having pattern matching and functional stuff and types is a pretty sweet combo.
>>
>>107954663
Namespace is mostly just organizational stuff, it's only really relevant when you're using stuff from other assemblies, which is always because that includes everything in .net.
Classes are the template for your objects. This is important because you can instantiate new separate instances of an object that keep track of their own local variables and methods that operate on them.
Console is very confusing and isn't typical of most of the language, because you can't instantiate more of the console objects, but console is indeed an object, meant to represent the console. Console has its own private data that represents things like the background color, etc.
>>
File: 2.jpg (1.63 MB, 4096x3371)
1.63 MB
1.63 MB JPG
if you use positional paramters instead of object parameters you're retarded. sad but true
>>
>noooooooo you cant 1 + 2 + 3 + 4 + 5 + 6 you have to (+) {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6}
>>
>>107960525
somethings wrong with your code if you need that many parameters in a single function, unless maybe you're calling an API but in that case object parameters makes much more sense since you're creating a struct for the API's contract anyway
>>
>>107960068
It's called bullshit. This definition has always been meaningless and non sensical.

The only OOP explanation that makes sense is the one laid in the "Expression Problem".
>>
>>107949746
it feels more efficient to get a woman by thinking you are one
>>
>>107953972
With this you beat 100%
/*
slow code
*/
auto init = atexit([]() { ofstream("display_runtime.txt") << "0"; });
>>
File: silicon.png (300 KB, 864x2664)
300 KB
300 KB PNG
replaced silicon
>>
>>107949746
most people think finding a woman is an o(n) operation, but they are wrong. finding a woman is an exponential curve. each woman who gets the ick from you tells n! women. however programers of specifically rust skill level and above understand this time complexity and are able to reduce the problem to exponential O(n!) back down to linear O(n) or even O(log n) by transitioning. This occurs because women are unable to recieve the ick from another woman no matter how masculine presenting or unappealing they look. This immediately reduces complexity to a linear search. More over most trans women pair with other trans women this logarithmically reduces the search space at each step by eliminating half the programmers they are not compadible with because of friend and romantic associations. It's a simple, but effective algo when you think about it really.
>>
>>107959541
> functions get and put must each run in O(1)
> OrderedDict
Anon, I ...
>>
>>107961069
https://www.youtube.com/watch?v=SuaW5IzbnUc&t=93s
>>107960642
well, what now? you can use a y combinator?
>>
>>107953301
class LRUCache {
std::list<std::pair<int, int>> l;
std::unordered_map<int, decltype(l)::iterator> m;
const int capacity;
public:
LRUCache(int capacity) : capacity(capacity) {}
int get(int key) {
auto it = m.find(key);
if (it == m.end()) return -1;
l.splice(l.begin(), l, it->second);
return it->second->second;
}
void put(int key, int value) {
if (auto it = m.find(key); it != m.end()) {
l.splice(l.begin(), l, it->second);
it->second->second = value;
} else {
if (m.size() < capacity) {
l.push_front({});
} else {
l.splice(l.begin(), l, std::prev(l.end()));
m.erase(l.begin()->first);
}
l.front() = {key, value};
m[key] = l.begin();
}
}
};
>>
is learning C as my first programming language a good idea, i just like how old it is
>>
>>107961239
yes, because it is the building block of most other modern languages, and once you understand C, you have the skills necessary to learn any other language
>>
File: 51EyaJeebHL._SL1056_.jpg (61 KB, 800x1056)
61 KB
61 KB JPG
>>107961249
ok thanks. can i learn from this book, i have quite literally zero programming knowledge
>>
I am dedicating myself to using only the C standard library for maximum /comfy/ness.
>>
>>107961284
Nah using a bunch of extremely non-portable Linux APIs is way more comfy.
>>
>>107961239
It's not a bad idea to learn it early but making anything complete in C takes a whole lot of doing, so you should learn a scripting language in parallel and start writing many programs.
>>
>>107961239
depends what you want to program. and don't bother with learning a "first" language if in the end you plan on learning a different language - just learn that directly
also the statement of this anon >>107961249 is bullshit. cniles are just incapable of learning other languages or paradigms
>>
>>107961284
>C standard library
>maximum /comfy/ness.
hard no
>>
>>107961239
Yes. It's still a common first language they teach on 1st year of CS. Many languages derive from C and due to its simplicity it is de facto standard of FFI. When Rust, C++, Python, JS, Java, etc talk to each other they speak C.
And many important projects still use C.
>>
>>107948846
WSL2 + CLion
>>
>>107961284
>using only the C standard library
as opposed to...?
like, you won't use pthreads?
>>
>>107960352
>turn guaranteed memory writes into potential register writes is retarded
We used to drag retards like you behind the shack and put a bullet into their brain stem, then laugh as they slowly suffocated to death. Good times. We should've never abandoned them.
>>
I still don't understand the factory pattern
>>
>>107961155
>Anon, I ...
https://github.com/python/cpython/blob/main/Lib/collections/__init__.py#L89
ahh its linked list o(1) under the hood. man one thing I was recently looking at is this guys lib. he does a SortedList and all the operations are log n. B Trees are a hell of a drug.
https://github.com/grantjenks/python-sortedcontainers/blob/master/src/sortedcontainers/sortedlist.py#L193
>>
>>107958557
god I hate python so much
dogshit language made for retards
>>
>>107961498
Lol y tho? For my its Rust my eyes just glaze over. Python is just so fast to write. I think for interview shit its almost mandatory. Go and Javascript you don't even get deque.
>>
>>107961336
I'm not sure what I would want to program. I was just doing research on languages because I want to learn one and I thought C looked cool because it's really old and used in operating systems
>>
>>107961431
The factory pattern is a fancy constructor, it allows you to return null if construction fails otherwise an object (no exceptions needed).
>>
>>107961535
its a slow, memory intensive piece of shit language with terrible syntax and it's a nightmare for other people to read
what the fuck kind of type is "key"? Nobody fucking knows besides the guy who wrote the code. Until you try to pass a "key" in and get a fatal exception.
>>
>>107961546
Ah that makes sense
>>
>>107961539
well you can't really learn a language if you don't program in it. and not just some exercises or challenges, but actual complete applications that have practical use.
so better to first do research on what would you be exactly programming, and then pick a language that's good for that kind of programs
>>
>>107961164
>std::list<std::pair<int, int>> l;
Nearly thirty characters of type specification, then a one-character variable name. What the fuck, anon?
>>
File: file.png (46 KB, 640x516)
46 KB
46 KB PNG
>solve the problem in 23 minutes
>check the editorial
>see this
imposter syndrome hitting hard rn
>>
File: Untitled-design-39-1.png (290 KB, 1200x900)
290 KB
290 KB PNG
How many leetcode problems did he solve to get good?
>>
>>107962085
>get good
Never look at Doom's zone memory system.
>>
>>107962113
what about it?
At least he made real software instead of masturbating.
>>
>>107962120
Yeah. Real software. That was then immediately chucked for Quake.
>>
>>107953301
nice
>>
>>107961262
the K&R book teaches C 89, that is, the language as it was in 1989. There's been several changes through the years, including some important ones in the 2000s. Modern C by Gustedt is a better choice covering the language as it's used today:
https://www.goodreads.com/book/show/25097722-modern-c
Another recommended source is the Beej guide, https://beej.us/guide/bgc/html/split/index.html
I'm going through this one right now, but then again, I have 5 years of professional experience (in Python, so I'm still not sure my IQ is in the triple digits).

Best of luck, anon
>>
>>107962344
>some important ones in the 2000s
name one
>>
>>107961289
>>107961339
>>107961364
Can't even make a simple timer without burning up 100% of my CPU.
>>
>>107962472
One: more like 100% of a single core.
Two: one of these days you'll realize that the only real priority of the C standard people was portability.
>>
>>107958277
>And since my name isn't Rajesh or Pablo or Lequinzia, I'm on my own.
Yeah cuz minorities have friends and family since they're likeable and haven't put their brains through the Suburbia blender
>>
>>107962344
>Beej guide
>https://beej.us/guide/bgc/html/split/pointers.html#ptmem
>Pointers are one of the most feared things in the C language. In fact, they are the one thing that makes this language challenging at all. But why?

never understood this. a pointer is just a variable that points to the memory location instead of a value. it was about as hard to understand as a regular variable. stuff like this just makes people more scared about a totally simple concept.
>>
File: 1738246779114392.png (271 KB, 840x577)
271 KB
271 KB PNG
>I am fluent in several programming languages, including css, js, html,
>>
>>107963429
while simple in principle, pointers add a whole layer of complexity that is not part of the actual problem being solved by the program. you can't debug them as easily as a normal variable, either.
>>
File: 1743024425961864.jpg (127 KB, 461x457)
127 KB
127 KB JPG
indian guy tried to update one of linus torvalds repos with an ai generated readme

https://github.com/torvalds/HunspellColorize/pull/3/changes
>>
How do I get to finish my projects? It sucks quitting every time
>>
wrestling with editor <-> DAP integrations instead of working on what I intended to
>>
File: 1749129171373529.png (131 KB, 400x400)
131 KB
131 KB PNG
Anyone taken the codesignal GCA? apparently it's one of the more common OAs that employers will ask candidates to complete.
I took it today and got a perfect score (600/600), the questions werent that hard (it was 2 leetcode easies and 2 mediums) but it felt incredibly stressful since you only have 70 minutes to solve all 4 questions. I can't find any info online regarding scoring percentiles
>>
>>107963995

No word break before 80 columns
gross
>>
>>107961431

the factory pattern is essentially converting enums into full fledged types
>>
>>107962472
Use OS functions and hope for the best. In Windows use Sleep, QueryPerformanceCounter and timeBeginPeriod. Unfortunately, from a runtime point of view, shit like waitable timers are not better.
Simple snake game using that approach:
https://godbolt.org/z/G6zfzcMcc
>>
>>107958687
Go back to work goy, your wife's boyfriend wants another car.
>>
>There's still value in understanding the traditional UNIX "do one thing and do it well" model where many workflows can be done as a pipeline of simple tools each adding their own value, but let's face it, it's not how complex systems really work, and it's not how major applications have been working or been designed for a long time. It's a useful simplification, and it's still true at *some* level, but I think it's also clear that it doesn't really describe most of reality.

Linus Torvalds on systemd wtf I was expecting him to shit all over it.
>>
>>107962397
Standardized support for multicore CPUs.
>>
>>107961431
All OOP patterns are useless. Nobody thinks "I need to implement this hmm which pattern shall I use?" They are just formalising what a (bad) programmer might do until he realises OOP is retarded and starts writing code as immutable data structures passed to pure functions.
>>
>>107961650
What name would you give it? Something like double_linked_list_of_key_value_pairs? That adds nothing but meaningless verbosity.
>>
>>107964790
not her, but i would just do something like
using backing_t = std::list<std::pair<int, int>>;

it's an internal alias, so it's fine to use something generic like that
>>
>>107964726
Who gives a fuck what the Finnish retard has to say?
>copy API from self-admitted microkernel
>despite LARPing as a monokernel (which no one notices btw because they're all fucking autists)
>declare it unbreakable (unless it suits him) and optimize the shit out of it for over twenty-five years
>get absolutely mogged by NVMes
>finally allow batch submissions of jobs to the kernel
>but turns out the internal kernel file system driver interfaces are complete shit and block threads left and right
>throw up the hands in defeat and introduce openat2(RESOLVE_CACHED)
>so that programmers can resign themselves to implement the same old fucking microkernel pattern of launching blockable threads in userspace

He should retreat to some hermit cave and be forced to live out the rest of his days in shame and ignobility.
>>
>>107964790
>>107964808
oh, and then it'd be a
backing_t backing;
, of course
>>
File: pjt.gif (11 KB, 640x360)
11 KB
11 KB GIF
>>107961431
Saar, you need an abstract factory of factories. Saar, follow our beautiful and sacred corporate coding style and practices, Saar.
>>
File: 1727188472907691.gif (1.19 MB, 331x250)
1.19 MB
1.19 MB GIF
>>107964680
Are you speaking from personal experience here?
>>
>>107964811
he wrote the two greatest exemplars of software in history. git and linux work flawlessly, have an elegant C code base, and never experienced bloat or feature creep.
>>
>>107964726
>>There's still value in understanding the traditional UNIX "do one thing and do it well" model
Weird they never did that
>>
>>107948272
I thought you were dead
>>
>>107964829
>linux works flawlessly
>google "io_uring cves"

>never experienced bloat or feature creep
>libaio
>accept4

Can't you just be quietly autistic? Thanks.
>>
>>107964217
factories produce instances, enums are effectively singletons
conversely, Java's enums are already full fledged types: they can have fields and methods, even constructors
>>
File: le pepe.jpg (95 KB, 798x798)
95 KB
95 KB JPG
>>107964827
I am you wife's boyfriend.
>>
>>107964771
>All OOP patterns are useless
you not knowing how to use something doesn't make the thing useless

>Nobody thinks "I need to implement this hmm which pattern shall I use?"
correct - unfortunately that's how most schools and tutorials tend to teach it. but you don't start with a pattern

>They are just formalising what a (bad) programmer might do until he realises OOP is retarded and starts writing code as immutable data structures passed to pure functions.
pure seething from being filtered by OOP
>>
>>107964856
Good thing I don't care what you want then.
>>
>>107964871
it's obvious you are still in school. nobody with a job still thinks or talks about design patterns. let me know when your brain is oop disease-free. in the mean time keep rehearsing what the factory and visitor patterns are, in a few years hopefully you'll learn haskell or C and realise how retarded Java is.
>>
>>107964850
>work at a church
>troons out
how did xhe think that was a good idea
nigga get another job
>>
>>107964886
pretty sure everyone that doesn't vibecode slop and wants to make their code readable and maintainable thinks about design patterns
>>
>>107964856
>le pepe.jpg
lmao done him
>>
>>107964902
When you write code you don't consciously think "Oh I must make this code DRY by factoring out common parts! I am applying the DRY principle here!" Design principles are intuited from experience. Nobody who's been writing code for more than a month is still thinking about names of design patterns.
Also ironically AI code is shit and bloated because it is trained on billions of LoCs of Java and OOP braindead open source programs.
Again, come back when you learn C or Haskell and tell me about the fucking visitor pattern lmao.
>>
>>107964854
i just looked into this and the reasoning behind them is justified. we're not dealing with a toy program here. the kernel is massive and to improve performance io_uring cves seems reasonable.
>>
>>107964935
>Again, come back when you learn C or Haskell
no thanks I want to have a job instead of jacking off
>>
>>107964952
>to improve performance io_uring cves seems reasonable
It's really not, but that's because the kernel autists refuse to learn from domains that already had to deal with similar problems. Like front and back buffers in graphics programming.
>>
>>107964902
I have been programming for nearly 20 years and I never think about design patterns.
I just do whatever makes sense for given problem/project.

Consider pic related. I was making a game and needed to decide on how I am going to program any gameplay logic to it. And I settled for this
Is this OOP? Is this declarative? Who tf cares! It doesn't matter, I made this shit up on the go. In my head this is "Sims dot-chain queue pattern" because it reminds me of how Sims decide on what they will do and it's written using dot chains. And everything uses this pattern in my game, enemies, projectiles, danmaku, stages, even dialogues. What is important is that it does its job, it is readable, extendable, intuitive and I can explain how to use it to any developer in few minutes and he will use it properly without knowing all the nitty gritty about how it works under the hood.
>>
>>107964972
>I want to have a job instead of jacking off
wtf is wrong with you
>>
>>107965047
this is fucking horrifying is what it is
>>
>>107965067
Suggest a better pattern.
>>
>>107965047
>I just do whatever makes sense for given problem/project.
you can get away with that when you have 20 yoe and don't have anyone else reading your shit
meanwhile actual devs need to be taught this shit.

>>107964935
>Nobody who's been writing code for more than a month is still thinking about names of design patterns.
In my first month of coding I was dumping functions everywhere and having files 2k+ LOC long with if statements 8 indents deep. You need to study architecture and design patterns and read other people's code to get better, unless you want to be some jobless autist that writes spaghetti only you know how to navigate
>>
>>107965092
>you can get away with that when you have 20 yoe and don't have anyone else reading your shit
I have been programming professionally for 10+ years.

>meanwhile actual devs need to be taught this shit.
I was taught it as well. And I can tell you that no one competent actually cares much about design patterns beyond few things like decorators or factories. Even if they de facto use some, they rarely call them by proper name.
>>
>>107965092
love it when school kids come here and lecture people with a job about how to code
mate you're still learning about java design patterns FUCK OFF and GET A JOB
>>
>>107965137
>lecture people with a job about how to code
Maybe they should listen, considering how much infrastructure out there fucking sucks, and they're directly responsible for it.
>>
>>107964822
lol you have no idea how hard this hits. I got a teams message on my PR asking for my function to be turned into a "ServiceFactory". I don't even understand. perhaps indian engineering will always remain one of the eternal mysteries of life.
>>
File: khkfr680mabf1.jpg (53 KB, 690x388)
53 KB
53 KB JPG
>>107965293
Why do you still call it "engineering", though?
>>
>>107964886
even for this thread it's rare to see projecting this hard and obvious
>>
>>107964935
>"Oh I must make this code DRY by factoring out common parts! I am applying the DRY principle here!"
you keep seething to the point of making up scenarios in your head
please take meds for your delusions
>>
>>107965293
>I got a teams message on my PR asking for my function to be turned into a "ServiceFactory".
wow. what does that mean indeed.
>>
>>107965047
>Consider pic related. I was making a game and needed to decide on how I am going to program any gameplay logic to it. And I settled for this
>Is this OOP? Is this declarative?
Yes. It is called a "Fluent Interface". Basically just DSL method chaining stuff. I guess you see it a lot in Javascript. You like it better than having some object and just calling methods off it? I was doing a visual novel type thing and I ended up on just a JSON file. This gives you a lot more control. Something like this gives you a lot more control and flexability over whats going. I'll actually have to consider it rewriting it as a DSL. Hmm thanks!

https://en.wikipedia.org/wiki/Fluent_interface
>>
>>107965480
Imagine if instead of member functions, each member function was it's own class with an invoke method on it. And then instead of having a class with member functions you had a class of classes. And then to make said class of classes you need another class, the factory class to create it.
>>
>>107961262
Go through this guys tutorial. He has a book and a video course thing, but just do the github junk he put online along with that book.
https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex0/lecture.md
>>
File: cute_dance.gif (1.56 MB, 568x640)
1.56 MB
1.56 MB GIF
>>107965293
It not about what is correct and what is wrong.
For them winning is good, losing is bad.

Either look for another job or learn how to keep face without making anyone else lose face. If you make someone else lose face you will become an enemy for life. If you don't keep face they will take for granted you are the worst of the worst.

Their primitive brains are unable to avoid the Metonymy fallacy. They easily fall for cargo cult and other forms of idolatry.
>>
File: are u fr.png (313 KB, 791x1113)
313 KB
313 KB PNG
>>
>>107965503
>Yes. It is called a "Fluent Interface".
Yea I guess. But the point of this is that the chain inherently reflects chain of events. This isn't just a fancy builder pattern, it's literally a queue of commands that will be executed one after another.

>You like it better than having some object and just calling methods off it?
If I were to rewrite it now I would just use async functions. I just wasn't exactly sure if I can pull this off using async/await, especially considering that everything can be interruptible (when entity dies for example) and just settled for this quirky idea I had in mind. But now I know I just could have used async functions that await for things like "x frame", "until enemies die", etc, This way would be way more flexible than my fluent interface because it would naturally support loops and such.
>>
>>107965622
>you will become an enemy for life
OK, and? If society wants infrastuctural collapse because they prefer retarded Indians to fuck up everything, then so be it.
>>
>>107965473
he literally started the sentence by saying nobody thinks that
>>
one of the most elegant code bases

https://github.com/PostgREST/postgrest
>>
File: carbon (2).png (673 KB, 928x804)
673 KB
673 KB PNG
>>107965634
at first I thought this was just distra. easy peazy. but just adding that the ball keeps rolling until it hits a wall or a hole and that its short distance gave me so much trouble. I'd hate to get this on a live coding deal.
>>
>>107966622
why does no one in this general use spaces or helper functions
>>
>>107965634
Modified Dijkstra
Should be a medium
>>
>>107966562
I was going to shitpost
>not haskell
but then I saw it was actually haskell
>>
>>107966535
you might want to read previous replies to figure out context and tone of the poster
unless you think people just start a thought with "no one does this: ..." without any prior context, as if that makes any sense
>>
https://forum.dlang.org/post/mcyxrexoezicufdrkbdo@forum.dlang.org
this shit is so depressing.
I cloned the repo and glanced over the checked-in binaries under the hope that it'd at least be something interesting like malware, but there's nothing here at all. AI generated post with AI generated subject about AI generated project with AI generated documentation. There's so little humanity here that it's possible even the prompt didn't come from a human, but came from an ongoing plot to fill the internet with shit.
>>
>>107965634
>>107966622
I have a question. Can you use graph compression and a regular distra on this one? Not that it needs it. But I feel like if this was an advent of code question it'd just be the exact same thing, but grid would be 9 million units big or something.
>>
>>107966989
I think its a new age indian thing. They think spending all their AI tokens on open source trash will get them into fang or something. I don't understand it at all.
>>
>>107966989
> This is a capability of enterprise content management systems – both now and in the past. But how can this be optimally integrated into a cloud-based Kubernetes environment?
>>
why didn't i start programming earlier in my life
every single good programmer has a story about how they started programming when they were 5-12 y/o
its over
>>
>>107965648
>Yea I guess. But the point of this is that the chain inherently reflects chain of events.
The point of a pattern is it describes what's going on with a common name so that people can go "I know what that is" without needing to show yet another example every time.
No language has all the patterns, and some patterns come out very different in some languages.
>>
>>107967688
Because you're not a good programmer. The fact that you DIDN'T start at an early age shows that you never had the potential to be a good programmer, and that's why you didn't start earlier than you did.
>>
>>107962113
You sound like an Andrew Tanenbaum.
>>
(Bump limit reached)

I hate myself so much for asking AI instead of just reading the fucking datasheet.
If you read the datasheet, you'd exactly know which fucking bitch frequency you need. Holy shit man.
AI just blaring stupid garbage
>>
>>107968258
i literally did the same just now
wanted an example of how to use libunwind
asked ai got some retar hallucinations meanwhile libunwind has a copypastable example in the man page
>>
>>107968258
>I hate myself so much for asking AI
good
>>
>>107968337
I really don't understand the hype.
It makes you feel like you're moving faster, but in the end you still have to analyze it from front to back to find the tiny stupid mistakes.
Maybe it's a whole different level with javascript and python, but i don't know. With everything else it's just garbage that feels good but fucks you in the ass without lube
>>
>>107968603
It's useless if you're using it to write entire programs (webshittery doesn't count as real programming) but if you use like really specific StackOverflow it's nice. That comes with the same caveats that SO has though, like the poster writing the answer potentially being a tard or only being able to see a part of the problem.
>>
>>107968108
Tanenbaum was a moron too: >>107964811



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