Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
Let's see...I am considering using AI to help with coding as a lark/side project...
My advice, don't. Use it as a learning aid instead. As in, make a guess what some piece of code does, and then maybe ask the ai whether thats right. Otherwise, you very easily can become immensely reliant on it, to a degree where you can't do anything without any ai agent being available.
Fair. I just can't help but see the attitude toward external dependencies the JS ecosystem has and contrast it to any other language. There's just this, flippancy, for lack of a better term, and it boggles my mind.
That attitude is directly a result of having to pull in some lib for even the most basic things, which trains people that "that is perfectly fine with now drawbacks(tm)" Which also results in an attitude of making libs as small as possible. (altough, that is also kinda historical, as minifiers werent around for quite some time)
switch statements are great if you have a variable that can be one of 28 different things and you need to do something very different for each thing
in a lot of cases, switch expressions are even better. though, if you dont have an expression based language, rather than statement one, you lose a lot of the value.
I have a Ruby templating engine that I wrote with the "eliminate ifs by using classes" methodology and it became spaghetti at a fraction of 1k LOC. The Scheme version is more bloody readable. OOP niggers are really something else.
discriminated/tagged unions are the most natural solution to a lot of such things.
 
The Scheme version is more bloody readable. OOP niggers are really something else.
well oop is actually quite good at certain very specific problems where the procedural/functional style suffers
this is why many schemes include powerful oop systems with metaclass bullshit that blows the likes of java completely out of the water
in a lot of cases, switch expressions are even better. though, if you dont have an expression based language, rather than statement one, you lose a lot of the value.
i am a scheme autist and i approve of this statement what this sentence evaluates to
 
Ok, thanks.
Let's see...I am considering using AI to help with coding as a lark/side project while I'm still unemployed and gonna get permission to someday get access to my laptop so I can have access to download the recommended programs...but how do I avoid doing anything near like Alex Mahan's legendarily bad else/if spaghetti code?
Is MUGEN and ren.py programs good for beginners like me?
Don't be a fucking soynigger jeet who uses AI. There is nothing that AI can do for you that a good Google search or documentation couldn't already. There's literally decades of programming knowledge on the Internet and much of it is of significantly higher quality than a retarded LLM could vomit at you. You will never attain divine intellect if you use AI
 
Do you guys prefer handling routing for a website explicitly or implicitly? Aspnet core supports both (implicit as in putting an annotation on each handler in its respective file vs explicit as in actually declaring what each verb on each route does in one central location)

I personally am leaning towards preferring it explicitly, as I like having only one location to look for where I can instantly see an overview of all supported routes. (subroutes can be easily forwarded to another route handler)
 
Ask the CIE "What is wrong with my code"?
Never ask it to write it for you, or ask for feedback in any other way.
It will find a problem every single time, and you will learn a lot either if it's right, or disproving to yourself that it's wrong.
 
You're actually better off with not using AI and investing in a course to learn programming, either in book form (SICP) or video form (udemy? linkedin learning?). If you actually want to learn to code and code well, basically just keep making stuff that's slightly outside of your knowledge level until you have the knowledge to do what you actually want. It's pretty much a pure function of time spent => quality output, just don't be afraid to say 'this isn't working' and restart.
 
You're actually better off with not using AI and investing in a course to learn programming, either in book form (SICP) or video form (udemy? linkedin learning?). If you actually want to learn to code and code well, basically just keep making stuff that's slightly outside of your knowledge level until you have the knowledge to do what you actually want. It's pretty much a pure function of time spent => quality output, just don't be afraid to say 'this isn't working' and restart.
It's nice to have the equivalent of a C grade undergrad student to ask random retarded questions to, or for ideas.
 
It's nice to have the equivalent of a C grade undergrad student to ask random retarded questions to, or for ideas.
This I agree with but only for a mature programmer. For a novice I've changed my views quite a bit because a novice doesn't know what they need to learn, or what they're missing. Comically, I would recommend using ChatGPT to create a personalized lesson plan and to recommend texts or ideas for novices, but I would not recommend a novice learn from ChatGPT as the source of truth - then it's the blind leading the blind.
 
