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.
msys2 spits out .exes by default which is much more based than a linux vm wearing a funny hat because the programmer gets to truly and viscerally see how they are directly creating pure standalone computer software (there is no feeling quite the same as seeing an executable appear by no force other than your own will channeled through a compiler for the first time)

the process:
  1. "ok i hit compile"
  2. "huh... that's an exe like almost every program i've ever used"
  3. "i am working with the tools of ultimate creation and nothing is outside my reach"
seeing the a.out appear might not be exactly the same + it doesn't really show up as a program in file explorer which seals the deal
Sometimes it's important to know how to run a compiler, maybe you want to see how long a stat() syscall takes because someone sends you an email saying "I ran strace on a process and it was doing stat a lot"
C:
#include <sys/stat.h>

void main() {
int i;
struct stat s;
int r;

for(i=0; i < 1000000 ; i++) {
r = stat("/etc/passwd", &s);
};
};
Code:
$ gcc -o runstat runstat.c
$ time ./runstat
And now you know that stat() is not what's slowing that process down.
 
msys2 spits out .exes by default which is much more based than a linux vm wearing a funny hat because the programmer gets to truly and viscerally see how they are directly creating pure standalone computer software (there is no feeling quite the same as seeing an executable appear by no force other than your own will channeled through a compiler for the first time)

the process:
  1. "ok i hit compile"
  2. "huh... that's an exe like almost every program i've ever used"
  3. "i am working with the tools of ultimate creation and nothing is outside my reach"
seeing the a.out appear might not be exactly the same + it doesn't really show up as a program in file explorer which seals the deal
Sometimes I need to see the intermediate steps in compilation, the other day I was using -E of all fucking things with GCC to debug
 
Not unless he comes up with more material as good as "400-pound gatekeeping C whales", which has earned a permanent place in my word-hoard.
I really wish he got new material. He’s on the cusp of greatness, as a fellow retard sperg on this site which jannies can testify for; I feel as though he can lead us out of the darkness of C/C++ and pull the wool from our eyes.
 
  • Feels
Reactions: 306h4Ge5eJUJ
I really wish he got new material. He’s on the cusp of greatness, as a fellow retard sperg on this site which jannies can testify for; I feel as though he can lead us out of the darkness of C/C++ and pull the wool from our eyes.
we could just ban him because he's unfunny and let @UERISIMILITUDO back in this thread because he likes to shill languages like smalltalk (?) and ada (???) and, of all fucking things, apl (?????)
the war between him and the cnile autists would never end and would serve as a common background noise under people talking about structure alignment and shit and other people learning to program
in fact it would actually be pretty cool if we had a thread for violently overblown (and hopefully at least somewhat tongue-in-cheek) programming language slapfights so people in here can have actual discussions about meaningful shit
then they can go to the other thread and recirculate the same 3 arguments about how garbage collectors are either satan or not that bad and whether oop is evil and what brace style is best for 90 hours
 
we could just ban him because he's unfunny and let @UERISIMILITUDO back in this thread because he likes to shill languages like smalltalk (?) and ada (???) and, of all fucking things, apl (?????)
the war between him and the cnile autists would never end and would serve as a common background noise under people talking about structure alignment and shit and other people learning to program
in fact it would actually be pretty cool if we had a thread for violently overblown (and hopefully at least somewhat tongue-in-cheek) programming language slapfights so people in here can have actual discussions about meaningful shit
then they can go to the other thread and recirculate the same 3 arguments about how garbage collectors are either satan or not that bad and whether oop is evil and what brace style is best for 90 hours
I agree. I’d prefer a shitposter that knows what they’re talking about instead of having their entire employment rely upon ChatGPT. I like Ada and APL too.
 
I like Ada and APL too.
i don't know much about either of those but here are my standard stereotypes i will use against them
  • ada: c++ but somehow even c++er, with a slight smell of cobol and pascal. mmmmm
  • apl: fuck this language im not buying a whole ass new keyboard to program in it fuck off
and you know what we need one of these for every language and ada/apl programmers can figure out better ones of these than me because i don't know the most painful parts of those languages so i can accurately lampoon them
 
i don't know much about either of those but here are my standard stereotypes i will use against them
  • ada: c++ but somehow even c++er, with a slight smell of cobol and pascal. mmmmm
  • apl: fuck this language im not buying a whole ass new keyboard to program in it fuck off
