Programming thread

I get the impression that if you're not literally copying verbatim from Stack Overflow, it doesn't work so well. It really can't innovate very well, even innovating minor differences.
This is what stops me jumping on the hype train. In very specific circumstances these models can work well, but the moment any sort of imagination or complex, business-specific logic is required it all goes out the window. Hell even for things like unit tests I'm still dubious because how can you be sure the test is correct? And if you're checking it for validity why not just write the damn thing yourself to begin with?

Right now I don't see CoPilot and likes as anything more than a developer aid, the thing you'll use to get answers to basic questions that Stack Overflow or various forums currently provide, or a quick way to document the likes of APIs or your project's architecture. It will take one hell of a leap for these models to do what many people think they already can do.
 
  • Agree
Reactions: Marvin
I'm convinced that like 90% of the hype around GPT/copilot are dudes who are primarily grifters of some stripe seeing it make a CRUD todo app and being like, "WOW IT'S FUCKING OVER FOR DEVS"

Because the only things these dudes have ever done is CRUD todo apps and they think that's basically all software dev is.
 
I've been using C++, mainly for modding the Serious Sam 1 engine, along with Win32 joke programs that aren't harmful. I have heard of learncpp.com and cplusplus.com, which are frankly quite helpful, but I should be more productive with coding due to wanting to become a better programmer. Plus, I could learn more about other topics as well, such as SDL, OpenGL, OpenAL, and ImGui. And obviously working with Input/Output streams, files, arrays, strings, and pointers are essential too.
 
I'm convinced that like 90% of the hype around GPT/copilot are dudes who are primarily grifters of some stripe seeing it make a CRUD todo app and being like, "WOW IT'S FUCKING OVER FOR DEVS"

Because the only things these dudes have ever done is CRUD todo apps and they think that's basically all software dev is.
I'm firmly not part of the hype train, but there is potential for AI to completely reshape programming. GPT (after some arm twisting) can take a vague schema description and some data and format that accordingly, extrapolating on that could make literate programming an actual reality where an AI effectively takes over for the lexer.
Of course, an AI compiler isn't going to happen anytime soon, it's not low hanging fruit. The current bleeding edge state of the art approach of Grug throwing in 10 gigabytes of extra training data compared to Torg and making a more betterer model is very limited in scope.
 
Right now I don't see CoPilot and likes as anything more than a developer aid, the thing you'll use to get answers to basic questions that Stack Overflow or various forums currently provide, or a quick way to document the likes of APIs or your project's architecture. It will take one hell of a leap for these models to do what many people think they already can do.
I'm using the paid version of copilot right now for work. It's pretty good at generating boilerplate and copying things that a lot of people have written before (eg getting fields from a JSON object), but beyond that it's pretty hopeless. Yes, it can regurgitate common algorithms, but that doesn't make it anything approaching "smart." It's just a fancy autocomplete and works well for that.