video form (udemy? linkedin learning?)
there are video sicp lectures available in several places for free on the public internet
perfect for the beginning programmer that wants to learn 100% pure scheme-based DIVINE INTELLECT without tainting their mind with gay imperative brainrot like "loops are a fundamental part of programming languages" and "programs are made out of statements"
 
I would not recommend a novice learn from ChatGPT as the source of truth - then it's the blind leading the blind.
Dealing with code is different than other kinds of learning because working code is a third source of truth, as well as you and your teacher. LLMs often get things wrong, but my experience has been that I'm faster at fixing LLM bugs, often, than I'd have been writing the whole thing from scratch. Sometimes it takes a bit of shopping and rewording, but if I am, for example, slightly intoxicated, I can just jam the code into my compiler and see if it works.
 
For someone new I would recommend not letting the AI do it for you, but you can get quite a bit of mileage out of it for doing code reviews, (if you are on your own don’t have access to more senior dev’s time to nitpick what you wrote). GitHub copilot added this in a month or so back. I’ve found it catches a significant amount of my bullshit. Don’t take it’s solution as gospel though, use it as a suggestion of what to spend some more effort on.

The explain function is also really good for programmers of any experience level, especially when confronted with an unfamiliar language or niggerlicious code block. For example, I got stuck maintaining this little program some sperg wrote in rust at my company that everyone uses to shim self signed ca certs into our Mac laptops, and one day some changes broke the thing. I would have spent hours looking up rust idioms if it weren’t for explain.

I personally shut off in editor codegen because the shit it writes is, well, shit.

If you have low impulse control,
I would recommend not using LLMs at all. If the temptation is to make it do it for you, it’s better to just remove the temptation.
 
Last edited:
That attitude is directly a result of having to pull in some lib for even the most basic things, which trains people that "that is perfectly fine with now drawbacks(tm)" Which also results in an attitude of making libs as small as possible. (altough, that is also kinda historical, as minifiers werent around for quite some time)
I texted a buddy of mine who works at a FAANG about this, and he told me that his company hosts their own NPM/node shit, and that all updates are glacial because of the auditing involved.

I think you’re onto something with the standard library point, it would fix a lot of this
 
I would have spent hours looking up rust idioms
one critical programmer skill is cobbling together programs with one eye on the documentation and one eye on the code you're writing and another eye on the output of the program and yet another eye on some other documentation and the other eye pointed at a list of things you want to do so you don't forget what's going on
most programmers use this skill to write bash scripts and css stylesheets

if you don't have at least 5 eyes you really have no business programming

i think the biggest retard moment here is that it's harder than it needs to be to look up all the stupid punctuation that rust likes to pass off as "syntax"
that all updates are glacial because of the auditing involved.
surely that doesn't cause any security vulnerabilities when randomdipshit23 accidentally fucks up bad in the terminal-pastel-colors-ng package and introduces a horrible security vulnerability that he fixes 9 releases later without any real advisories or anything like that
 
surely that doesn't cause any security vulnerabilities when randomdipshit23 accidentally fucks up bad in the terminal-pastel-colors-ng package and introduces a horrible security vulnerability that he fixes 9 releases later without any real advisories or anything like that
From the brief description he gave of the process, it’s a mix of coverage testing and human review. Obviously nothing is perfect, but I’m at least somewhat glad that the supply chain issue is being taken seriously
 
I texted a buddy of mine who works at a FAANG about this, and he told me that his company hosts their own NPM/node shit, and that all updates are glacial because of the auditing involved.
At a company I used to work at, we did host our own nuget repository. But mostly for the purposes of being able to reuse packages from earlier projects.

I think the project I worked on, we had about 7k npm packages as dependencies though. (for the dev setup, when including indirect dependencies) I think uncompressed, without dead branch elimination, it came to over 1 gig. After running it through webpack (man, that webpack config was terrifying to look at, because of all the typescript stuff, loading interfaces from swagger + a lot of shit I didn't understand at the time and now don't remember), it came out to like 500kilobytes, afair. For the whole application (react SPA for monitoring some industrial machinery + basic task assignment)