and you know what we need one of these for every language and ada/apl programmers can figure out better ones of these than me because i don't know the most painful parts of those languages so i can accurately lampoon them
I like Ada because the government and airplanes used it. It’s like more type strict runtime safe C++ used in mission critical stuff, it’s sadly outdated now and they don’t use it. MILSTD takes too long to update.
I like APL because it allows me to speak to Zeta Reticulin’s.
Discrete Math Bubbles.JPG
The math is really pure if you know what you’re looking at and working with. It gets my dick hard because I love math and not to PL but I’ve dipped my toes in algebraic geometry/topology. I recommend everyone here all of Donald Knuth’s books. The man is literally a GodKing of CS and I love him will all my heart.

Note: don’t click on this unless if you’ve plugged your neghole. It’s not malicious it just doesn’t have a cert renewed. (:_(
 
Last edited:
OOP is a spook and doesn't meaningfully exist beyond totally spooked codebases. No one sane uses inheritance, it was and is a bad idea. Reasonable people use composition. So what is OOP? Attaching methods to classes? Literally the same as passing structs to functions. Then, for no particular reason beyond spooked-OOP-brained beliefs, people create huge classes because it's "clean" and thereby destroying the memory locality of data transformations. There are no "OOP" jobs, just jobs and if some company is like "we only hire OOP programmers" it basically means they're retarded and have no idea what they're talking about. Typical bullshit you hear from tech recruiters who do not know anything about programming or what any of these words mean.

As previously linked, despookify your OOP brain with Data Oriented Design: https://www.youtube.com/watch?v=rX0ItVEVjHc
 
@Ghost of Biden no child you don't get it you're supposed to say why every language is shit
I'll start:
  • C: old language that people use solely because people already use it a lot, that makes it really easy to find creative new ways to shoot yourself in the foot
  • C++: C with ungodly amounts of crazy shit on top that allows you to be somewhat more safe than C, in exchange for infinite template spaghetti and the risk of blowing your whole leg off when you eventually fuck up and shoot yourself in the foot
  • JavaScript: it's JavaScript, need I say more?
  • Rust: slightly safer-by-default version of C++ that nobody asked for, with pride flag painted on the side and an npm-like package manager shoved into it because fuck you
  • Python: uses indentation to denote program structure just like FORTRAN without being fast like FORTRAN so the pythoncels need 50 bindings to C libraries to ever do anything useful
  • Perl: average program is indistinguishable from what happens when you cat /dev/random
  • Lisp: a language that looks somewhat clean until you get to the end of a function definition where all the )))))))))))))))))))))))))))))))))))))))))))))))))))) is
 
OOP is a spook and doesn't meaningfully exist beyond totally spooked codebases. No one sane uses inheritance, it was and is a bad idea. Reasonable people use composition. So what is OOP? Attaching methods to classes? Literally the same as passing structs to functions. Then, for no particular reason beyond spooked-OOP-brained beliefs, people create huge classes because it's "clean" and thereby destroying the memory locality of data transformations. There are no "OOP" jobs, just jobs and if some company is like "we only hire OOP programmers" it basically means they're retarded and have no idea what they're talking about. Typical bullshit you hear from tech recruiters who do not know anything about programming or what any of these words mean.

As previously linked, despookify your OOP brain with Data Oriented Design: https://www.youtube.com/watch?v=rX0ItVEVjHc
I actually enjoy OOP for pattern design. I hate the taught OOP though and it ruins what I believe to be the original use interpretation. Now it’s all about building barns and cattle. But the real magic is when you use it to build servers. Every server in the world can be technically condensed into an object definition.

Imagine all that power at your fingertips to push go on the server factory for the lols.

@Ghost of Biden no child you don't get it you're supposed to say why every language is shit
I'll start:
  • C: old language that people use solely because people already use it a lot, that makes it really easy to find creative new ways to shoot yourself in the foot
  • C++: C with ungodly amounts of crazy shit on top that allows you to be somewhat more safe than C, in exchange for infinite template spaghetti and the risk of blowing your whole leg off when you eventually fuck up and shoot yourself in the foot
  • JavaScript: it's JavaScript, need I say more?
  • Rust: slightly safer-by-default version of C++ that nobody asked for, with pride flag painted on the side and an npm-like package manager shoved into it because fuck you
  • Python: uses indentation to denote program structure just like FORTRAN without being fast like FORTRAN so the pythoncels need 50 bindings to C libraries to ever do anything useful
  • Perl: average program is indistinguishable from what happens when you cat /dev/random
  • Lisp: a language that looks somewhat clean until you get to the end of a function definition where all the )))))))))))))))))))))))))))))))))))))))))))))))))))) is
