Programming

AlteredStateBlob, in AI and Coding.
AlteredStateBlob avatar

I have built several programs with ChatGPT 4 by now. From very basic Python scripts to Python webscrapers and C# in combination with Unity3D.

In the beginning it was much better than it is currently. At the moment context is severely hampered no matter the limit and you'll be bashing your head against circular arguments and it straight up ignoring stuff you just posted two messages ago.

Trying to troubleshoot code it wrote a few days ago will be a slog and like dragging yourself over nails at times. Here's what I have found to help and make life better:

  1. Be very, very, very precise in your instructions. And keep them saved, so you can reuse them later (point 4)
  2. From the very start plan to build your project with small functions that interact (good policy anyway) which makes troubleshooting and changing these functions much easier and will prevent you running into message limits.
  3. If it fails to work for you the way you need it, you'll might have to scrap your entire code and start over with ChatGPT -> Again, the reason for point 2 being very important. Scrapping one functin is much less painful than an entire tool.
  4. Start new chats when you feel the quality degrading. Sometimes it helps and since the context is garbage at the moment anyway, it doesn't matter much.
  5. Post the code it is supposed to fix every single time. It will inevitably refer to other code, code hallucinations, etc. otherwise. Again why point 2 is important.
Avalanched,
Avalanched avatar

god I hate those circular arguments, it's like you're arguing with a todler

minorninth, in SOLID Principles: A Quick Guide (.NET examples)

The thing that bothers me about SOLID principles is that they don't come with caveats explaining WHEN it's a good idea to use them.

Single Responsibility Principle: in your example, the Order class only has 4 methods and they're all related. There's no reason to break it up. Breaking it up would just make the code needlessly complex. Blinding following SOLID makes the code worse, not better.

Open-Closed Principle: in your example, the problem isn't that AreaCalculator is open to modification, the problem is that it should use a Shape interface and each Shape should compute its own area. That has nothing to do with Open-Closed. Open-Closed is actually a terrible idea to follow 90% of the time. You shouldn't avoid modifying code. Adding a new subclass every time you need new behavior just adds needless complexity. Blinding following SOLID makes the code worse, not better.

Liskov Substitution Principle: this is fine

Interface Segregation Principle: this is fine

Dependency Inversion Principle: also can be easily overused. Often there's nothing wrong with a low-level module that other modules depend on. When these are big modules that are part of a software system, then sure, it's good advice. But most projects depend on lots of modules that have a single clear purpose and are relatively stable. There's no need to add additional layers of abstraction for these.

For 3/5 of the principles, the principle says "do this", when in reality, most of the time you shouldn't do that. Only when your program is getting complex and hard to maintain does that principle suddenly help give you a solution.

amio, in AI and Coding.

ChatGPT is a language model, it's not intended for code and you're using it "off label" at your own risk. It can produce working code, which is impressive in itself, but in order to know if it's decent code you still need to be competent with that language. I had someone run a few prompts for me a while back, it ignored central parts of the query, and its output was basically like a very junior developer - fair enough, but not great or even that good.

Potentially useful, but if you expect it to be more than one part of the "process", you might be setting yourself up for trouble.

Edit: just like it's not a coder, it's not a search engine or knowledge base, either. It just knows language and what seems like it ought to follow a given phrase. Be very aware of this difference, because sometimes it spits out 100% falsehoods with the same level of confidence and authority as the true stuff.

Kichae, (edited )

I think it's important for people to also truly understand that generative machine learning models like ChatGPT also only "know" what they've seen before. There's no interpretation or synthesis. It merely regurgitates what it's seen, with some sampling from a probability distribution.

This means, if you're asking for something niche, and it's only seen what you're prompting it for once (or, really, the same text repeatedly across multiple websites) , there's a very good chance that it will just recreate that artifact wholesale.

Which means you need to be cognizant of what the license for that material is before you use it in a product!

DarkNightoftheSoul, in Need Advice: "Developer Training" doesn't feel helpful and I am not sure what to do
@DarkNightoftheSoul@mander.xyz avatar

ass value

ehhhehehe

Seriously though, maybe the guy is not meant for teaching. A lot of amazing performers in industry suck at teaching the relevant skills, and vice versa.

ZahzenEclipse,

