RetroFed Forums
Your home away from modern life.
Anon died on the "clang format bad" hill
Post Reply
AuthorMessage
techt lemmy.world techt@lemmy.world
Joined: 2023-07-02
#52 · Quote Reply

If it doesn't have to change based on user input, it doesn't belong in the database.

Can you explain more on this one? Is this position against lookup or read-only db tables?

5
aeiou_ckr lemmy.world aeiou_ckr@lemmy.world
Joined: 2024-09-24
#53 · Quote Reply

Using LLMs are not the same as using intellisense or compilers and there are a myriad number of reasons not to use it that could fill an entire book and I will look down on any company or freelance developer that uses it. Yes I'll fight Linus over this and yes I'll be right.

It as in LLMs or it as in intellisense?

1
AceFuzzLord lemmy.zip AceFuzzLord@lemmy.zip
Joined: 2025-06-19
#54 · Quote Reply

Mine is basic since I'm still a noob programmer, but if you are on an OS with APT or something similar, you should absolutely automate all your commands for updating your software packages by consolidating everything into a single script.

It's easy to create a bash script that runs all your needed commands sequentially, so why not? Hell, I take it a step further with my script by aliasing it to 2 letters since I don't wanna type the full script name or type tab to autocomplete it.

3
eatham 🇦🇺 aussie.zone eatham@aussie.zone
Joined: 2023-06-16
#55 · Quote Reply

Tab chars are better than spaces AND the correct tab width is 2 spaces

Tab chars are better, no opinion on the width but if you use the chars, everyone can do what they want

17
eatham 🇦🇺 aussie.zone eatham@aussie.zone
Joined: 2023-06-16
#56 · Quote Reply

Mine is basic since I'm still a noob programmer, but if you are on an OS with APT or something similar, you should absolutely automate all your commands for updating your software packages by consolidating everything into a single script. It's easy to create a bash script that runs all your needed commands sequentially, so why not? Hell, I take it a step further with my script by aliasing it to...

I just use Linux mint which does all this for me out of the box

3
eatham 🇦🇺 aussie.zone eatham@aussie.zone
Joined: 2023-06-16
#57 · Quote Reply

SharePoint, Teams, OneDrive, Entra ID and M/O365 aren't "stupid". Your problems and complaints are the result of user error (although, to your credit, Microsoft in no way makes their intended use obvious or intuitive). Don't take that as an endorsement of them or Microsoft. On a consumer level, you should actively avoid them all. I'm referring to people who have to use them at work and complain...

They are stupid, their competitors offer far better services

7
blarth thelemmy.club blarth@thelemmy.club
Joined: 2024-03-16
#58 · Quote Reply

I don’t think anything needs cloudflare in front of it. It’s a worthless service.

6
TheMightyCat ani.social TheMightyCat@ani.social
Joined: 2025-06-30
#59 · (edited) Quote Reply

B and C can't share any other attributes without duplication of code. There's also no strict enforcement of inheritance.

It was a simplified example.

B and C can’t share any other attributes without duplication of code

struct A {
    [[nodiscard]] virtual std::uint32_t DoSomething() = 0;
};

struct B : A {
    std::uint32_t DoSomething() override { 
        return 0;
    }
};

int main() {
    B b;
    b.DoSomething(); //no warning
}

even if you use virtual attributes aren't inherited.

If you ment members instead of attributes this is unrelated to virtual:

struct A {
    std::uint32_t a;
};


struct B : A {
    void DoSomething() { 
        std::println("B"); 
    }
};

struct C : A {
    void DoSomething() { 
        std::println("C"); 
    }
};

Now the member is shared and it works fine and there is no virtual.

There’s also no strict enforcement of inheritance.

True, but neither is there when just using virtual:

struct A {
    virtual void DoSomething() = 0;
};

struct B : A {

};

This compiles fine if final is not added.

Not that its an issue as reflection has solved this problem:

consteval std::string_view HasMethods(std::meta::info impl, std::meta::info iface) {
    constexpr auto ctx = std::meta::access_context::unchecked();
    for (auto fn : members_of(iface, ctx)) {
        if (!is_function(fn) || is_special_member_function(fn)) continue;
        bool found = false;
        for (auto cand : members_of(impl, ctx))
            if (is_function(cand) && has_identifier(cand) && identifier_of(cand) == identifier_of(fn) && type_of(cand) == type_of(fn))
                found = true;
        if (!found)
            return std::define_static_string(std::string(identifier_of(impl)) + " is missing " + display_string_of(fn));
    }
    return {};
}


