Programming

This magazine is not receiving updates (last activity 1 day(s) ago). Subscribe to start receiving updates.

uthredii , in New GitHub Copilot Research Finds 'Downward Pressure on Code Quality'

In this regard, AI-generated code resembles an itinerant contributor, prone to violate the DRY-ness [don't repeat yourself] of the repos visited.

So I guess previously people might first look inside their repo's for examples of code they want to make, if they find and example they might import it instead of copy and pasting.

When using LLM generated code they (and the LLM) won't be checking their repo for existing code so it ends up being a copy pasta soup.

GammaGames ,
@GammaGames@beehaw.org avatar

Makes sense, even if it’s not good practice.

It is really useful for hobby projects, though! I needed a recursive function to find a path between two nodes in a graph and it wrote me something that worked with my data in a few seconds, saved a bit of time

MonkderZweite ,

saved a bit of time.

For now.

GammaGames ,
@GammaGames@beehaw.org avatar

?

MonkderZweite ,

Best practices exist to save you time and nerves in debugging.

GammaGames ,
@GammaGames@beehaw.org avatar

Meh, I knew that my graph would never have loops and would only ever have one path from A to B, so it did it well enough. Pretty easy to test!

brokenlcd , in Do any of you program on non-US keyboard layouts?

I program with the italian layout and i's fine, the only annoyances are that to use the slash you need to use shift, all while the backslash has a dedicated key; also you need to use alt codes to type a tilde.

Nerd02 ,
@Nerd02@lemmy.basedcount.com avatar

I mainly write JS and not having a backtick on my keyboard annoys the fuck out of me. Other than that the Italian keyboard is alright, never had any other problems with it.

abhibeckert , in Linus Torvalds flames Google kernel contributor

Meh - I'm pretty sure Torvalds is just saying in public what thousands of other people were thinking quietly.

It sure is unpleasant to have your mistakes pointed out in public... but it's a hell of a lot better than not even knowing you made a mistake at all which is usually what happens.

It would be better if Torvalds told the guy he's an idiot in a private email but I'm not going to get worked up over that. Honestly I have a bigger problem with The Register making a headline out of it. The kernel mailing list is relatively private... this article is going to be attached to this poor engineer for the rest of his career. They should have omitted his name at least.

Kissaki , in Linus Torvalds flames Google kernel contributor

You copied that function without understanding why it does what it does, and as a result your code IS GARBAGE.

AGAIN.

[...]

Debate continued for some time, in a cooler tone, with Torvalds offering suggestions on what he felt would be a better approach to the issues Rostedt hoped to address.

Harsh tone (in only two instances?), but he still invested in offering suggestions 🤷

I expected more behind the verb "flaming".

intelisense , in SurrealDB vs PostgreSQL

We need more information on what you plan to store. Postgres is a safe option, so I would choose that without more details.

darkghosthunter ,

Same here I would use SurrealDB if I had only a front end app, as you can only use websockets and HTTP to connect to the database, and even push authentication to the database itself. There are many features for real-time apps there.

Otherwise, PostgreSQL is more stable.

hperrin , in SurrealDB vs PostgreSQL

Considering you haven’t given any requirements or information about your use case, I’d recommend storing all of your data in a text file.

YIj54yALOJxEsY20eU , in SurrealDB vs PostgreSQL

Since you are using rust you have no choice but to write your own database from scratch.

brettvitaz , in Everything about TOML format - Orchard Dweller

Every time I have reached for TOML I have ended up using JSON. The first reason is that Python standard library can read but not write TOML, which is generally useless for me. The second reason is TOML does not add any benefit over JSON. It’s not that much easier to read and IMO JSON is easier to write by hand because the syntax rules are completely obvious.

eager_eagle ,
@eager_eagle@lemmy.world avatar

TOML is mainly for humans to write, certainly not a good choice if you're programmatically writing files - comments and formatting would be lost.

brettvitaz ,

Agreed. Except that it’s not easier to write imo

spartanatreyu ,
@spartanatreyu@programming.dev avatar

Where do you put your comments in JSON files?

Quetzalcutlass ,

I've seen them included as part of the data.

"//": "Comment goes here",

Example here.

suy ,

The very first moment that I had to use JSON as a configuration format, and I was desperate to find a way to make a long string into a JSON field. JSON is great for many things, but it's not good at all for a configuration format where you need users to make it pretty, and need features like comments or multi-line strings (because you don't want to fix a merge conflict in a 400 character-wide line).

NewPerspective , in Everything about TOML format - Orchard Dweller

TOML and YAML both have the problem that if you receive an incomplete document, there's a decent chance you can't tell. JSON doesn't have that because of the closing curly.

AMDmi3 ,

That's not a problem of a format and should be handled by transport or storage.

rutrum , in Everything about TOML format - Orchard Dweller
@rutrum@lm.paradisus.day avatar

Just gonna throw out HJSON as another alternative: https://hjson.github.io/

I thinks a great idea but I have never seen it used in the wild, unforunately.

Solemarc , in How do you approach learning a new programming language or framework?

Either I come up with a new project or I rewrite an old project in the new language.

I used to do those old school language tutorials where we start with how to write a variable, then how to write a function, etc. but I think that's better for complete beginners just starting out.

rutrum ,
@rutrum@lm.paradisus.day avatar

I've done project rewrites. This minimizes the problem solving to mostly just syntax, sometimes a new paradigm if the framework is different enough. But in my experience a rewrites goes so much faster than I expect it, since theres a very clear goal to achieve while rewriting. If someone has an existing project to rewrite, I recommend it. If not, you could implement some project in a framework your comfortable with, and then do a rewrite in the new thing.

abbadon420 , in Introducing Sudo for Windows

It's weird that its just "sudo" and not "Get-Admin-Acces"

rtxn ,

No, it really is super simple, just:

Set-HostElevatedPrivilege -SubstituteUser Administrator -Privilege [Microsoft.Automation.HostPrivilege]::new("Administrators", $(hostname)) -Credential $(Get-Credential) -Command "ping 1.1.1.1"
Venator , in Strings do too many things

Unless you're using assembly, strings do everything, since the code files are also strings.

mvirts , in Strings do too many things

Despite all my rage I'm still just some bytes in a page

Wiz , in Codeberg.org Opinions?

I just discovered it recently, and started adding stuff. I feel a lot more comfortable about my coffee here than other places. I like it!

However, I'm worried that future employers may ask me to "share my GitHub" with them, leading me to try to explain to a potential employer what "a Codeberg" is.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • programming@programming.dev
  • test
  • worldmews
  • mews
  • All magazines