News for hackers. Stuff that matters.
Re:Greppability is an underrated code metric by troupo on Tuesday September 03, 2024 @04:17AM (#41432545)
> Your special tool might not work on plattform X

As always, people come out with the weirdest of excuses to not use actual tools in the 99.9999% of the cases when they are available, and work.

When that tools doesn't work, or isn't sufficient, use another one like fuzzy text search or regexps.

> and you generally don't know how it works.

Do you know how your stove works? Or do you truly understand what the device you're typing this comment on truly works?

Only in programming I see people deliberately avoid useful tools because <some fringe edge case that comes up once in a millenium in their daily work>

Re:Greppability is an underrated code metric by kragen on Tuesday September 03, 2024 @07:04AM (#41433586)
if you think anything works in 99.9999% of cases, you’ve never programmed a computer
Re:Greppability is an underrated code metric by lukan on Tuesday September 03, 2024 @05:11AM (#41432885)
When you specialize in one thing only, do what you want.

But I prefer tools, that I can use wherever I go. To not be dependant and chained to that environment.

"Do you know how your stove works? Or do you truly understand what the device you're typing this comment on truly works?"

Also yes, I do.

" people deliberately avoid useful tools because <some fringe edge case that comes up once in a millenium in their daily work>"

Well, or I did already changed tools often enough, to be fed up with it and rather invest in tech that does not loose its value in the next iteration of the innovation cycle.

Re:Greppability is an underrated code metric by troupo on Tuesday September 03, 2024 @07:01AM (#41433558)
> When you specialize in one thing only, do what you want.

I specialize in one thing only: programming

> But I prefer tools, that I can use wherever I go.

Do you always walk everywhere, or do you use a tool available at the time, like cars, planes, bycicles, public transport?

> rather invest in tech that does not loose its value in the next iteration of the innovation cycle.

Things like "fund symbol", "find usages", "find implementation" have been available in actual tools for close to two decades now.

Re:Greppability is an underrated code metric by lukan on Tuesday September 03, 2024 @07:46AM (#41433923)
I did not say I do not use what is avaiable, but this debate is about in general having your code in a shape that simply searching for strings work.
Re:Greppability is an underrated code metric by troupo on Tuesday September 03, 2024 @11:24AM (#41435862)
Simply searching for strings rarely works well as the codebase grows larger. Because besides knowing where all things named X are, you want to actually see where X is used, or where it's called from, or where it is defined.

With search you end up grepping the code twice:

- first grepping for the name

We're literally in a thread where people invent regexes for how to search the same thing (a function) defined in two different ways (as a function or as a const)

- secondly, manually grepping through search results deducing if it's relevant to what you're looking for

It becomes significantly worse if you want to include third-party libs in your search.

There are countless times when I would just Cmd+B/Cmd+Click a symbol in IDEA and continue my exploration down to Java's own libraries. There are next to zero cases when IDEA would fail to recognise a function and find its usages if it was defined as a const, not as a function. Why would I willingly deny myself these tools as so many in this thread do?

Re:Greppability is an underrated code metric by wruza on Tuesday September 03, 2024 @11:16AM (#41435774)
It’s you who sees it as excuses. If I have a screwdriver multitool, I don’t need another one which is for d10 only. It simply creates unnecessary clutter in a toolbox. The difference between definition and mention search for a function is:

  gr<bs><bs>ion name<cr>
  vs
  grname<cr>
or for the current identifier, simply

  gr<m-w><cr>
I could even make my own useful tools like “\[fvm]gr” for function, variable or field search and brag about it watching miserable ide guys from the high balcony, but ain’t that unnecessary as well.
Re:Greppability is an underrated code metric by troupo on Tuesday September 03, 2024 @11:20AM (#41435818)
> It simply creates unnecessary clutter in a toolbox.

And then you proceed to... invent several pale imitations of a symbol/usages search.

More here: https://news.ycombinator.com/item?id=41435862 so as not to repeat myself

Re:Greppability is an underrated code metric by wruza on Tuesday September 03, 2024 @11:37AM (#41436006)
Doesn’t really apply, ignores things just said.