struct A {
    void DoSomething();
};

struct B  {

};
static_assert(HasMethods(^^B, ^^A).empty(), HasMethods(^^B, ^^A));

// g++ -std=c++26 -freflection main.cpp
// main.cpp:30:41: error: static assertion failed: B is missing void A::DoSomething()
// 30 | static_assert(HasMethods(^^B, ^^A).empty(), HasMethods(^^B, ^^A));

Now you get the strict enforcement of inheritance and no virtual.

2
naught sh.itjust.works naught@sh.itjust.works
Joined: 2023-07-03
#60 · (edited) Quote Reply

I feel like useState and useEffect are 2 sides of the same coin

tbf useEffect is what fried even cloudflare a while back, oh and also me many times. Insanely easy to write once. Just as easy to forget a dependency or modify the function into creating an infinite loop. Or hell using useEffect(() => {}) i.e. an anonymous function instead of naming it so I have to read 30 LoC to figure out what it does only to realize it's not even the effect I needed -.-

1
blarth thelemmy.club blarth@thelemmy.club
Joined: 2024-03-16
#61 · Quote Reply

Here you go: Slack is stupidly expensive for what it is. There, I did it.

Yep. IRC at work would be just fine.

2
shoo lemmy.world shoo@lemmy.world
Joined: 2023-06-15
#62 · Quote Reply

As someone who's worked with react for years, I'm convinced that react itself is the problem and there's no way to educate new people on the proper way to use it without essentially teaching them everything the abstraction is intended to do for them. Why should newbs have to care about mutations and state dependencies when the api is apparently designed to help them forget about those things?

Exactly this. Instead of learning about the complexity and footguns of working directly on the DOM, people get to learn about the complexity and footguns of manipulating the virtual DOM.

React isn't bad, but it was designed in a very opinionated way to build certain kinds of apps. Excessive abuse of React hooks shows a common desire path to build things that don't require that framework. Most people basically just want signal based reactivity but don't know that it exists.

8
SpaceNoodle lemmy.world SpaceNoodle@lemmy.world
Joined: 2023-06-14
#63 · Quote Reply

