There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

cupcakezealot , in every damn time ...
@cupcakezealot@lemmy.blahaj.zone avatar

that’s specifically why i don’t trust them

z3rOR0ne , in every damn time ...

What is this, a VSCode message? I use NeoVim on Linux and can only vaguely recall such a message from a time long ago…in a galaxy far far away…

backhdlp ,
@backhdlp@lemmy.blahaj.zone avatar

Average Neovim user (I use Neovim btw)

Tsubodai ,

Neovim extension for vscode. Love it.

agent_flounder ,
@agent_flounder@lemmy.world avatar

Yeah vscode.

Today’s stupid question: are vim and neovim not the same thing? I just type vi (ancient habit) and use whatever it is that executes. (I can go search but interacting here is more fun lol)

Dhs92 ,

I believe neovim is just a fork of vim that’s still updated and has support for more modern features.

9point6 ,

FWIW I think vim is also still updated, there was a release this year I believe

emptiestplace ,

and then Bram died :(

9point6 ,

oh… oh shit. That had somehow slipped my mind

:(

emptiestplace ,

Yeah, it doesn’t make a lot of sense. People talk about “when Linus dies”, and obviously that will be devastating, but in my mind Bram just was. I wish I’d made a point of meeting him, or at least sending him an email to say thanks. Not for vim specifically, though I will probably use it until my fingers quit working. As with countess others, Bram inspired me to learn about ICCF Holland, and from there I had the privilege of supporting a child in Uganda through school. That’s what I’d want to thank him for. And vim.

z3rOR0ne ,

Neovim is a fork of Vim. It uses Lua for configuration instead of the original Vim’s VimScript, but still has a lot of interoperability with original Vim plugins and configuration options.

1984 ,
@1984@lemmy.today avatar

Neovim is better in many ways, and because it has lua support, it’s so much easier to write plugins for it. So there are thousands of plugins right now, and entire neovim distributions that are configured to work like an IDE, like Lazyvim for example.

www.lazyvim.org

I’m a huge fan and I have written plugins myself since it’s easy and rewarding.

But on the server, I don’t bother installing neovim. Ordinary vim is fine for simple editing tasks. But if you want a customized experience to replace VS Code on your computer, you want neovim and not vim.

open_world , in every damn time ...
@open_world@lemmy.world avatar

I feel like this popup shows up too often

technojamin ,

If you have a common folder that you clone projects to (like OP’s ~/coding), then that checkbox lets you trust that whole folder easily when this pop up comes up.

Tsubodai ,

I have a coding folder “repos”. It’s on a remote machine though and I get this every time I connect to my code folder using a new remote host. So annoying!

LoveSausage , in Walking Desk Is More Annoying Than A Standing Desk
@LoveSausage@lemmygrad.ml avatar

Love it , wouldnt work where i live , no flat roads. , Would be a new extreme sport going downhill though :) but I think I am gonna go for the one in the comments perhaps hackaday.io/…/180836-desk-ercising-with-the-exer-…

odium , in every damn time ...

All the more reason not to

cmbabul ,

I trust me to not steal from me, I do not trust me to write good code

rostby ,

My code does exactly what I programmed it to do, not what I want it to do

CyberDragonCore , in Walking Desk Is More Annoying Than A Standing Desk
@CyberDragonCore@programming.dev avatar

I think I really need this table.

ExfilBravo , in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

The reason there are no comments in the code? Written by ChatGPT.

Octopus1348 ,

ChatGPT actually puts a lot of comments in, especially when minor modifications are needed to make something work.

brettvitaz ,

It appears you haven’t used chat gpt for coding help.

pkill , in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

This is Bill.

Bill doesn’t need to minify his code, he names things using a single character even in compiled languages.

Bill is a heckin chad who can guess what the code does merely by looking at types and control flow.

Be like Bill

ChickenLadyLovesLife ,

I started coding with TurboBasic. My favorite thing about TB was that you could have variable names of any length but the compiler only used the first two letters - and case insensitive at that. So “Douchebag” and “doorknocker” looked like different variables but were actually the same thing.

Zagorath ,
@Zagorath@aussie.zone avatar

Is the Greek question mark a legal identifier for variable names?

ShitOnABrick OP ,
@ShitOnABrick@lemmy.world avatar

I’m no heckin chad like bill ima soyjak :(

xthexder , (edited ) in Walking Desk Is More Annoying Than A Standing Desk
@xthexder@l.sw0.com avatar

I feel like a treadmill desk would have been way simpler. Unless you like sun glare and spotty wifi.

sbv ,

Okay, now put the whole thing on wheels. I can finally go grocery shopping during my scrum.

SinTacks ,

Wolfram uses a walking desk but it’s more of a laptop support like a baby bjorn. I kind of want one but looks like they need a bit of customizing.

MostlyBlindGamer ,
@MostlyBlindGamer@rblind.com avatar

There are also under-desk treadmills that you can use with an existing standing desk. You need to be able to raise it a bit higher though.

SinTacks ,

The point would be to be outside. Were traveling right now and I can’t find the link but if you search for wolphrams life hacks type of thing there’s an article he wrote about it which was a fascinating read.

Personally I have an elliptical at home with a laptop stand on it and I love it.

ILikeBoobies , in Password requirements are getting out of hand

“Logical”

Uses inches

SpeakinTelnet , in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

I don’t care how much you think your code is readable, plain text comments are readable by everyone no matter the proficiency in the programming language used. That alone can make a huge difference when you’re just trying to understand how someone handled a situation.

Fal ,
@Fal@yiffit.net avatar

There’s nothing keeping the comments up to date with the code. Comments should be sparse and only on sections that aren’t obvious why they’re being done

Zagorath ,
@Zagorath@aussie.zone avatar

Comments explain why, not what. Any comments that explain what a section of code is doing would probably be better off as separated methods.

Apart from basic documentation comments, like JavaDoc or C#'s XML documentation comments.

SpeakinTelnet ,

There’s nothing limiting what a comment should be as far as I know.

As an example of what I mean, I’ve seen in a 10k+ lines python code a few lines of bit manipulation. There was a comment explaining what those lines did and why. They didn’t expect everyone to be proficient in bit manipulation but it made it so that anyone could understand anyway.

Zagorath ,
@Zagorath@aussie.zone avatar

There’s nothing limiting what a comment should be as far as I know.

Nothing technical, sure. Just good coding practices.

lorty ,
@lorty@lemmygrad.ml avatar

Then someone needs to change something about the code and doesn’t bother updating the comment. Now you still have uncommented code but with a comment that confuses instead of helping.

SpeakinTelnet ,

IMHO the issue in this situation is not the comment but that the person updating the code didn’t do his job properly which shouldn’t be an excuse not to do it from the start.

jettrscga , in Programposting

“No style” hits hard. Hadn’t they done enough damage already?

reverendsteveii , (edited ) in Bill is a pro grammer

`//Get CustomerInfo from CustomerRepository by Customer ID or else throw an CustomerNotFoundException

public CustomerInfo getById(String customerId) {


<span style="color:#323232;">return customerRepository.getById(customerId).orElseThrow(new CustomerNotFoundException());
</span>

}`

This is the kind of pointless comment I see in my codebase all the time. Best I can tell, a couple of my coworkers like to plan out their code using comments, then backfill in the actual executable code. That’s fine, but they leave the comments in when they add no value.

` public static LocalDate parseEndDateFromString(String dateString) {


<span style="color:#323232;">    try {
</span><span style="color:#323232;">
</span><span style="color:#323232;">        String[] split = dateString.split("-");
</span><span style="color:#323232;">
</span><span style="color:#323232;">        //In order to get the last day of the desired month, we go to the first day of the next month, account for rollover, then subtract one day
</span><span style="color:#323232;">
</span><span style="color:#323232;">        int month = Integer.parseInt(split[0]) == 12 ? 1 : Integer.parseInt(split[0]) + 1;
</span><span style="color:#323232;">
</span><span style="color:#323232;">        return LocalDate.of(Integer.parseInt(split[1]), month, 1).minusDays(1);
</span><span style="color:#323232;">
</span><span style="color:#323232;">    } catch (Exception e) {
</span><span style="color:#323232;">
</span><span style="color:#323232;">        throw new RuntimeException("Invalid date format - must be MM-YYYY");
</span><span style="color:#323232;">
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">
</span><span style="color:#323232;">}`
</span>

Stuff like this, otoh, is where comments are useful. The required format is obvious from the error message, the param and return from the method signature, the only part that requires a comment is the fiddly logic of accounting for the edge case where month == 12 and the rationale behind how we determine the last day of the month. As a rule, comments are for why something is being done, if it’s not obvious, and for magic numbers. Code should tell you what code does.

edit: can anyone spot the bug that I introduced with that parseEndDateFromString() method?

CJOtheReal , in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

Comment your code but only with numbers and then write a manual

Rinox ,

Yeah, proper documentation is not done with comments in code, but it’s a project in and of itself. Proper documentation is also fucking hard and I have no idea how people (in open source projects) can do it. It’s so fucking boring and tedious, especially when there are a million interesting problems you could tackle instead. Mad respect for people writing documentation, seriously.

I also hate writing comments and prefer to just write out everything in code.

CJOtheReal ,

I write the shit in the explanation before programming it, its a way to construct a code in human language and logic, with my manual you could program the exact same program in another programming language. (i cant show it because what i program is company secret, including the manual) and yes its kinda boring but everyone is grateful for it and for the things i do i need to make shure its never failing, so its checked by several different people, and such a manual helps a lot for everyone.

pkill ,

yep. Good code is self-documenting and syntax highligting and having longer sections folded up may help more than having to process some greyed out text. But comments are still useful for generating proper autocompletion and avoiding having to skim through you '“self documenting code”. Also it helps greatly with TDD and maintaining good coding practices. For example if you need a numbered list to reliably sum up what some function does, it’s often a good sign that it should be broken into a couple smaller ones.

AnUnusualRelic , in Walking Desk Is More Annoying Than A Standing Desk
@AnUnusualRelic@lemmy.world avatar

Isn’t this bad for the Ethernet cables?

Hazzia ,

Just get a wireless ethernet adapter (which exists and I loathe the fact that it does)

Valmond ,

If they are straightened out they might not be able to mingle/mix-up.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines