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.
For learning resources, I'm going to shill Bing's copilot (the web app not the W11 spyware). If you use it as a teaching material ("Teach me about...", or "Explain...") instead of trying to use it to replace your own thoughts, I find it's really useful to chain questions and actually learn from it, moreso than resources since it's interactive. Plus, you don't have to sign in to use it. I've probably learned more math from it in the last few weeks than from school, lol.
Can you give a quick concrete example of a success using Bing in this way? I've written machine learning code of my own but am fairly old school about search engine use and my experience with LLMs is largely trying to get them to say the nigger word etc.
 
For learning resources, I'm going to shill Bing's copilot (the web app not the W11 spyware). If you use it as a teaching material ("Teach me about...", or "Explain...") instead of trying to use it to replace your own thoughts, I find it's really useful to chain questions and actually learn from it, moreso than resources since it's interactive. Plus, you don't have to sign in to use it. I've probably learned more math from it in the last few weeks than from school, lol.
How do you know what it tells you is correct if you don't already know the subject?
 
How do you know what it tells you is correct if you don't already know the subject?
Bing has inline citations, so you can check its work, so to speak. Generally you can tell if something's off or not, or use it to springboard further research etc. One nice thing I've used it for is the prompt "Find resources about...", which will usually get you 5 or so real links to technical documents or recommendations for books to 'take out from the library'.

The same criticism can be said for human teachers too, and it's potentially worse given any number of political motivations - Bing at least stays on topic.
 
For learning resources, I'm going to shill Bing's copilot (the web app not the W11 spyware). If you use it as a teaching material ("Teach me about...", or "Explain...") instead of trying to use it to replace your own thoughts, I find it's really useful to chain questions and actually learn from it, moreso than resources since it's interactive. Plus, you don't have to sign in to use it. I've probably learned more math from it in the last few weeks than from school, lol.
I feel like the only people that think AI can actually replace programmers dont understand anything about ai or programming. But I will say AI is really fucking useful for regex cause I aint memorizing that fucking shit and its great for learning cause its gives answers that are relevant to your specific project.

It replaced stack overflow. It didn't replace actual programmers.
the computer will usually quickly shit its pants

The computer WILL usually quickly shit its pants over anything. Sometimes its not even the code and its your bundle being on aws and not azure. Its fucking fickle sometimes.
 
The nice thing about code is that you can test it and the computer will usually quickly shit its pants if it's wrong
I think this becomes a problem along the lines of the classic "Just because it compiles doesn't mean it works properly." phenomenon.

I find reading other people's code to be pure torture at times, but at least there's a human thought process behind it that I can reverse engineer if I put my retard helmet on. An LLM will spew out something partially correct and say it with utmost confidence and authority. Though, unlike a human retard, there's no direct logical thought process behind its output.

An LLM can't properly explain the exact "reasoning" it used to arrive at a particular answer either. The most you can do is trap it in a logical snare and have it spit out a Fatrick-tier remark about how "I definitely knew the right answer, stalker child. I was just distracted. Enjoy prison."

As a quick, shitty example, I schooled Grok a while back at basic calculus:
IMG_8610(1).jpgIMG_8611(1).jpg
It did a remarkably decent job procedurally, but it fucked up partial derivative for y by using the chain rule without good reason. I'm confident most calc students wouldn't catch stuff like this; what makes us stupid code monkeys any different when even the best of us overlook simple shit?

AI is really fucking useful for regex cause I aint memorizing that fucking shit
It's really not that hard.
regex4dummies.png
I say this to be encouraging, not to be a douche. It's just patterns with quantifiers. It's very rare that I have to use more than 5-10% of what is listed on the cheat sheet.
 
Last edited:
I say this to be encouraging, not to be a douche. It's just patterns with quantifiers.
My biggest issue with regex is that every single thing uses subtly different syntax, so you get to play a fun game of "figure out which special characters need backslashes and which character classes are supported with which syntax" every time you switch context.
 
My biggest issue with regex is that every single thing uses subtly different syntax, so you get to play a fun game of "figure out which special characters need backslashes and which character classes are supported with which syntax" every time you switch context.
Which is why any time I have to use regular expressions I just pull up copilot, ask it to give me a regular expression that formats a string as whatever or tests for whatever and it always gives me the right regex. In fact, I bet I can make a tool that does it no ai necessary because fuck memorizing and typing out that god damn gibberish.
 
  • Thunk-Provoking
Reactions: Belisarius Cawl
Regex has been one of the most useful things I've learned since I started programming, otherwise I'd still be stuck doing string fiddling. Just good luck maintaining any regex strings more than 10 characters long
 
My biggest issue with regex is that every single thing uses subtly different syntax, so you get to play a fun game of "figure out which special characters need backslashes and which character classes are supported with which syntax" every time you switch context.
Very fair point, and a gripe of mine as well. Putting aside all of Perl's additions that are often missing from other languages, I love GNU, but this Basic vs Extended shit infuriates me to no end. I argue the "Basic" version is a bigger pain in the ass to work with, considering how often groups are used in basic patterns.