It was a simplified example. B and C can’t share any other attributes without duplication of code struct A { [[nodiscard]] virtual std::uint32_t DoSomething() = 0; }; struct B : A { std::uint32_t DoSomething() override { return 0; } }; int main() { B b; b.DoSomething(); //no warning } even if you use virtual attributes aren't inherited. If you ment members instead of attributes this is unrelate...

LOL. That mess is somehow better?

1
TheMightyCat ani.social TheMightyCat@ani.social
Joined: 2025-06-30
#64 · Quote Reply

LOL. That mess is somehow better?

One utility function somewhere vs runtime polymorphism everywhere?

Yes.

0
kadotux sopuli.xyz kadotux@sopuli.xyz
Joined: 2023-04-30
#65 · Quote Reply

Firefox is a good browser

64
MousePotatoDoesStuff piefed.social MousePotatoDoesStuff@piefed.social
Joined: 2026-04-22
#66 · Quote Reply

Linters are terrible. Style/formatting linters, anyway, particularly when it comes to whitespace. The goal of formatting code with whitespace is to optimize for human readability. A linter based on a set of rules is not human and thus cannot judge human readability. There is really no formatting rule you can write that will not someday have exceptions on a large-enough codebase. Contributors sh...

Also, if they can detect mistakes, they should be able to FIX them instead of adding extra busywork on my table.

2
aksdb lemmy.world aksdb@lemmy.world
Joined: 2024-01-17
#67 · Quote Reply

Perl is a fuckin' awesome programming language, and it's too bad other languages didn't learn from it. I will forever miss you $_

I hate this trope that languages should “learn” from each other. Because this typically means “should copy features / syntax”.

If I want to use Perl, I use Perl. I don’t need Perl in Rust, then I wouldn’t need Rust anymore.

1
SpaceNoodle lemmy.world SpaceNoodle@lemmy.world
Joined: 2023-06-14
#68 · Quote Reply

One utility function somewhere vs runtime polymorphism everywhere? Yes.

You just reinvented polymorphism with extra jank.

0
aksdb lemmy.world aksdb@lemmy.world
Joined: 2024-01-17
#69 · Quote Reply

Do other editors let you save multiple sessions? Where you can open up any large project exactly where you left off, every tab, split, window, layout, and file already in your buffer for all of your projects or just the last one you were working on? If not, this feature has saved me a lot of set up time. It's been a long time since I used anything else.

Sublime Text does. Even unsaved buffers.

11
aksdb lemmy.world aksdb@lemmy.world
Joined: 2024-01-17
#70 · Quote Reply

Shun the non-believer! Shun!

Charlieeeeeee!

6
MousePotatoDoesStuff piefed.social MousePotatoDoesStuff@piefed.social
Joined: 2026-04-22
#71 · Quote Reply

I am still not convinced vim does much of anything for your productivity.

It's pretty useful for text editing, but for any more serious code work I prefer to use an actual IDE.

As far as software development, Vim seems to me like an excellent solution for an irrelevant problem (typing speed).

Also, it's great that it's lightweight, but I bought the entire RAM and I'm going to use the entire RAM :P

5
MousePotatoDoesStuff piefed.social MousePotatoDoesStuff@piefed.social
Joined: 2026-04-22
#72 · Quote Reply

SharePoint, Teams, OneDrive, Entra ID and M/O365 aren't "stupid". Your problems and complaints are the result of user error (although, to your credit, Microsoft in no way makes their intended use obvious or intuitive). Don't take that as an endorsement of them or Microsoft. On a consumer level, you should actively avoid them all. I'm referring to people who have to use them at work and complain...

although, to your credit, Microsoft in no way makes their intended use obvious or intuitive

Which is stupid.

Trillion dollar corporation, btw

5
Zink programming.dev Zink@programming.dev
Joined: 2023-08-08
#73 · Quote Reply

I just use Linux mint which does all this for me out of the box

I also like to use an alias to update like the previous comment described. I did it on Mint, and I still do it now on Debian even though it has a graphical update manager too.

I like it better this way, probably for readability when there are multiple updates, and definitely for the verbose progress indications. I do already use the terminal all the time too.

My alias does something like apt update, apt upgrade, flatpak update, and then a commented-out firmware manager update.

2
ducktumn lemmy.zip ducktumn@lemmy.zip
Joined: 2026-03-27
#74 · Quote Reply

Firefox is a good browser

It is though

6
TheMightyCat ani.social TheMightyCat@ani.social
Joined: 2025-06-30
#75 · (edited) Quote Reply

You just reinvented polymorphism with extra jank.

How is it jank to put one utility function in a file somewhere you never need to look at again?

That is if you even want to do the assert since if the type doesn't have the method it won't compile in the calling function anyway but since you mentioned the strict check it's fully possible.

And why isn't it jank to write virtual, final, and override everywhere and have the entire codebase infested with vtables.

0
ducktumn lemmy.zip ducktumn@lemmy.zip
Joined: 2026-03-27
#76 · (edited) Quote Reply

  • C++ is an awful language overall.

  • Linus is just some guy with good programming skills and not an authority over anything tech.

  • There aren't any good text editors in the wild. VSCode is awful apart from extension support. Kate is close to being perfect but lack of extensions are pulling it back. Vim, Helix, Emacs, NeoVim are all flex toys.
    nvm just tried zed with AI disabled

  • AI bad

82
kionay lemmy.world kionay@lemmy.world
Joined: 2023-07-01
#77 · Quote Reply

React works by maintaining a virtual representation of the DOM. When you dispatch state changes into the virtual DOM react can determine which components depend on the change and which side useEffects run. My gripe is that YouTube tutorials teach that the useState is the equivalent of a variable. This encourages average developers to problem solve solutions that end up using React's Virtual DOM...

Since it's apparent you can spot what tutorials do it wrong, would you be able to provide links or references to online tutorials that get it right?

One of the most valuable things you can do if you know a technology well enough to have these gripes is not just to condemn people fucking it up but shine a light on people that are trying to do it well.

6
dylanTheDeveloper lemmy.world dylanTheDeveloper@lemmy.world
Joined: 2023-06-09
#78 · Quote Reply

[deleted]
1
kionay lemmy.world kionay@lemmy.world
Joined: 2023-07-01
#79 · Quote Reply

No single letter variable names.
Yes I also mean the i in for loops you see in tutorials. Write out "index" or give it a more descriptive name. Doing the typing isn't the hard part of programming, nor the most time consuming, so making it take a teeny tiny bit longer by having longer variable names is more than worth the value of variables the effortlessly describe themselves.

line length is not that big of a problem anymore, we're not on CRTs, people are regularly developing with 4k monitors, we don't need to limit to 40 character lines but even still if you can't possibly think of a way to break up that long of a line and the only thing you can think of to make it shorter is using over-acronymized variable names then you've already lost the plot somewhere

24
One2many lemmy.world BilliamBoberts@lemmy.world
Joined: 2023-11-08
#80 · Quote Reply

Printers and fax machines are completely outmoded and should be removed from every environment.

18
Quetzalcutlass lemmy.world Quetzalcutlass@lemmy.world
Joined: 2023-08-02
#81 · (edited) Quote Reply

Tabs are better than spaces

Want to know something horrendous? Odin, my current favorite language, recommends mixing tabs and spaces in their style guide.

What's worse, their justification actually makes sense.

20
AceFuzzLord lemmy.zip AceFuzzLord@lemmy.zip
Joined: 2025-06-19
#82 · Quote Reply

I just use Linux mint which does all this for me out of the box

My distro doesn't have any OOTB tools AFAIK that does this, which is why I "need" my script and alias. That is one advantage of mint, though. Closest I have is KDE discover, but IDK how it fully works for/with updates.

2
Alavi programming.dev somegeek@programming.dev
Joined: 2023-06-25
#83 · Quote Reply

Java is overall a good language for getting things done, although not enjoyable to work with (thank god we have Clojure)

8
decolo piefed.social decolo@piefed.social
Joined: 2026-06-29
#84 · Quote Reply

I just use Linux mint which does all this for me out of the box

CachyOS and MX Linux both do this out of the box too

2
Quetzalcutlass lemmy.world Quetzalcutlass@lemmy.world
Joined: 2023-08-02
#85 · (edited) Quote Reply

No single letter variable names. Yes I also mean the i in for loops you see in tutorials. Write out "index" or give it a more descriptive name. Doing the typing isn't the hard part of programming, nor the most time consuming, so making it take a teeny tiny bit longer by having longer variable names is more than worth the value of variables the effortlessly describe themselves. line length is no...

I disagree when it comes to standardized single-letter variable names. They're invaluable when writing dense code for games or other math-heavy applications and you learn to recognize them very quickly.

So i for index in loops (and j, k for nested loops, but you're almost always doing something wrong if you need them); x, y, z for position and h, w for size; r, g, b, a for color data, etc - you'll immediately know what the variable is for at a glance even though it's a single character.

Another benefit is that having related variables be the same character width keeps code visually aligned, which helps with readability.

39
Alavi programming.dev somegeek@programming.dev
Joined: 2023-06-25
#86 · Quote Reply

React is absolute trash and people should stop using it

24
onlinepersona programming.dev onlinepersona@programming.dev
Joined: 2023-09-01
#87 · Quote Reply

No single letter variable names. Yes I also mean the i in for loops you see in tutorials. Write out "index" or give it a more descriptive name. Doing the typing isn't the hard part of programming, nor the most time consuming, so making it take a teeny tiny bit longer by having longer variable names is more than worth the value of variables the effortlessly describe themselves. line length is no...

I agree. Short, nonsensical, meaningless, artificial variable names make me think the person writing the code is a dinosaur from when they still had punch cards. Get with the times.

3
the_flying_pig lemmy.world the_flying_pig@lemmy.world
Joined: 2025-03-15
#88 · Quote Reply

C++ is an awful language overall. Linus is just some guy with good programming skills and not an authority over anything tech. There aren't any good text editors in the wild. VSCode is awful apart from extension support. Kate is close to being perfect but lack of extensions are pulling it back. Vim, Helix, Emacs, NeoVim are all flex toys. nvm just tried zed with AI disabled AI bad

Upvoting because I disagree with every word of what you wrote.

52
onlinepersona programming.dev onlinepersona@programming.dev
Joined: 2023-09-01
#89 · Quote Reply

C++ is an awful language overall. Linus is just some guy with good programming skills and not an authority over anything tech. There aren't any good text editors in the wild. VSCode is awful apart from extension support. Kate is close to being perfect but lack of extensions are pulling it back. Vim, Helix, Emacs, NeoVim are all flex toys. nvm just tried zed with AI disabled AI bad

Agree with half of that. C++ is last century stuff and should be replaced. Any new code in C and C++ is immediately a vulnerability.

1
Archr lemmy.world Archr@lemmy.world
Joined: 2023-06-12
#90 · Quote Reply

Want to know something horrendous? Odin, my current favorite language, recommends mixing tabs and spaces in their style guide. What's worse, their justification actually makes sense.

Fuck... They are right. This makes a lot of sense.

Now I have to share this with everyone at work.

11
Alavi programming.dev somegeek@programming.dev
Joined: 2023-06-25
#91 · Quote Reply

People in FOSS community (including users) nitpick way too much about eachother's ethics and are mostly dictators so they expect everybody's views to align with themselves and each sub-community/individual see themselves as the source of moral balance.

"oh no one of project XYZ maintainers doesn't like trans people we should boycott the project and fork it into LibreLGBTQXYZ"

be professional ffs. See the project as the software and it's technicality, art, science and engineering. we can't be too picky about individual people's beliefs and ethics especially in current situations.

-6
jjj piefed.blahaj.zone jjj@piefed.blahaj.zone
Joined: 2026-08-18
#92 · (edited) Quote Reply

In reply to an earlier post

People (such as myself) make the argument that it does a better job because it's focused more on reading code than writing it since you don't start in the "write" mode like in most editors.

I would say the choice of text editor shouldn't make a difference in productivity so long as it doesn't actively get in your way too often (looking at you, poorly implemented autopairs) and it supports the relevant LSP and debugging protocols.

3
onlinepersona programming.dev onlinepersona@programming.dev
Joined: 2023-09-01
#93 · Quote Reply

In reply to an earlier post

Disagree. Linters catch common logic errors, formatters remove nearly all discussions about formatting style. I remember MRs being held up for days at work because of formatting discussions, being resolved by a "style guide" that couldn't be memorised, and being followed by new discussions about formatting that held MRs.

The that epitomises this is the nixpkgs repo. There are thousands of PRs stuck in nitpick hell because some particular reviewer wants commas here and another wants them there.

8
onlinepersona programming.dev onlinepersona@programming.dev
Joined: 2023-09-01
#94 · Quote Reply

In reply to an earlier post

Use a syntax-aware editor that formats code the way you like it. Save it any goddamn way that is syntactically valid. Anyone else who opens it will see it any way the like in their own syntax-aware editor.

So every MR restyles the code to fit your style? How are you going to review the code?

3
ducktumn lemmy.zip ducktumn@lemmy.zip
Joined: 2026-03-27
#95 · Quote Reply

Upvoting because I disagree with every word of what you wrote.

That's the point lol

7
onlinepersona programming.dev onlinepersona@programming.dev
Joined: 2023-09-01
#96 · Quote Reply

In reply to an earlier post

We are waiting for you take over the X11 project.

5
ducktumn lemmy.zip ducktumn@lemmy.zip
Joined: 2026-03-27
#97 · Quote Reply

Agree with half of that. C++ is last century stuff and should be replaced. Any new code in C and C++ is immediately a vulnerability.

Atleast C is easy to understand which makes it easier to find and fix vulnerabilities. C++ feels like it's duct tape holding it together.

16
SparroHawc piefed.world SparroHawc@piefed.world
Joined: 2026-04-08
#98 · Quote Reply

In reply to an earlier post

Isn't that Python's whole paradigm?

4
onlinepersona programming.dev onlinepersona@programming.dev
Joined: 2023-09-01
#99 · Quote Reply

People in FOSS community (including users) nitpick way too much about eachother's ethics and are mostly dictators so they expect everybody's views to align with themselves and each sub-community/individual see themselves as the source of moral balance. "oh no one of project XYZ maintainers doesn't like trans people we should boycott the project and fork it into LibreLGBTQXYZ" be professional ff...

"I will happily promote the project of a person who openly says people like me should be shot. What's the problem?"

20
jjj piefed.blahaj.zone jjj@piefed.blahaj.zone
Joined: 2026-08-18
#100 · Quote Reply

In reply to an earlier post

...which is why I love #[rustfmt::skip] so much! You can do stuff like

#[rustfmt::skip]
const DIRECTIONS: [[i8; 2]; 4] = [
             [0, 1],
    [-1, 0],          [1, 0],
             [0, -1],
]

while still enjoying the convenience of auto formatting elsewhere.

Although linters which act on the behavior of code are unequivocally a good thing, e.g. "hey, this comparison will always return false you probably made a mistake here".

11
dumnezero piefed.social dumnezero@piefed.social
Joined: 2024-11-27
#101 · Quote Reply

We're going back to server-side rendering.

3
Post Reply Page 2 of 8   Goto page « First 1, 2, 3, 4 ... 8 Last »

Back to top