Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
C code is also incredibly simple to call into from other languages. You can construct a call into a C function at runtime, from just seeing its signature, represented as string (like luajit ffi or python's cffi). With C++ (or other languages) this is not feasible... to make a call like someCppObject->someMethod(otherObject), you'd have to consider downcasting of the pointers, overload resolution, the vtable, templates, etc... mostly this is delegated to clang and compiled for exactly the call you need to make. But then anyone who needs to modify your code, also needs clang.
This is almost entirely a result of your operating system being written in C and having multiple decades of de facto standards nailing down the major parts of the C ABI. Even then, people can't fucking agree on how e.g. bitfields work.
 
"Trannies use this therefore I will not" is the worst reason to skip on rust and I genuinely think that this thought pattern is a troon psyop to stop heckin chuds using extremely good, well designed tech. There are many better reasons to avoid rust, such as the immense corporate backing; hard to hire devs for rust positions; incomplete async (async traits got merged in recently iirc.)
When troon/shitlib culture infects a project, it is a good reason to stop using it. I was once told, when I complained that a lot of things in Rust were "finished" at version 0.x, that writing documentation and putting in final "boring" features isn't fun and it's hard to motivate people to do that. How about you motivate them by not shitting up the standard library (and the de-facto standard library made of cargo crates everyone uses) with their half-baked stuff until they finish it? Async is example #1 of this attitude - the fun computer science finished almost a decade ago, so let's just not do the rest.

Another thing shitlibs and troons do is devalue proscriptive rules. That's why Rust has no standard. There's no document in any human language describing how the programming langauge ought to work. There's just a compiler, and how the compiler works is how the language ought to work. No. Fuck you. Standardize your shit. Tell people how it should work so they can write their own compilers and call you on it when yours has bugs.

Rust had one good idea. That idea was building memory safety into the language. The implementation of this was an overly strict borrow checker that is forced on everything you do unless you want to accept "more permissive than C" semantics (unsafe). The rest of Rust is a troon version of javascript-cum-APL with inscrutable syntax and a bunch of half-baked features, intended as a systems programming language.
 
Last edited:
I need help bros, I need to escape wagie retail and want a gay faggot tech job that pays well.

  • I have a decent grasp of the fundamentals I feel, but I don't have a deep knowledge on any particular language, I've put together some 2000+ long line python scripts and i've dabbled a bit in other languages (lua for gmod stuff, extremely trivial amounts of rust to modify a small function in an open source project, a tiny bit of C#, etc.), but that's about it.

  • No formal education, don't live anywhere with a lot of tech jobs but I'm willing to move. I have no family or anything keeping me chained to one place

  • No Java

  • I have an interest in distributed systems and parallel computing, but this is an extremely specialized and difficult field to get into, what are some good places to even get started with this? Shill me any language/library and I'll look into it. (yes I've seen Bend, unconvential design patterns like folds/bends are above my pay grade right now + it has no libraries)

  • Should I go back to college for linear algebra/mathematics or is college a scam even for math-related degrees? I'm 25. Yes "you don't need to be good at math to be a programmer" it still helps, especially for more advanced projects
