News for hackers. Stuff that matters.
Re:Greppability is an underrated code metric by wrasee on Tuesday September 03, 2024 @05:49AM (#41433130)
Did you consider Neovim? You get the benefit of vim while also being able to mix in as much LSP tooling as you like. The tradeoff is that it takes some time to set up, although that is getting easier.

That won’t make LSP go any faster though. There’s still something interesting in the fact that a ripgrep of every line in the codebase can still be faster than a dedicated tool.

Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @06:01AM (#41433197)
Considered it and have tried repeatedly to get it to work with mixed success. As you wrote, it takes "some time" to set up. In my case it would only offer marginal improvements over plain vim, since I'm not that interested in the LSP integration (and vim has that too, through a plugin).

In the environments I often work in I can't install anything or run processes like node. I ssh into a server and have to use whatever came with the Linux distro, which means sticking with the tools I will find everywhere. I can't copy the code from the server either. If I get lucky they used version control. I know not everyone works with those constraints. I specialize in working on abandoned and legacy code.

Re:Greppability is an underrated code metric by wrasee on Tuesday September 03, 2024 @06:29AM (#41433360)
Yes ok. And legacy code might be a good example where grep works well, if it's fair to argue a greater propensity for things like preprocessors, older languages and custom builds that may not play as well with semantic-level tools, let alone be written with modern tooling in mind.
Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @09:45AM (#41434886)
Lol, I'm not working with COBOL or Fortran. Legacy code in my world means the original developers have left, not that it dates from the 1970s. Mostly I work with PHP, shell scripts, various flavors of SQL, Python, sometimes Rails or other stuff. All things modern LSPs can handle.
Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @09:47AM (#41434905)
can you not upload executables over ssh, say for policy reasons or disk-space reasons? how about shell scripts?

i mean, i doubt i'm going to come up with some brilliant breakthrough that makes your life easier that you've somehow overlooked, but i'd like to understand what kinds of constraints people like you often confront

i'm just glad you don't have to use teamviewer

Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @11:13AM (#41435739)
I don't have to use TeamViewer, though I very occasionally have to use Windows RDP.

You can transfer any kind of file over ssh. scp, sftp, rsync will all copy binaries. Mainly the issues come down to policy and billable time. Many of my customers simply don't allow installing anything on their servers without a tedious approval process. Even if I can install things I might spin my wheels trying to get it to work in an environment I don't have root privileges on, with no one willing to help, and I can't bill for that time. I don't work for free to get an editor installed. I use the tools I know I can find on any Linux/BSD server.

With some customers I have root privileges and manage the server for them. With others their IT dept has rules I have to follow (I freelance) if I want to keep a good relationship. Since I juggle multiple customers and environments I find it simpler not having to manage different editors and environments, so I mostly stick with the defaults. I do have a .profile and .vimrc I copy around if allowed to, that's about it.

I can't lose time/money and possibly goodwill whining about not having everything just-so for me. I recently worked on a server over ssh that didn't have tmux installed. Fortunately it did have screen, and I can use that too, no big deal. I spent less than 60 seconds figuring that out and getting to work rather than wasting hours of non-billable time annoying someone about how I needed tmux installed.

Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @11:24AM (#41435867)
i see, thanks!

wrt rdp, i feel like rdp is actually better than vnc or x11-over-ssh, but for cases where regular ssh works, i'd rather use ssh

i wasn't thinking in terms of installing tmux, more like a self-contained binary that doesn't require any kind of 'installation'

Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @11:36AM (#41435986)
I used the word "install" but the usual rule says I can't install, upload, or execute any non-approved software. Usually that just gets stated as a policy, but I have seen Linux home directories on noexec partitions -- government agencies and big corporations can get very strict about that. So copying a self-contained binary up and running it would violate the policy.

I pretty much live in ssh. Remote Desktop means a lot of clicking and watching a GUI visibly repaint. Not efficient. Every so often I have customers using applications that only run on Windows, no API, no command line, so they will enable RDP to that, usually through a VPN.

Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @12:04PM (#41436285)
i see! but i guess your .profile and .vimrc don't count?
Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @12:33PM (#41436574)
They aren't executables.
Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @02:39PM (#41437761)
my cousin wrote a vt52 emulator in bash, and i was looking at a macro assembler written in bash the other day: https://github.com/jhswartz/mle-amd64/blob/master/amd64. i haven't seen a cscope written in bash, but you probably remember how the first versions of ctags were written in sh (or csh?) and ed. so there's not much limit to how far shell functions can go in augmenting your programming environment

if awk, python, or perl is accepted, the possibilities expand further

Re:Greppability is an underrated code metric by kelnos on Tuesday September 03, 2024 @04:04PM (#41438639)
Sure, but this is taking things to a bit of an absurd extreme. If I worked in a restrictive environment where I couldn't install my own tools, I don't think I would be in a position to burn a ton of my employer's time building sophisticated development tools in bash.

(One-off small scripts for things, sure. But I'm not going to implement something like ctags or cscope or a LSP server in bash.)

Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @04:29PM (#41438890)
certainly it's absurd! nobody would deny that. on the other hand, the problem to solve is also an absurd problem

and i wasn't suggesting trying to bill for doing it, but rather, if you were frequently in this situation, it might be reasonable to spend non-billable time between clients doing it

Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @07:42PM (#41440419)
I guess I don’t see the problem as absurd. As a freelancer I need to focus on the problems the customer will pay for. I don’t write code for free or in my spare time anymore, I used to years ago. i feel comfortable working with the constraints imposed, I think of that as a valuable skill, not a handicap.
Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @08:21PM (#41440621)
i see. thank you very much for being willing to share your invaluable experience and hard-won wisdom
Re:Greppability is an underrated code metric by VHRanger on Tuesday September 03, 2024 @08:00AM (#41434073)
There's also helix now, which requires next to no setup, but requires learning new motions (subject is before the verb in helix)
Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @09:46AM (#41434894)
I looked at Helix but since I dream in vim motions at this point (vi user since it came out) I'd have to see a 10x improvement to switch. VSCode didn't give me a 10X improvement, I doubt Helix would.
Re:Greppability is an underrated code metric by VHRanger on Tuesday September 03, 2024 @10:40AM (#41435423)
Helix certainly won't give you a 10x improvement. It tends to convert a lot of people moving "up" from VS Code, and still a decent chunk, but certainly fewer neovim users moving "down".

Advantages of Helix are pretty straightforward:

1. Very little configuration bullshit to deal with. There's not even a plugin system yet! You just paste your favorite config file and language/LSP config file and you're good to go. For anything else, submit a pull request.

2. Built in LSP support for basically anything an LSP exists for.

3. There's a bit of a new generation command line IDE forming itself around zellij (tmux that doesn't suck) + helix + yazi (basically nnn or mc on crack, highly recommended).

That whole zellij+helix+yazi environment is frankly a joy to work in, and might be the 2-3x improvement over neovim that makes the switch worth it.

Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @11:23AM (#41435850)
Like I wrote, I looked at Helix. Seems cool but not enough for me to switch. And I would have to install it on the machines I work on, which very often I can't do because of company policies, or can't waste the non-billable time on.

I only recently moved from screen to tmux, and I still have to fall back to screen sometimes because tmux doesn't come with every Linux distro. I expect I will retire before I think tmux (or screen, for that matter) "sucks" to the point I would look at something else. And again I very often can't install things on customer servers anyway.

Re:Greppability is an underrated code metric by VHRanger on Tuesday September 03, 2024 @01:54PM (#41437333)
Tmux does suck pretty bad though?

It conflicts with the clipboard and a bunch of hotkeys, and configuring it never works because they have breaking change in how their config file works ever 6months or so.

These days I only use it to launch a long running job in ssh to detach the session it's on and leave.

Re:Greppability is an underrated code metric by gregjor on Tuesday September 03, 2024 @07:45PM (#41440441)
That’s more or less what I use it for — keeping sessions alive. I don’t use 90% of the features. vim does splits, and there’s ctrl-Z to background it and get a shell.

I know I could get more out of tmux but haven’t really needed to. I use it with the default config. I have learned from experience that the less I try to customize my environment the less non-billable time I waste trying to get that working and maintaining it.

Re:Greppability is an underrated code metric by gen220 on Wednesday September 04, 2024 @10:36AM (#41446330)
You can use a tool like ALE (the Asynchronous Linting Engine) to run LSPs in normal-Vim; I've been doing it for years and have no complaints! It's rapid.