I’m sorry brother. I must’ve accidentally slipped some white pill in my coffee this morning.

I’m not disillusioned from hope and positivity anymore. Thank you.

ALL YOUR LANGS ARE SHIT
 
  • Feels
  • Like
Reactions: y a t s and Safir
Reasonable people use composition. So what is OOP? Attaching methods to classes?
Correct, composition in the modern era is the only use for OOP. Otherwise, it's structs from the top on down.

Composition is used to abstract away vendor dependency as long as the products have similar outputs. You use composition to make a section of a program have the same outputs per inputs with MySql or PostregSQL. Same goes for whatever vender version of Redis/Kafka you have.

This really doesn't matter in today's day and age to the average coder where those concepts are already done for you using Hibernate, or PeeWee, or Spring Data.

Even better we have Lambda engines that abstract it down even more to simple python/js scripts between systems. It's just going to be batch processing of those at the end of the day. The mainframe people were right after two decades of being shit on.
 
Even better we have Lambda engines that abstract it down even more to simple python/js scripts between systems. It's just going to be batch processing of those at the end of the day. The mainframe people were right after two decades of being shit on.
Everything old is new again, again, again,

again.
 
Since everyone is putting their two cents on OOP.

I'll give my fucking absolutely worthless opinion as a novice javascript dev.

I do not give a flying fuck about the faggoty outs and ins on OOP. I simply use objects for alot of things to keep my code organized and easy to understand, not just for myself but incase someone else ends up working on my code in the future.

Here is an example. I made a simple idle game as a pet project, partially to test my skills but also to put on my portfolio.

This game involves alot of mathematical calculations and it also has functions for storing data, and manipulating the stored data. I even have an object specifically for different functions that involve changes to the DOM, an object for the different items in game with a nested function that generates all the properties of those items based on their level.

So to keep these things organized I have these functions stored as properties inside of objects, and I import those objects to my main.js file.

When I call any of these functions I simply type
Code:
data.save( );
or
Code:
calc.percentageChange(num1, num2)

I personally find it easier to add or remove things and manipulate alot of data with simple for loops. Its also easier to find things inside of my code because I simply scroll down to the relevant object.

I'm rusty on all of the vocabulary involvedu, but I'll say that I think OOP is useful just for the fact that using objects helps me organize my code and and makes it easier to make significant changes to the code.
 
OOP is just one way to represent state with functions that can act upon said state.
In languages with first class support for functions you can use closures as a poor man's objects.

Let's make an example in Scheme for the joy of @Marvin
Code:
; An example of a poor man's "class" with closures.
; This is Scheme code.
(define (make-counter i)
  (define (inc)
    (set! inc (+ inc 1)))

  (lambda (field . args)
    (case field
      ((i) i)
      ((inc) (inc)))))