I'm ready to go full autistic retard on something but I don't know what, the newer distributed compile tools for Unreal engine and the idea of synchronizing a network of hundreds of cpu/gpu cores together for a single task is really fascinating and borderline magic to me and I want to learn more. I will accept any language/library suggestion but preferably something more "mainstream" (I'm not wasting my time learning Haskell sorry), I'm also not learning Java unless it's MAYBE Java 21/the new shit with unnamed classes where I can just ignore the decades of awful OOP nightmare.

I feel like I can relate to you so I'll tell you what my plan is and you can take what you like and run with it. I'm also 25, got sick to death of working shit jobs for shit pay and I can't find a single fucking workplace that isn't needlessly hostile. I have really bad fucking anxiety after seeing a shooting in the work place and every fucking job I get is full of niggercattle constantly trying to start fights with me so I want to work from home where I can just focus on my work and not have to deal with dumb fucking niggers. I haven't spent a day in college, I have been learning how to code for less than a year and I'm honestly not really that fucking good at it yet but I've been getting somewhat competent and I already have a client who is paying me to make a website for their business.

My plan is to reach out to people I know that have a business and make them websites for their business. I'm charging them fuckin chump change and going the extra mile to find the best prices for hosting and whatnot. This way I can build my resume and get some real world experience so its easy to land a job or put myself out there for freelance work.


Just gotta fucking keep busting your ass, learning as much as you can, and start putting yourself out there. When you get Your first job you will absolutely be in over your head, but really its not that bad because then you know what you need to learn next to get better at your craft.

I just know javascript, css, and html. You seem to know a bit more than me, so I think you'll be fine if you just keep your nose to the grindstone.
 
Another thing shitlibs and troons do is devalue proscriptive rules. That's why Rust has no standard. There's no document in any human language describing how the programming langauge ought to work. There's just a compiler, and how the compiler works is how the language ought to work. No. Fuck you. Standardize your shit. Tell people how it should work so they can write their own compilers and call you on it when yours has bugs.
And then they lose their shit when GCC dares to add a Rust implementation.
 
And then they lose their shit when GCC dares to add a Rust implementation.
Seriously? You'd think a portable systems language attempting to replace C would carry over C's property of having tons of compiler implementations, to ensure that programs written in it can be rapidly ported to almost any electrical device with a conditional branch instruction.
 
What is the quickest and simplest way to set up react in vs code? Create react app is fucking gay and pozzed. Hell, I don't even like react, I'm just learning it to help my job prospects I learned the basics for react on freecodecamp and as helpful as that website has been for learning the basics for webdev languages, none of the lessons actually teach you how to set anything up in vscode. I am having trouble setting it up, I tried babel, I tried create react app, then I copy pasted the hello world code from the documents to test it and it just isn't fucking working even when I do everything the docs say, step by step.

I have some downtime on the project with my current client because we had to move our meeting to next weekend so I am gonna take advantage of that and learn some more shit.

Am I a retard or is is it not compatible with the html5 live preview extension or something?

Can someone here point me in the right direction. What is the simplest most brain dead fucking easy way to set it up in vscode? Like simple enough that a fuckin retard can do it and it will work for the first time.

I am asking you guys before I resort to watching those dreaded fucking tutorial videos on youtube that are drawn out to 20 minutes when it can be easily explained in less than 5.
 
What is the quickest and simplest way to set up react in vs code? Create react app is fucking gay and pozzed. Hell, I don't even like react, I'm just learning it to help my job prospects I learned the basics for react on freecodecamp and as helpful as that website has been for learning the basics for webdev languages, none of the lessons actually teach you how to set anything up in vscode. I am having trouble setting it up, I tried babel, I tried create react app, then I copy pasted the hello world code from the documents to test it and it just isn't fucking working even when I do everything the docs say, step by step.

I have some downtime on the project with my current client because we had to move our meeting to next weekend so I am gonna take advantage of that and learn some more shit.

Am I a retard or is is it not compatible with the html5 live preview extension or something?

Can someone here point me in the right direction. What is the simplest most brain dead fucking easy way to set it up in vscode? Like simple enough that a fuckin retard can do it and it will work for the first time.

I am asking you guys before I resort to watching those dreaded fucking tutorial videos on youtube that are drawn out to 20 minutes when it can be easily explained in less than 5.
Professionals use IDEA Ultimate not VSCode. You can get the web dev part of IDEA Ultimate with PHP or just the JavaScript/HTML/CSS part through Web Storm. Php storm is $10 a month. If you buy the annual subscription or remain a member for 12 months. You have a perpetual license to the last major version before your subscription expires.

Edit:If you save 30 minutes using it instead of wrestling with another ide, it's paid for itself.
 
Last edited:
Seriously? You'd think a portable systems language attempting to replace C would carry over C's property of having tons of compiler implementations, to ensure that programs written in it can be rapidly ported to almost any electrical device with a conditional branch instruction.
Having multiple implementations is considered controversial in the world of Rust, for some reason.
 
What is the quickest and simplest way to set up react in vs code? Create react app is fucking gay and pozzed. Hell, I don't even like react, I'm just learning it to help my job prospects I learned the basics for react on freecodecamp and as helpful as that website has been for learning the basics for webdev languages, none of the lessons actually teach you how to set anything up in vscode. I am having trouble setting it up, I tried babel, I tried create react app, then I copy pasted the hello world code from the documents to test it and it just isn't fucking working even when I do everything the docs say, step by step.

I have some downtime on the project with my current client because we had to move our meeting to next weekend so I am gonna take advantage of that and learn some more shit.

Am I a retard or is is it not compatible with the html5 live preview extension or something?

Can someone here point me in the right direction. What is the simplest most brain dead fucking easy way to set it up in vscode? Like simple enough that a fuckin retard can do it and it will work for the first time.

I am asking you guys before I resort to watching those dreaded fucking tutorial videos on youtube that are drawn out to 20 minutes when it can be easily explained in less than 5.
Might want to look into vite.js if you hate CRA so much. Either way, I don't use VSCode, but from what I understand you are probably trying to view the HTML files in public/. You have to set up a React development server (built-in with vite and CRA) or "build" the actual webpage files and then Live Preview those to see what is going on. Googling "vscode html preivew js" pointed me to this stackoverflow post which even has a React example. Try Googling your problems before immediately asking them here. From a cursory search, I found at least 3 different VSCode extensions (though they were deprecated) allowing you to preview React components.
 
Last edited:
I did. Usually when I'm stuck with something people on here tend to be helpful.
Literally Google is useless these days, it can't even answer the most basic questions I give it for anything. Don't listen to this guy, this is why people are signing up for shit like Stack Overflow.

Bonus meme:
522+-+SoyBooru-1456567690.png
 
I have an interest in distributed systems and parallel computing
I used to write papers about this very thing. You'll need a reasonably strong math background.

Should I go back to college for linear algebra/mathematics or is college a scam even for math-related degrees? I'm 25. Yes "you don't need to be good at math to be a programmer" it still helps, especially for more advanced projects
Maybe start with working through some entry level textbooks online and see how you handle it. Being competent at university level math certainly helps with more specialized work beyond the Pajeet level. Even just knowing stuff on the level of (!a && !b) == !(a || b) can really change how you think about and approach certain problems.

Apparently it still pays pretty well.
 
Even just knowing stuff on the level of (!a && !b) == !(a || b) can really change how you think about and approach certain problems.
I haven't learned it at school, but I know that ! means "not", || means "or", && means "and" and == means "equals" (duh). So in english "Not A and not B equals not A or B" right?

It's still a fucking alien language, is there any online resource for anything more complex than this? I've seen some code before that looks like fucking gibberish because of it.
 
I haven't learned it at school, but I know that ! means "not", || means "or", && means "and" and == means "equals" (duh). So in english "Not A and not B equals not A or B" right?
Yes, but I'm going to be a bit pedantic and suggest including the parens to make it clear what the NOT applies to (i.e. "NOT A AND NOT B equals NOT (A OR B)"). The == represents a logical equivalence, and math notation commonly has it written like ≡ or ⇔.

It's still a fucking alien language, is there any online resource for anything more complex than this? I've seen some code before that looks like fucking gibberish because of it.
As a good introduction, look into truth tables and boolean algebra. It's often taught in 1st year math and CS along with some number theory as an intro to writing proofs. You can certainly find good free textbooks online for this sort of thing.

Being able to logically manipulate what you're working with is extremely handy.
 
Should I go back to college for linear algebra/mathematics or is college a scam even for math-related degrees?
I've no idea about the usefulness of a degree but you can learn everything you can learn in a generic "college" on the online for free. Linear algebra is way easier than programming, the fucky parts of it are those which are programming-related (precision errors and shit).

STORYTIEM
(DISCLAIMER: this is not my current job, my current job is awesome)
I worked with a Data Scientist!!!! who'd studied and worked in Data Science!!! in Japan!!!!!
We needed to find "distances" between pairs of vectors and pick n smallest pairs (the actual numerical value did not matter).
An actual "linear" distance between two generic vectors is computationally expensive because it involves the square root.
However, what we had were unit vectors, each with a length of 1. A much cheaper proxy for distance in that case is the scalar product (multiply dimensions pairwise then sum up).
sp == 1: identical (distance 0). sp == 0.5: 60 degrees (distance 1). sp == 0: perpendicular (distance sqrt(2) = 1.414...). sp == -1: opposite (distance 2).
THEY (mostly the boss) FUCKING FOUGHT ME AND WON
NO WE AREN'T GOING TO USE YOUR INVENTED FAKE MATH, WE WILL USE THE TESTED LIBRARY FUNCTION
(That was the place I pulled an epic stunt when I quit.)

^ This is mostly how not-retarded you have to be. You can learn this faster than you can get admitted to college.

Don't listen to this guy, this is why people are signing up for shit like Stack Overflow.
Stack Overflow has been shat up for ages. When I look up Django questions (how to do an operation in a database), I get python answers. "How to sort in this particular complicated way and pick the top 3" lolololol just pull ten million records into python and sort there, list.sort, very easy, tee hee, don't forget to mark my answer as accepted! For the last six years or more, Stack Overflow has only been helpful to me to solve problems with package incompatibility.

Even just knowing stuff on the level of (!a && !b) == !(a || b) can really change how you think about and approach certain problems.
^ this.

These are the questions I used in a (python) coding interview:

1. What's NAND, a.k.a. the Sheffer stroke? (idgaf if you don't know, here's what it is: <splain>).
Now, using only NAND, implement a few other logical operations (btw which ones do you know?)

2. What's an eigenvalue of a matrix, in your own words?

3. Write a class, `A`, that on initialization takes a number and saves it into a field. No need to validate that it's a number or anything, this is prep work, it's not a trick question.
Expected result:
Python:
class A:
    def __init__(self, x):
        self.x = x
Now make it so that you can add instances of the class, so that the following line doesn't throw an error -- btw what does assert do?
Python:
assert A(1) + A(1) == A(2)
(if can't magic, go to question 4, then come back)
on success:
Will it work with floats, I wonder? and with multiple additions? Let's check!
Python:
assert A(0.1) + A(0.1) + A(0.1) == A(0.3)
oops it broke, top kek
What's wrong?

4. What does this code do? (This is not a trick question, this code is verbatim from a real package.)
Python:
class ErrorDetail(str):
    code = None

    def __new__(cls, string, code=None):
        self = super().__new__(cls, string)
        self.code = code
        return self

    def __eq__(self, other):
        result = super().__eq__(other)
        if result is NotImplemented:
            return NotImplemented
        try:
            return result and self.code == other.code
        except AttributeError:
            return result

    def __ne__(self, other):
        result = self.__eq__(other)
        if result is NotImplemented:
            return NotImplemented
        return not result

    def __repr__(self):
        return 'ErrorDetail(string=%r, code=%r)' % (
            str(self),
            self.code,
        )

    def __hash__(self):
        return hash(str(self))
(full points and no need to elaborate further if he knows where it's from, otherwise talk about magic methods, hashes, new vs init, string formatting, etc).

5. Which DBMSes are you familiar with?
There are 52 cards in a card deck, 13 of each of 4 suits, ace-two-three-...-ten-jack-queen-king.
I draw a few cards out of the deck and get a "set". Just like in a python set, the order doesn't matter, what matters is all of them are in my hand.
Propose a method of storing card sets in a database.
if mysql and sets: "cool, but we're using postgres in this project, we don't have sets, how'd you do it here?"
 
Fucking christ, Python is opaque, indecipherable, horribly undocumented pajeet shit.

So Friday, something I wrote had an issue. It was my fault, I own that. (Mismatch between timezone-free datetime.date objects and datetime.datetime objects that Python's postgres wrapper returns. Also, apparently Python's type annotations are 100% meaningless? Like they're essentially comments? Fucking wonderful.)

Anyway, I contribute a fix Friday and finish for the weekend.

I'm fairly certain that my fix on Friday is working exactly as it should. But this morning, in our stand up meeting, someone mentioned something about some suspicious 404s in our logs. I suspect that the 404s are to be expected; we're scraping data once a day and we end our loop when we run out of results, ergo one 404 each day.

But ok, I'll look into it. Good to be thorough. I've got the python repl open and I'm manually running each step to confirm my hypothesis. Except the logger is broken.

I spent like an hour and a half trying to get the logger working locally.

See, the thing is, it's important to get the logger working (otherwise I'd just debug with printf statements and leave it at that) because it's specifically the log messages that are bothering my boss. I need to find out the cause of those messages, not just confirm that my fix is working. These two things are closely related, but not exactly 100% the same.

Two hours later, I have confirmed that the fix is working just fine. The 404 is actually because my coworker is caching stuff on a file storage REST API (sorta like s3), and when we read from the cache, if it's a cache miss, we ignore it. And that's fine, that's the point of a cache. Except he logs the error as an error, without distinguishing between "cache miss" and "something is broken, investigate this".

At this point, I can confidently report that the 404s are not a problem with our data scraping. It's from a cache miss and we can safely ignore it.

Now my intuition is to try and improve the codebase. I don't really need to do this, I can move on with my day, but we're all in this together and I have the chance to leave the codebase better than I found it.

I'm almost OK with him logging the error this way, because at least I can wrap this GET request with a HEAD request and avoid the error. Him not making that distinction is a questionable decision, but we've all made early-stage design decisions that turn out badly.

But now I try to add the HEAD check, and he's doing the same fucking thing there too. And I don't know what else he wrote that depends on this behavior. I've got an hour or two left in my day. If I had any kind of passion for Python or this project or anything like that, I'd love to stick around and polish this turd. I do enjoy programming.

But nah, I'm going to run some errands and fuck off for the day and work on my far more enjoyable personal projects. Not in python and not with pajeet-tier coworkers.
 
But now I try to add the HEAD check, and he's doing the same fucking thing there too.
Is there a supervisor or anyone to rein in the pajeet incarnate? This is not even specifically python fuckery, it's not language-specific to know to not raise "errors" that are not errors. A 404 isn't even an error class in commonly used python http packages, it's an attribute value on a successful response. Errors are things like Internet Lumberjack activity, or AIDS in the pool. (I'd make something to catch the "expected" 404, too, to better tell them apart from when whatever it is that you're scraping fucks with their urls.)

My "junior" coworker sometimes errs on the opposite end of the scale and adds retard insurance against crashes where it's not needed. For example, I would not be adding a runtime check for or forcing a datetime to be timezone-aware. The one thing I do check for is whether a reusable function that's meant to run in a database transaction (but will "successfully" run and corrupt data outside of one) does in fact run in a database transaction.
 
Might want to look into vite.js if you hate CRA so much.
Vite works, thank you.

Also, I was able to make a random quote generator with react in like half the time it would have taken with vanilla javascript.

I wanted to hate react, but God damn I really like being able to just type html code inside of my script instead of using template literals.
 
Back