ChatGPT is totally useless for coding (and yes, I'm also using the pro version). It takes longer to read its output and tell it that it has a bug than to just write the stupid function yourself.

I write a lot of Go, Rust, and C++, though, so I guess if you're the type who slings HTML and JS they may be marginally more useful.
 
I recently watched a dude try to wrangle ChatGPT into writing some Swift code for him. He huffed and whined for some 20 minutes about how "that's not what he asked for" and "it's just regurgitating the same paragraph" and "it just doesn't understand him", ultimately giving up and doing the whole thing himself in 4 minutes flat.
 
  • Like
  • Thunk-Provoking
Reactions: Marvin and SIMIΔN
Imagine some pajeets trying to AI away some kind of app permissions logic that has some subtleties, and then suddenly some system has a huge gaping security hole.
I'm certain it will get worse considering Pajeet likes to be as lazy as he possibly can while still looking incredibly productive. I'm morbidly curious as to where this goes.
The most worrying thing isnt even pajeets but the non-technical middle managers that hired them. Almost universally if they see something run once and it works they go "ship it" and can't wrap their brains around the fact that it's catastrophically wrong. They'll just keep hiring more and more pajeets to use copilot and firing more of their competent staff until it's too late.
This, it might not be Skynet that kills me, but a catastrophic bug generated by a timesaver by someone hired as a costsaver.
I initially thought LLMs would reduce the need for 码农/code-peasants, but it just empowers their worse tendencies.
ChatGPT is totally useless for coding (and yes, I'm also using the pro version). It takes longer to read its output and tell it that it has a bug than to just write the stupid function yourself.
It saves time writing boilerplate, but frameworks deal with that already.
It saves time writing long established solutions, but importing libraries does that already.

It's funny, coding might be one of the last jobs to be killed by LLMs/AI. No one would have expected artists and human-resource managers to be the first to go. Nor language teachers (I've found ChatGPT great at providing Chinese examples and explaining the differences between similar terms.)
 
GPT (after some arm twisting) can take a vague schema description and some data and format that accordingly, extrapolating on that could make literate programming an actual reality where an AI effectively takes over for the lexer.
I can see a valid use case for this in data analysis, like being able to write SQL queries in natural language.

This is very likely going to be the first thing to be conquered since it's a lucrative market. Tons of people out there with domain-specific knowledge who just can't figure out R or SQL. It'd be a good replacement for SPSS.
 
Speaking of SQL:

Is there a way to define pretty (3NF+) tables to describe three entities (let's say) Employee, Team, Company so that:
each Employee is in one Company,
each Team is in one Company,
an Employee belongs to 0 or more Teams,
a Team consists of 0 or more Employees,
and for every Employee-Team relation, both ends belong to the same Company.

I'm thinking of something like
table Company pk(company_id)
table Employee pk(company_id, employee_id) fk company_id
table Team pk(company_id, team_id) fk company_id
table EmployeeTeam pk(company_id, employee_id, team_id) fk (company_id, employee_id) fk (company_id, team_id)

Is this even correct? Is there an easier way to accomplish this?

My gut feeling based on the current political climate and the few preliminary legal musings I've read is that this sort of stuff will probably end up qualifying as derived works and therefore Microsoft would be guilty of attempting FOSS license laundering (and therefore, every company which uses copilot in production for proprietary applications could potentially be guilty of violating the GPL).
Hahahaha what. No fucking way. Most if not all "tech giants" got where they are (or rather where they used to be) by straight up breaking laws, infringing copyright, not asking for model releases, stealing money and private data, and of course not paying taxes. Microsoft will definitely get away with everything -- but you won't. Oh, the EU might use FOSS as a cudgel against an uppity unwoke company, should one come along, but they will do it to take a popular product from its happy customers the common people, not to make the capabilities more affordable and accessible. Do you lave a loicence for that GPU?
 
Last edited:
  • Agree
Reactions: nah
Speaking of SQL:

Is there a way to define pretty (3NF+) tables to describe three entities (let's say) Employee, Team, Company so that:
each Employee is in one Company,
each Team is in one Company,
an Employee belongs to 0 or more Teams,
a Team consists of 0 or more Employees,
and for every Employee-Team relation, both ends belong to the same Company.

I'm thinking of something like
table Company pk(company_id)
table Employee pk(company_id, employee_id) fk company_id
table Team pk(company_id, team_id) fk company_id
table EmployeeTeam pk(company_id, employee_id, team_id) fk (company_id, employee_id) fk (company_id, team_id)

Is this even correct? Is there an easier way to accomplish this?

The way I am reading your description of the relationship suggests that even though Employee E1 and Team T1 are associated with Company C1, the E1-T1 association can belong to Company C2. Is this accurate? If that's true, then I'd remove the constraint on the associative table EmployeeTeam for (company_id, team_id) and make another associative table off that and Company, since you want to treat the Employee-Team relationship as its own entity.

If that's not the case, then I think it's redundant to have the associative table EmployeeTeam need to keep track of E1-T1 associating with C1 when the Employee table and Team table already have a constraint on the Company table.
 
The way I am reading your description of the relationship suggests that even though Employee E1 and Team T1 are associated with Company C1, the E1-T1 association can belong to Company C2. Is this accurate?
No, the relationship is only associated with a company through the employee and the team (and it should be the same company on both ends).

If that's not the case, then I think it's redundant to have the associative table EmployeeTeam need to keep track of E1-T1 associating with C1 when the Employee table and Team table already have a constraint on the Company table.
How would the "no membership in a foreign team" be enforced, though? E1 is in C1. T2 is in C2. What's to prevent me from having E1T2 in the EmployeeTeam table? Yes the information about the physical world is in the database and can be checked programmatically at insert/update time (with locks) but the database will not enforce integrity.

(Also if I forget the lock, there can be concurrency fuckery. And if an employee changes companies later, he will stay in the old company's teams unless I programmatically kick him or block the change.)

(If employees and teams can change companies, making the company part of the employee and team primary keys will result in many, many updates and reindexing in other tables having those as FKs. For the purpose of this problem, assume that team membership changes happen a lot, but employees and teams "rarely" get transferred from one company to another.)

(I also know composite keys can cause indexing issues and the current crop of tranny programmers on both the user and DBMS developer side aren't any good dealing with them, and most ORMs don't support composite keys which limits the choice of etc etc.)
 
  • Like
Reactions: nah
No, the relationship is only associated with a company through the employee and the team (and it should be the same company on both ends).


How would the "no membership in a foreign team" be enforced, though? E1 is in C1. T2 is in C2. What's to prevent me from having E1T2 in the EmployeeTeam table? Yes the information about the physical world is in the database and can be checked programmatically at insert/update time (with locks) but the database will not enforce integrity.

(Also if I forget the lock, there can be concurrency fuckery. And if an employee changes companies later, he will stay in the old company's teams unless I programmatically kick him or block the change.)

(If employees and teams can change companies, making the company part of the employee and team primary keys will result in many, many updates and reindexing in other tables having those as FKs. For the purpose of this problem, assume that team membership changes happen a lot, but employees and teams "rarely" get transferred from one company to another.)

(I also know composite keys can cause indexing issues and the current crop of tranny programmers on both the user and DBMS developer side aren't any good dealing with them, and most ORMs don't support composite keys which limits the choice of etc etc.)

Good point, I made a retarded suggestion about losing the constraint on EmployeeTeam. I can't think of a different way to go about this than what you've come up with. Granted I am not some RMS-esque greybeard who remembers migrating from flat files to IBM's new-fangled DB/2 system.
 
  • Informative
Reactions: Safir
I'm not sure if this is the thread to ask, but I couldn't find a better one. I'm in a situation where I absolutely have to learn C# for work. I'm in the field of automation, so PLC programming is what most of my work is. I also have some hobby projects in Python and C under my belt. Are there any (good) online courses where I could start with C#? I've looked at W3schools and that's been somewhat helpful, but I'd like to do some exercises that would help in understanding the language. All I've found so far are either expensive or some vague pajeet-y courses that I can smell are some kind of scams from a mile away.
 
  • Like
Reactions: Marvin
I'm not sure if this is the thread to ask, but I couldn't find a better one. I'm in a situation where I absolutely have to learn C# for work. I'm in the field of automation, so PLC programming is what most of my work is. I also have some hobby projects in Python and C under my belt. Are there any (good) online courses where I could start with C#? I've looked at W3schools and that's been somewhat helpful, but I'd like to do some exercises that would help in understanding the language. All I've found so far are either expensive or some vague pajeet-y courses that I can smell are some kind of scams from a mile away.
I've never found much value in courses personally. I usually pick a medium sized project idea and dive in and learn along the way. Like something like a todo list web app or a shitty microblogging clone. Typical CRUD stuff.

There's usually enough documentation out there to at least lay that foundation, and you'll get a better exposure to real world situations interacting with practical problems.

Like step one: figure out what the popular web framework for the language is and figure out how to have it http serve data (both static files and printf a hello world).

Step two: throw up a db in docker and figure out how to connect to it via your language.

... you get the idea.

I guess if you're doing this for work, a course won't be a bad idea, but doing a small project will make you far more competent than passive learning.
 
I recently watched a dude try to wrangle ChatGPT into writing some Swift code for him. He huffed and whined for some 20 minutes about how "that's not what he asked for" and "it's just regurgitating the same paragraph" and "it just doesn't understand him", ultimately giving up and doing the whole thing himself in 4 minutes flat.
ChatGPT has been a great search engine replacement. Google seems to get worse every day. ChatGPT will spit out all sorts of obscure osdev information that is otherwise hard to find, relegated to literal books written in the 90s. It'll write small discrete functions without issue, if you ask it to intersect a ray with a plane in 3D space and return the fraction, it will do it. If you ask it to write a function to setup the PIT along with the accompanying ISR, it will.

ChatGPT will introduce bullshit code and bugs if you're not careful, but even with the time it takes to apply your own sanity check to the code it's way faster and better than digging through the pile of shit that's stackoverflow or whatever.
 
I got around to buying an 80% off Udemy course on Python. In college I had to, as a math major, take the very first introductory C++ course. I loved it and I felt that I would have been a very good programmer as I did very well in mathematics, the two at that level being very similar (working with symbolic notation and chains of logic). Even before I took that class I had basically taught myself to program in Excel, although I didn't realize that was what it was at the time, because I would constantly use the functions in it, some of them very intricate, to do things. I had this one "random world generator," a toy I made in Excel, that was basically a generator for a hypothetical 4X space game, and when I learned C++ basics I recreated it in C++.

I'm thinking about maybe changing my career back to programming. It's tedious going through the videos explaining how to do things just because there's some petty grammatical difference from C++, but easy to get it conceptually. I got through with functions today, so I feel comfortable knowing I have the basic tool set under my belt. GUIs are what I really want to learn, something where you can actually click buttons and have decent-looking output and not be staring at lines of text.
 
I like programming but I hate my algorithms class so fucking much this shit is so gay. I like every other aspect of CS, I just can't into NP Complete reductions and Dynamic Programming to save my life.
 
  • Deviant
Reactions: Safir
I like programming but I hate my algorithms class so fucking much this shit is so gay. I like every other aspect of CS, I just can't into NP Complete reductions and Dynamic Programming to save my life.

I'm going on a limb here and guessing you don't like it because the professor is making you use CLRS (Introduction to Algorithms by Corman, Leiserson, Rivest, and Stein), then it's going to be a gay time even if you have no problem with Math/(actual)Computer Science. I recommend the book "A Common-Sense Guide to Data Structures and Algorithms" by Jay Wengrow to anyone who is learning basic DSA ever since I became aware of the book. Instead, you should keep CLRS as a reference since you've already paid for it.

Although since you mentioned NP Complete Reductions you could be doing a second course in Algorithms, which the above book doesn't help with at all. Still, it does have a chapter on Dynamic Programming.
 
Last edited:
  • Informative
Reactions: HexFag
I'm going on a limb here and guessing you don't like it because the professor is making you use CLRS (Introduction to Algorithms by Corman, Leiserson, Rivest, and Stein), then it's going to be a gay time even if you have no problem with Math/(actual)Computer Science. I recommend the book "A Common-Sense Guide to Data Structures and Algorithms" by Jay Wengrow to anyone who is learning basic DSA ever since I became aware of the book. Instead, you should keep CLRS as a reference since you've already paid for it.

Although since you mentioned NP Complete Reductions you could be doing a second course in Algorithms, which the above book doesn't help with at all. Still, it does have a chapter on Dynamic Programming.
The book I used for that class was Algorithms by (Dasgupta, Vazirani, Papadimitriou). I'll check the other book just in case it does help things click with me but I had to do the entire book for a class.
 
Has anyone had to deal with borderline braindead "security auditors"?

A prospective mega client wanted a third party security firm to audit another team's product source code, which isn't completely crazy or a waste of money given what they were probably paying for it, but their auditor just ran some SAST tool, which I guess is Sonarqube or something similar and it revealed that we were using MD5 in the software. MD5 is of course no longer suitable for cryptographic purposes, but their software was using it to make sure that a large data transfer completed successfully, and had been doing so for decades.

I got called in to consult on this because management had no clue what to do and I completely agreed with this assessment, and besides there was a large legacy of hashes that would have to be recomputed for no good reason. The "security firm" pushed back with all sorts of supporting evidence saying how insecure it was, despite the fact that our "adversary" was just network conditions and TLS was used at all points anyway. It started getting escalated to the C-levels because the client started getting nervous and I later learned that the finding was accepted and fixed - they were able to find a solution that eliminated the use of MD5 but kept the hashes.

By chance I happened to bump into one of that team's developers at a bar a few months later and after swearing me to secrecy he told me how they got around it: he just looked up the MD5 pseudocode from Wikipedia, implemented it himself over a weekend, and declared that they were now using an alternative hashing function which solved the problem, and indeed Sonarqube couldn't find it so it was all OK. The whole team knew what was going on and just waved it through code reviews anyway.

This isn't the first time I've heard of perfectly good time wasted in the name of compliance. Every time I work with a security consultant I expect Mr Robot but end up getting Wally from Dilbert, I hate them so much.
 
Back