(define (inc-counter! c)
  (c 'inc))

(define (get-counter-value c)
  (c 'i))

In the end you are the one responsible to choose the best way of representing state, depending on your needs.
 
  • Semper Fidelis
Reactions: Marvin
Since everyone is putting their two cents on OOP.

I'll give my fucking absolutely worthless opinion as a novice javascript dev.

I do not give a flying fuck about the faggoty outs and ins on OOP. I simply use objects for alot of things to keep my code organized and easy to understand, not just for myself but incase someone else ends up working on my code in the future.

Here is an example. I made a simple idle game as a pet project, partially to test my skills but also to put on my portfolio.

This game involves alot of mathematical calculations and it also has functions for storing data, and manipulating the stored data. I even have an object specifically for different functions that involve changes to the DOM, an object for the different items in game with a nested function that generates all the properties of those items based on their level.

So to keep these things organized I have these functions stored as properties inside of objects, and I import those objects to my main.js file.

When I call any of these functions I simply type
Code:
data.save( );
or
Code:
calc.percentageChange(num1, num2)

I personally find it easier to add or remove things and manipulate alot of data with simple for loops. Its also easier to find things inside of my code because I simply scroll down to the relevant object.

I'm rusty on all of the vocabulary involvedu, but I'll say that I think OOP is useful just for the fact that using objects helps me organize my code and and makes it easier to make significant changes to the code.
Apparently recently JS introduced the "this." Keyword inside of lambda functions in objects. So if you are accessing or modifying internal values via this. You technically are doing OOP which is wild in JS. I thought you had to use Typescript to get that support.
 
Apparently recently JS introduced the "this." Keyword inside of lambda functions in objects. So if you are accessing or modifying internal values via this. You technically are doing OOP which is wild in JS. I thought you had to use Typescript to get that support.
Yeah. Using this works, but not with arrow functions.

For example
JavaScript:
//this works

niggerToThePlantation : true,

isItNiggerlicious : function( ) {

return this.niggerToThePlantation;

},
JavaScript:
//This does not

beanerToMexico : true,

isItNiggerlicious : ( ) => {

  return this.beanerToMexico;

},

I also have trouble using "this" when dealing with Jquery, but I haven't used jquery alot.
 
People get genuinely surprised when I explain that closures and OOP represent the same shit where the former is much easier to use and compose.
There's a common-language word for "a feature that's beautiful and efficient and robust that only the high end of the bell curve can understand". The word is "hard". Closures are fucking hard. I use "functional programming" in python when I see an opportunity to sneak it in -- apparently a custom python decorator is a "closure", and I'm very good at writing those -- but I can't understand a single sentence in the wikipedia article on closures.

OOP is easy. Retards like me can use it. Retards like me can get and keep a solo dev job with no programming experience whatsoever, a nice IDE, and a best practices guide from the vendor. Soydev-friendly IDEs are geared toward OOP. The demand for developers is such that most of them are soy (soyer than me at least), and there will always be OOP jobs. Because it's easy. OOP puts food, and expensive collectible Chinese teapots, on my table.

Job-wise, OOP is "good enough", it's easy and it's self-reinforcing. It's cheaper to hire a good-enough soydev ro write classes than to hire @Sperg Coalition to write closures and structs. Even if someone offers to write closures and structs for a fraction of the opportunity cost, who's going to support it after the closure guy finds something better to do?

We* had a customer with a fucked-up database who wanted a new react frontend + "any" backend for it. We couldn't change the database. I offered to write a reasonably fast, efficient, lightweight backend for it. I got told NO, because they'd want to eventually kick us out and hire an in-house soydev, and we had to use something they could find soydevs for. They eventually followed through on that plan, and they left some of our diagnostics code in because they don't know what it's for, and we get funny crash messages from their production server a couple times per week.

I learned the basics of system validation, to better describe workflows. Guess what? No one fucking cares. this knowledge is above my pay grade and is therefore useless at my pay grade. No one expects me to have it and no one has a use for it. The customer wouldn't understand it, so I do workflow validation off the cuff in my head. Found a million-dollar exploit. It took them a month to even understand what the problem was (essentially arbitrage).

*I'm soy, but my "boss" (senior partner) is a real computer scientist. It's been almost two years since I started working with him, and it's the longest I haven't hated a job.

I'll say that I think OOP is useful just for the fact that using objects helps me organize my code and and makes it easier to make significant changes to the code.
This.

Also, inheritance is awesome. I'm probably too retarded to do the kind of work and use the languages where composition shines. In python, I only got to use it once, to re-implement an economics model with two distinct parts (input, to be loaded from various sources, and output, either calculated from inputs or loaded from an authoritative source for validation). If I want to change how a class processes its fields, I'm not making a "mixin" that operates on those fields and calls other methods but has no knowledge of the fields and methods, it's retarded and unreadable.

Making the tokenizer is fun little mental exercise.
This was the first task I outright failed at vocational training and couldn't even understand the code someone generously provided. Made me give up on learning programming for fun. I loved the simple algorithms (e.g. sorting with extra work to do), graphs, strings, but tokenizers can get fucked.
 
Yeah. Using this works, but not with arrow functions.

For example
JavaScript:
//this works

niggerToThePlantation : true,

isItNiggerlicious : function( ) {

return this.niggerToThePlantation;

},
JavaScript:
//This does not

beanerToMexico : true,

isItNiggerlicious : ( ) => {

  return this.beanerToMexico;

},

I also have trouble using "this" when dealing with Jquery, but I haven't used jquery alot.

Well yeah, arrow functions are just values. Like 2 or "hello world". They have no idea what's going on unless values they are referencing are declared in global scope. Plus they should be self contained anyway.
 
Back