Glares at Racket:
Code:
(regexp #rx"(\\\t)*")

Which is why any time I have to use regular expressions I just pull up copilot, ask it to give me a regular expression that formats a string as whatever or tests for whatever and it always gives me the right regex.
fuck memorizing and typing out that god damn gibberish.
This amounts to typing a few extra backslashes to make use of normal regex characters (e.g. (.+)). Modern languages tend to replace the direct need for things like assertions and the fancier forms of capturing, so you can get by most of the time using the very basics that should work across most implementations. Hardly a reason to forgo learning something so incredibly powerful and quick to use once you're familiar with it.
 
Not-so-fun fact: BBCode is typically processed using pretty simple regex. Its forgiving nature (i.e. Allowing lack of closing tag) weirdly makes this work fairly reliably, though you will quickly notice some quirks if you play around with tag positioning and nesting.
 
Not-so-fun fact: BBCode is typically processed using pretty simple regex. Its forgiving nature (i.e. Allowing lack of closing tag) weirdly makes this work fairly reliably, though you will quickly notice some quirks if you play around with tag positioning and nesting.
What should happen when you do something like this?
Code:
[B][I]niggerlicious[/B][/I]
 
  • Thunk-Provoking
Reactions: UERISIMILITUDO
Very fair point, and a gripe of mine as well. Putting aside all of Perl's additions that are often missing from other languages, I love GNU, but this Basic vs Extended shit infuriates me to no end. I argue the "Basic" version is a bigger pain in the ass to work with, considering how often groups are used in basic patterns.

Glares at Racket:
Code:
(regexp #rx"(\\\t)*")



This amounts to typing a few extra backslashes to make use of normal regex characters (e.g. (.+)). Modern languages tend to replace the direct need for things like assertions and the fancier forms of capturing, so you can get by most of the time using the very basics that should work across most implementations. Hardly a reason to forgo learning something so incredibly powerful and quick to use once you're familiar with it.
Well, Im not opposed to memorizing the basics, but sometimes it just makes more sense to look it up.
 
I agree with the overall sentiment I've seen that GeeksforGeeks is a very uneven resource without much in the way of quality control. Packt Publishing is similar but they go into niches that are sometimes not as well-explored by other publishers. (It's worth the risk for $0.00 at least.) One thing I definitely don't like about GeeksforGeeks though is the frequency of pajeet English. The subject matter is often hard enough to navigate without that additional impediment.
My impression of G4G after mentoring a lot of college students is that came to be and exists primarily for students, especially foreign students, to cheat through a CS degree, kind of like a glorified Chegg. That it provides any sort of real assistance to others doing non-college related shit may be a (positive) side effect.

The nice thing about code is that you can test it and the computer will usually quickly shit its pants if it's wrong
This man has clearly never written old school PHP or Javascript.

My biggest issue with regex is that every single thing uses subtly different syntax, so you get to play a fun game of "figure out which special characters need backslashes and which character classes are supported with which syntax" every time you switch context.
That everyone doesn't just use PCREs at this point (including and especially Python), is a fucking travesty.
Hi guys how do I parse HTML using regexes
Something something Chomsky heirarchy
 
FURTHER EDIT: In researching for this effortpost, I found out that OCaml is apparently good for writing interpreters, which if that's the case, I very well might try my hand at it for my toy language. Will report back.
Any language based on Meta Language is extremely good for writing interpreters. I would genuinely suggest Haskell, it's ungodly fast if you put the time and effort into learning the language + the quirks of how it compiles (like when to use foldl vs foldr vs foldl' vs foldr'). Basically you can unintentionally end up using a ton of memory on accident if you don't understand what the compiler is doing. Richard Bird's books are a great resource for this. But once you get it right it's fucking miraculous how fast it is. I love writing toy languages and at this point would only choose Haskell for that job. If you're the kind of person who would like to write a toy language you're also probably the type of person who will find Haskell fun to write.
 
I continue to insist that any language for which Stack Overflow or similar websites would be desirable is a language that is documented poorly.

As for regular expressions, I just read the Info documentation when I'm not testing one interactively, and I'm almost always testing them interactively. I know some Lisp libraries permit the programmer to use normal regular expression syntax, or S-expressions when they would be more clear. I should dig up an article I was reading about something to do with regular expressions that compose better, or perhaps that article had to do with SQL.

I was recently thinking about "Hyrum's Law" again, and its relationship to the Go language, and at least half of the problems with which those fuckwits masturbate themselves are cleanly solved by multiple implementations. No decent Common Lisp programmer depends on hash table iteration order, because Common Lisp has a real standard that doesn't guarantee it and multiple implementations which vary in this respect. I believe "Hyrum's Law" to be far from some fact of the universe, and instead the result of both a total lack of discipline and an inability to enforce any.
 
Back