Many of the packages, like chart.js were really quite good. But through them a lot of useless shit got pulled in. Also, the programming of some of them made dead branch elimination just not work well/at all (stuff like using strings to decide on what functions to call, which makes the compiler have to retain all possibly called functions and such shit. I don't remember whether we just gave up or if we found some way to get rid of such branches at some point. (I assume the former)

I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs.
 
one critical programmer skill is cobbling together programs with one eye on the documentation and one eye on the code you're writing and another eye on the output of the program and yet another eye on some other documentation and the other eye pointed at a list of things you want to do so you don't forget what's going on
most programmers use this skill to write bash scripts and css stylesheets

if you don't have at least 5 eyes you really have no business programming

i think the biggest retard moment here is that it's harder than it needs to be to look up all the stupid punctuation that rust likes to pass off as “syntax”
Well the thing is that when your told to unblock all significant subset of devs by fixing a piece of code that you didn’t write and don’t understand, written in a language you never used before because the sperg who wrote it had to be special and cool, and he got fired for doing that sort of shit, you’re judged on how fast you restore order, not on how elegant and academic your solution is. I didn't need to learn rust at that moment, I needed to get everyone back to work. It turned out to be a one line change, I just had to figure out what I was looking at. And for that, copilot more than earned its license fee that day.
 
I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs.
I hate ansible too.

I texted a buddy of mine who works at a FAANG about this, and he told me that his company hosts their own NPM/node shit, and that all updates are glacial because of the auditing involved.
Where I work we do the same. We have JFrog that hosts all the shit we can use. But it is a mess, since nothing stops you from using outdated libraries, and often same libraries are maintained in multiple different repos for different areas.
Also jeets certainly don't help.

C++ + Boost keeps winning babbbyyy.
 
using strings to decide on what functions to call, which makes the compiler have to retain all possibly called functions and such shit
i think even if you used enums the compiler would still have trouble eliminating unused functions in this situation
one of the possible techniques here is to enumerate the functions that are definitely called, the functions that are not called, and the functions that are maybe called
then you run the whole test suite and trace which of the "maybe" set are actually called
this obviously is not very good if your integration tests are shit or you are just unlucky enough to have the tracing code perfectly dodge some actually critical functionality

also it should probably not be applied in certain areas where you have "this needs to be executed in 1/4000000 calls but if it doesn't execute the nukes get launched and we all die" type programs
which i guess is many algorithms so i guess this should be applied somewhat carefully instead of using it on every single branch in the entire program
I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs. I hate stringly typed programs.
strings are actually a decent, natural, and performant way to do enum-typed things if your language implementation implements strings in a certain way
there is still no excuse to convert from float to ascii decimal to double to ascii decimal to int though
 
strings are actually a decent, natural, and performant way to do enum-typed things if your language implementation implements strings in a certain way
there is still no excuse to convert from float to ascii decimal to double to ascii decimal to int though
Yes, they can be used to help with enums, but I am not talking about typescripts enum strings, but rather stuff like passing in a regular string into a function then doing a switch based on that. As in, the actual possible values are only known on runtime. And at dev time, you have to look at the actual code to see what strings are valid, if it is even possible to determine from the code alone.
i think even if you used enums the compiler would still have trouble eliminating unused functions in this situation
Kinda? in a lot of cases, the UI only lets you use certain values which can be used to eliminate certain branches in functions called by the UI, which can then cascade down. This can easily break down though, when something gets turned into plain strings.
 
there are video sicp lectures available in several places for free on the public internet
SICP is not for beginners

"For perspective, SICP was written to accompany a course for MIT students. Students who not only had the background for MIT, but access to its authors, MIT grad student teaching assistants, and soft resources like study groups. Students who were not usually working full time jobs.

On top of that, it was written to challenge even the best of those students (including grad students).

SICP is really really hard for just about everyone...at least in parts...by design. That's what makes it a good book. You can keep going back to it for years and years and learning something as you gain relevant experience and knowledge."

"SICP is known to be quite difficult - it was originally written for MIT students who also had college-level training in other math, science, and engineering subjects including calculus - as I recall SICP assumes you know something about these."
 
Last edited:
Back
Top Bottom