News for hackers. Stuff that matters.
Re:Greppability is an underrated code metric by VoxPelli on Tuesday September 03, 2024 @03:03AM (#41432094)
I advocate for greppability as well – and in Swedish it becomes extra fun – as the equivalent phrase in Swedish becomes "grep-bar" or "grep-barhet" and those are actual words in Swedish – "greppbar" roughly means "understandable", "greppbarhet" roughly means "the possibility to understand"
Re:Greppability is an underrated code metric by TeMPOraL on Tuesday September 03, 2024 @04:17AM (#41432549)
Which is ironic, given that the article is about making it easier to use grep in order to avoid having to understand anything.
Re:Greppability is an underrated code metric by bob88jg on Tuesday September 03, 2024 @05:29AM (#41433006)
Nah, you've got it backwards. The article isn't about dodging understanding - it's about making it way easier to spot patterns in your code. And that's exactly how you start to really get what's going on under the hood. Better searching = faster learning. It's like having a good map when you're exploring a new city
Re:Greppability is an underrated code metric by TeMPOraL on Tuesday September 03, 2024 @09:57AM (#41434999)
The article advocates making code harder to understand for the sake of better search. It's like forcing a city to conform to a nice, clean, readable map: it'll make exploring easier for you, at the cost of making the city stop working.
Re:Greppability is an underrated code metric by bob88jg on Thursday September 05, 2024 @05:20AM (#41454950)
Which of his suggestions would "make the city stop working"?
Re:Greppability is an underrated code metric by elygre on Tuesday September 03, 2024 @03:12AM (#41432153)
Could I suggest that greppbarhet is more precisely translated as “the ability of being understood”?

(Norwegian here. Our languages are similar, but we miss this one.)

Re:Greppability is an underrated code metric by psychoslave on Tuesday September 03, 2024 @04:30AM (#41432624)
So, at the extrem opposite of the esoteric "general regular expression print" that grep stands for with few ever knowing it?
Re:Greppability is an underrated code metric by johncoltrane on Tuesday September 03, 2024 @05:43AM (#41433098)
s/general/global
Re:Greppability is an underrated code metric by medstrom on Tuesday September 03, 2024 @06:31AM (#41433372)
Norwegian still translates grep as "grip"/"grab". I always thought of grepping as reaching in with a hand into the text and grabbing lines. That association is close at hand (insert lame chuckle) for German and English speakers too.
Re:Greppability is an underrated code metric by pbhjpbhj on Tuesday September 03, 2024 @06:45AM (#41433458)
In English that association is going to depend a lot on one's accent; until now I've never associated grep-ing with anything other than using grep! (But, equally, that might just be a me thing.)
Re:Greppability is an underrated code metric by bee_rider on Tuesday September 03, 2024 @07:42AM (#41433892)
It doesn’t sound anything like grip in my accent but for some reason the association has always been there for me. Grabbing or ripping parts from the file.
Re:Greppability is an underrated code metric by medstrom on Tuesday September 03, 2024 @08:30AM (#41434316)
What about groping? Groping around for text.
Re:Greppability is an underrated code metric by octocop on Tuesday September 03, 2024 @04:00AM (#41432453)
And we also have "begrepp", which is also a spin on content and understanding it's content.
Re:Greppability is an underrated code metric by majewsky on Tuesday September 03, 2024 @05:50AM (#41433140)
Oh, that's like German "begreifen", no? (Which means "to grok".)
Re:Greppability is an underrated code metric by medstrom on Tuesday September 03, 2024 @05:57AM (#41433178)
Grok is right! I'd translate Swedish "greppbar" directly as "grokkable"; "att greppa" as "to grok".
Re:Greppability is an underrated code metric by vanschelven on Tuesday September 03, 2024 @03:45AM (#41432351)
Begreppelijk (begrijpelijk) in Dutch
Re:Greppability is an underrated code metric by Cthulhu_ on Tuesday September 03, 2024 @04:55AM (#41432782)
or "Grijpbaar" (grabbable)
Re:Greppability is an underrated code metric by medstrom on Tuesday September 03, 2024 @06:14AM (#41433274)
So Dutch/German make "begreif" a verb, for Swedish it is just a noun (that means "concept").

But "begrijpelijk" has a clone: "begriplig". An adverb based on a verb in a foreign dictionary. There is no verb that goes "begreppa", it's just "greppa".

Re:Greppability is an underrated code metric by trashtester on Tuesday September 03, 2024 @06:25AM (#41433337)
"Jag kan inte begripa svenska."
Re:Greppability is an underrated code metric by medstrom on Tuesday September 03, 2024 @06:33AM (#41433385)
Oh, you're right.
Re:Greppability is an underrated code metric by fedder on Tuesday September 03, 2024 @08:49AM (#41434463)
The term concept itself suggests grasping or holding/taking hold of, see the latin verb concipio or adjective conceptus.
Re:Greppability is an underrated code metric by jeroenhd on Tuesday September 03, 2024 @09:22AM (#41434700)
Dutch also has a noun ("begrip") meaning "notion" or "understanding".
Re:Greppability is an underrated code metric by sshine on Tuesday September 03, 2024 @03:32AM (#41432278)
How many other UNIX commands did the Swedes adopt into their language?

I know that they invented "curl". Do you tar xfz?

Re:Greppability is an underrated code metric by scbrg on Tuesday September 03, 2024 @04:12AM (#41432518)
We do tar, for xfz I think you have to look to the Slavic languages :)

Anyway, to answer your question:

  $ grep -Fxf <(ls -1 /bin) /usr/share/dict/swedish 
  ack
  ar
  as
  black
  dialog
  dig
  du
  ebb
  ed
  editor
  finger
  flock
  gem
  glade
  grep
  id
  import
  last
  less
  make
  man
  montage
  pager
  pass
  pc
  plog
  red
  reset
  rev
  sed
  sort
  sorter
  split
  stat
  tar
  test
  transform
  vi
:)
Re:Greppability is an underrated code metric by pbhjpbhj on Tuesday September 03, 2024 @06:47AM (#41433471)
Pitchfork? As in something that might be used to search a haystack?? How delightful.
Re:Greppability is an underrated code metric by sshine on Tuesday September 03, 2024 @11:08AM (#41435685)
Yeah, that’s one type.

Another is for turning soil at a small scale by hand (also called a cultivator, I think).

But they all have somewhat long prongs.

Re:Greppability is an underrated code metric by lukan on Tuesday September 03, 2024 @03:38AM (#41432316)
As far as I understood, it was part of the language before.

The german equivalent of the word would be probably "greifbar". Being able to hold something, usually used metaphorically.

Re:Greppability is an underrated code metric by ManuelKiessling on Tuesday September 03, 2024 @03:51AM (#41432395)
Which leads to "begreifbar", which I would explain/translate (badly) with "something is begreifbar if it can be understood".
Re:Greppability is an underrated code metric by kagevf on Tuesday September 03, 2024 @03:42AM (#41432330)
> able to hold

Would "grasp" work?

Re:Greppability is an underrated code metric by octocop on Tuesday September 03, 2024 @03:58AM (#41432438)
It's closer to grip
Re:Greppability is an underrated code metric by n_plus_1_acc on Tuesday September 03, 2024 @04:41AM (#41432692)
I've always related grep to grab
Re:Greppability is an underrated code metric by trashtester on Tuesday September 03, 2024 @06:18AM (#41433301)
"zu greifen" may best translate to "to grip", but "grip" has different mental connotations in English (it refers to mental stability, not intellectual insight).

The best dual purpose translation of "zu greifen"/"gripe" (German/Scandinavian) meaning "zu begreifen"/"begripe"/"understand" would be "to grasp", which covers both physically grabbing into something and also to understand it intellectually.

All these words stem back to the Proto-Indo-European gʰrebʰ, which more or less completes the circle back to "grep".

Re:Greppability is an underrated code metric by lordgrenville on Tuesday September 03, 2024 @07:54AM (#41434011)
related to "grok"?
Re:Greppability is an underrated code metric by trashtester on Tuesday September 03, 2024 @08:58AM (#41434522)
grok /ɡrɒk/

Origin 1960s: a word invented by Robert Heinlein (1907–88), American author.

Re:Greppability is an underrated code metric by actionfromafar on Tuesday September 03, 2024 @06:43AM (#41433441)
Yes. "Grasping for straws."
Re:Greppability is an underrated code metric by tripzilch on Tuesday September 03, 2024 @04:56AM (#41432799)
I learned from bash.org that "tar -xzvf" is in German accent for "xtract ze vucking files".
Re:Greppability is an underrated code metric by Tmpod on Tuesday September 03, 2024 @07:21PM (#41440301)
A classic
Re:Greppability is an underrated code metric by Aachen on Wednesday September 04, 2024 @04:59AM (#41443427)
Party pooper checking in: easier to remember is that v is the verbose option in most tools, x and f you already know, z is auto-detected for as long as I remember so you don't need to pass that. Add c for creating an archive and, congratulations, you can now do 90% of the tasks you'll ever want to do with tar, especially defusing xkcd bombs!

(To go for 99%, add t for testing an archive to your repertoire. This is all I ever use; anything else I do with the relevant tools that I already know, like compression settings `tar c . | zstd -19 > my.tar.zstd` or extracting to a folder `cd /to/here && tar x ~/Downloads/ar.tar`. I'm sure tar has options for all this but that's not the one thing it should do and do well.)

I hadn't heard of the German option but I love it, shame really that z is obsolete :(

Re:Greppability is an underrated code metric by tripzilch on Wednesday September 04, 2024 @06:25AM (#41443975)
I mean, you're not wrong. Learning what stuff means is good :) But there's also the part where making up a ridiculous story, pun or such enables it being a very strong mnemonic.

I know v is just the verbose option, though I didn't know z was autodetected.

Way back (~15y or so?) I was reading bash.org just for the jokes cause I was on IRC, I knew what a tar/tar.gz file is, but I had never needed to extract one from the command line (might've been on Windows back then). However, because I remembered the funny joke, the first time I was on a Linux system confronted with a tgz, I knew exactly what to type :)

Honestly to this day, I've never needed to create a tar archive, only to unpack them (when I need to archive+compress files it's usually to send to other people, and I pick zip cause everyone can deal with it). But `tar --help` and `man tar` are there in case I ever might.

Re:Greppability is an underrated code metric by layer8 on Tuesday September 03, 2024 @06:37AM (#41433410)
Graspability. ;)

More customarily: intelligibility.

Re:Greppability is an underrated code metric by mettamage on Wednesday September 04, 2024 @10:18AM (#41446154)
greppbarhet

Grijpbaarheid

I never saw grep as grijp

I guess I do now

(Dutch btw)