this post was submitted on 08 Oct 2023
563 points (89.0% liked)

Programmer Humor

19551 readers
666 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 44 points 1 year ago* (last edited 1 year ago) (5 children)

My serial killer trait is that I use vi instead of vim cause I'm too lazy to type the extra character. Tho if for some reason, vi tab completed to vim, I'd probably use vim

[–] [email protected] 67 points 1 year ago (1 children)

alias v=vim. There, just saved you two keystrokes.

[–] [email protected] 17 points 1 year ago (1 children)

{vi} = 2 {vim} = 3 {v=vim} = 5

I'd need to run vi at least 5 times to have a net gain in saving keystrokes. I'm typically in effemerial systems created by the users of our env, so rarely am I going to gain those strokes back

But also, why am I trying to apply logic to this? I'll often cat a file before editing it. This shit is just illogical idiosyncrasies I've picked up over the years. I'm probably creating posthoc justifications for insane things I do cause it's hard to override muscle memory

[–] [email protected] 8 points 1 year ago (1 children)
[–] [email protected] 2 points 1 year ago (1 children)

Here's a link I found that might be good if you are interested in more:

https://cloudnativenow.com/topics/ephemeral-idempotent-and-immutable-infrastructure/

https://guymorton.medium.com/persistent-and-ephemeral-infrastructure-as-code-in-aws-42b33939dcf1

There are different levels of effemeriality. The simplest example I use daily would be an autoscaling group in AWS. Especially if you use Spot Instances to save money, thi gs may scale in and out whenever.

So if a development team creates a new autoscaling group and I need to get into an instance to test something, unless I add stuff to their IaC, I'm stuck with their configuration. I need to assume that every time I ssh into one of those instances, it's a brand new instance. But it'd be a big challenge for me to go to their repo and make a PR to alias a command whenever an instance in that resource is created

Stuff can be even more temporary if it's something like an ECS task which creates a container with a read only filesystem only when a task is needed to be done. But I don't want to get too deep in the weeds (or deeper than I already have)

terraform workspace will at least stick around for a while so you might be in and out of the same system multiple times.

[–] [email protected] 9 points 1 year ago (1 children)
[–] [email protected] 8 points 1 year ago (1 children)
[–] [email protected] 5 points 1 year ago
[–] [email protected] 17 points 1 year ago (2 children)

I use nano.

Nano >> vi/vim, emacs

[–] [email protected] 12 points 1 year ago* (last edited 1 year ago) (1 children)

4 letters < 2 letters.

vi forever.

[–] [email protected] 4 points 1 year ago (2 children)
[–] [email protected] 14 points 1 year ago (1 children)

Not if you need any work done.

[–] [email protected] 4 points 1 year ago (1 children)

That's when you switch to a IDE.

[–] [email protected] 4 points 1 year ago (2 children)
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Yes, if you can remember the shortcuts...

M-x IDE

[–] [email protected] 1 points 1 year ago

You can customize all the shortcuts and create custom ones. I'd recommend utilizing the leader key concept, and centering your keybindings around that. For text editing, just use evil-mode, once you build up muscle memory with those Vim bindings it's just awesome.

[–] [email protected] 0 points 1 year ago

By default they are not, but you can turn them into IDEs. In fact, you can turn them into better IDEs than stuff like IntelliJ or Visual Studio will ever be.

[–] [email protected] 0 points 1 year ago

Nano is the best when you just need an editor, you can as well use an IDE instead of vi(m) or Emacs.

[–] [email protected] 8 points 1 year ago

Ok but why use nano when micro literally exists

[–] [email protected] 15 points 1 year ago (2 children)
[–] [email protected] 19 points 1 year ago* (last edited 1 year ago)

Aliases are just bloat! You can do just fine without them. Heck, why not remove the ASCII conversion and read everything in hex or binary?

It's all about SPEED and efficiency here!

[–] [email protected] 2 points 1 year ago

I'm in DevOps so I'm in a lot of effemerial systems so in practice, I will run into systems where profile hasn't been set up. Tho I do like the idea of making sure all systems properly have that aliased cause it'd be serial killer vibes to spend hours of time to make sure that I can save a keystroke.

Tho it'd never make it through PR. Also, wild require explaining to my coworkers that I do this

[–] [email protected] 11 points 1 year ago (2 children)

Most all distros alias vi to vim already, so it makes no difference.

[–] [email protected] 8 points 1 year ago

You use vi because you are lazy.

I used vi because I am too stupid to close it.

We are not the same.

[–] [email protected] 1 points 1 year ago

I'll have to check tomarrow if RHEL and UBI do this.

Did some quick googling and looks like cent has that alias by default but doesn't do it when root. Which would explain why I do get inconsistent results with vi. I never thought about it in detail besides just knowing that there are some visual changes. Thanks for the info, I'll be noticing this now that I know!

[–] [email protected] 4 points 1 year ago (2 children)

Vi is totally fine to quickly make small changes to e.g. a config file on a server. I wouldn't like to program in vi though.

[–] [email protected] 1 points 1 year ago (2 children)

You are missing out! I used to only use vim to edit config files. So I knew my way around (albeit, slowly). I installed the IdeaVim plugin a week ago and learned some new key bindings I wasn't using. A week in I'm almost faster than before! And it's only going to get better after I've acquired muscle memory (I'm nearly there.) and move on to complex key bindings/sequences. Then it will probably be as if the cursor is directly connected to my mind. I'm hopeful because I've seen a mentor of mine do it.

[–] [email protected] 0 points 1 year ago (1 children)

What am I missing out on? I use vi to change values in files on servers. What would you use for that task? Most of my other text-based work like writing Emails, taking notes or programming happens in Emacs.

[–] [email protected] 2 points 1 year ago (1 children)

I don't think you understood what I said. I started using vim key bindings ALSO in my IDE and my speed improved because of it. I didn't ask you to stop using vi. I merely suggested that you used MORE of it. If your Emacs setup already use vim keybindings that's exactly what I'm doing too.

[–] [email protected] 0 points 1 year ago (1 children)

Oh thanks, now I got it. I agree, vi/vim bindings are awesome. I use them everywhere, in Emacs, in my shell, my browser, and in my tiling window manager. When I said, that I wouldn't want to program in vi, I didn't mean that because of the keybindings, I meant that because vi just lacks many useful features for programming and you can't add plugins to it. I have programmed in Neovim for over a year though. Just switched to Emacs, because it has even more features, possibilities and customizability. I will never drop Vim keybindings though.

[–] [email protected] 2 points 1 year ago (1 children)

Awesome! How did you get them in the shell and browser? Now I am also curious.

[–] [email protected] 1 points 1 year ago

I use the fish shell. In fish, you can just add fish_vi_key_bindings to your config file and now Vi bindings will be automatically enabled when you start fish. For bash, it's set -o vi and for zsh it's bindkey -v. For the browser, you can install plugins like Vimium (Vimium-FF for Firefox) or Tridactyl. I find these to be incredibly useful, I love navigating around websites with j and k or d and u, jumping up with gg and down with G, searching with /, closing tabs with x, reloading websites with r, opening new tabs with t, going back and forward with H and L, etc.

[–] [email protected] 1 points 1 year ago

I do most of my programming in vscode but when I need a cli editor, I use vi