lol fixed- thank you. I think you are on to something there - I don't necessarily think he is a bad MENTOR but I don't think he's taught programming before so he doesn't have a formal system for teaching us. I am wondering if there might be a way I can try to work with him to try to make what we are learning/teaching easier to digest for myself cause i am certain it would benefit the other devs.

Snarwin, in Need Advice: "Developer Training" doesn't feel helpful and I am not sure what to do

Honestly, meetings like the one you describe don't sound like they'd be helpful for anyone, especially not beginners. You say you "feel like" the new developers are getting something out of them, but have you actually asked them? My guess is, they're just as bored as you are, but doing a better job of hiding it.

Unforeseen,

Agreed this sounds horrific to me. I wouldn’t be able to learn that way, I’d probably end up resenting it

ZahzenEclipse,

Honestly, appreciate you all confirming this. Makes me feel less crazy or less of the problem. I was at the point that I felt like I needed to go get tested for ADHD cause of my inability to focus on these presentations at times.

ZahzenEclipse,

Thank you for responding. I think you may be on to something in that sense regarding the new developers. I think they are still so new in software dev that they probably aren't even sure what is the most effective for them but the reason why I say they are probably learning better than I am is due to the fact that they worked (watched) him design and create business rules DLLs and standards which we didn't have when I first created my first program (I started about 2 years before others, while the team was still brand new and we couldn't get devs from outside to stay longer than a year).

TheOneCurly, in Need Advice: "Developer Training" doesn't feel helpful and I am not sure what to do

Is the atmosphere appropriate to you taking a laptop with you and doing some personal research/training while the lecture is happening? You can be involved when necessary and catch important tips but otherwise can treat it like self-led learning time.

ZahzenEclipse,

Thank you - I appreciate the response. That is what I do but I felt like I wasn't being very helpful in both situations because I was attempting to multitask and I am honestly terrible at it. Recently, I've tried to try my best to focus on the content, thinking I was struggling due to multi-tasking but I think it's just the way he's teaching. He is an amazing supervisor/boss so I know I can talk to him but I feel like I need to come to him with concrete suggestions before doing so. I don't like raising problems without solutions personally. I do appreciate the thought though, maybe that is what I should revert to doing.

pirate526, in Code comments are (mostly) a violation of DRY
pirate526 avatar

While I agree with some of the premises here, I personally disagree that comments are even mostly a problem (a code smell). IMO they’re just as often bad as code is. A developer in a rush, or simply not taking enough care in their work, can produce both bad code and bad comments.

Perhaps someone who is trying to take care can do more harm in the comments area, when they should be perhaps looking at writing self documenting code, but in my experience they usually go hand in hand.

I use quite a lot of comments in my code and I wouldn’t regard it as code smell or even messy. I often use comments to logically separate more complex sections of functionality.. or discussing how it works and why it’s necessary to exist in the first place. Code can’t always tell you why it’s there..

I also use docblocks in some libraries, even though types are available, as the published package benefits from having an API document published alongside it. The comments there facilitate its construction.

I know this article wasn’t bashing every use of comments in code but I feel like it didn’t account for all the positive uses of them either. Teaching developers that a language feature is just mostly bad is irresponsible - we should be encouraging good comment use alongside clear code.

burliman,

The code is the “what”, the comments are the “why”. It’s the mantra I use when making them. So in a fundamental way, they never repeat themselves.

danrot,

I agree with almost all of what you say, but the thing IME is that in most cases people learn to comment a lot, which results in comments that feel like they've been done just for the sake of it, which is one of the main problems IMO. It's not like "just add a comment, it won't hurt", since comments can be immensely misleading and literally take a lot of time until figuring out that the comment was wrong if you trust the wrong ones.

I also agree that this tends to be worse with bad code, which also is not surprising. Sometimes it feels to me like people think they can fix bad code with some comments, and I think that is far from being true.

I also admit that especially the title of the article might be a bit provocative, but giving the general positive sentiment of comments I think this is called for. Sometimes you have to exaggerate a bit to get some attention. I don't like click-baiting either, but unfortunately it works ;-)

LUHG_HANI, in Scrollbars are becoming a problem
@LUHG_HANI@lemmy.world avatar

Desktop master race being killed off in favour of mobile and Mac.

grmpyprogrammer, in How do you deal with management and tech debt?

Long-time PHP dev here with 25 years of experience. The unwillingness of your lead dev to consider tools better-suited to the task is going to be a problem. I know you don’t want to bounce so soon but things are going to get painful as all the friction from ignoring tools that Laravel wants is gonna start a metaphorical fire.

Good luck.

Crunkle_Foreskin,
Crunkle_Foreskin avatar

Thanks very much for commenting.

melroy,
@melroy@mastodon.melroy.org avatar

@grmpyprogrammer @Crunkle_Foreskin I think "this is called senior dev" is unwilling, maybe not the lead developer per se.

MiataMan, in Microsoft Terminate Visual Studio for Mac

Even AI doesn't understand the differences between VS and VS Code.

The quoted article contradicts the headline

vincent233, in Microsoft Terminate Visual Studio for Mac

VS Code isn’t being shut down. It’s only the Visual Studio for Mac IDE.

cxtinac, in Why use Pascal? | Castle Game Engine
@cxtinac@sh.itjust.works avatar

I used to do a fair bit of Delphi (pascal) coding and really liked it. I agree with readable, type-safe and oop, I’m not so sure about modern and truly cross-platform. My .02$.

fsniper,

I am not a Pascal developer, I posted this because I feel like this is a good discussion topic. You don't need to have the latest and shiniest tech to build things. Sometimes old and proven is the way to go.

cxtinac,
@cxtinac@sh.itjust.works avatar

Fair enough.

pirate526,
pirate526 avatar

While I agree, this might not be true for Delphi as it was heavily tied to Windows GUI elements (of the time), so far as I remember. I built quite a lot with it and loved it, but it probably hasn’t aged well. I have no idea what the last version of Delphi was and which windows generation it was designed for.

fsniper,

You don't need to depend on Delphi itself. Lazarus https://www.lazarus-ide.org/ would be a compatible replacement.

BiggestBulb, in Coding Adventure: Making a Stronger Chess Engine (Youtube, 1:01:00)
BiggestBulb avatar

This was such a cool video. I love Sebastian Lague

Calcharger,
Calcharger avatar

Yeah, me too! I really love all his little challenges if he gives himself. Helps me form my own ideas

JWBananas, in Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
JWBananas avatar

For the uninitiated:

PHP Scope Resolution Operator aka the Paamayim Nekudotayim.

Linux kernel NMI SERR handling

fsniper,

Wow those were the days. I haven't touched PHP for years, but this post made me recall memories..

Stardust, in Installing kbin.social locally, anyone know what this issue might be?

Seems to be a lot of 'looking for file router.min.js'. Could be a version conflict and it got moved?
So. Do you have the file on your system? Do you have a vendor folder with friendsofsymphony and inside that js routing bundle?

I have not tried to use docker for windows myself, but looking to see if a referenced folder exists under this type of error is pretty common. You may be able to find a js routing bundle version somewhere that has the referenced file or perhaps non-minified files that could be bundled together.

I was also under the impression this docker was for Debian, which is a Linux distribution. Are you running your windows docker in a simulated linux debian environment (or does it do that)? If you don't wish to install Debian or a virtual box for it, you might want to try getting a free Cloud Oracle VPS and setting up a Debian instance there - just beware of their extremely annoying double firewall which has often tripped me up.

Also, it is just called kbin, not kbin.social - the latter is the name of the website running kbin. -wink-

AnonymousLlama,
AnonymousLlama avatar

Cheers I'll give it a look too see if I can find those missing files, I was under the impression docker files could be ran anywhere, if it was made just to run on debian I might be out of luck. I've got the Linux subsystem for Windows installed (it's part of docker for Windows)

Hopefully I'll be able to track this down so I can get it running, pretty keen on helping out on some UI issues to improve the mobile experience.

Stardust,

Unfortunately I am not very familiar with docker, so I cannot help you there, sorry, although it does sound like if the docker has a linux subsystem that it should work?
I might give it a go with running it myself at some point.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • khanakhh
  • DreamBathrooms
  • cubers
  • cisconetworking
  • osvaldo12
  • magazineikmin
  • Youngstown
  • thenastyranch
  • rosin
  • slotface
  • Durango
  • mdbf
  • kavyap
  • tacticalgear
  • JUstTest
  • InstantRegret
  • normalnudes
  • modclub
  • ngwrru68w68
  • everett
  • GTA5RPClips
  • ethstaker
  • anitta
  • Leos
  • tester
  • provamag3
  • megavids
  • lostlight
  • All magazines