4 ms·
You can still search for `<keyword> = \(.*\) => `, albeit it's a bit cumbersome.
by supriyo-biswas 2y ago
You can still search for `<keyword> = \(.*\) => `, albeit it's a bit cumbersome.
- post-it 2y agoAll you need is `<keyword> =` Really, all you need is `<keyword>` and if the first result is a call to that function, just jump to its definition.
- spartanatreyu 2y agoExactly. Just search the definition. Any time that a function doesn't have a definition, it's never the target of a search anyway.
- troupo 2y agoAll you need is a tool that actually understands the language. It's 2024 and HN still suggests using regular expressions to search through a code base.
- db48x 2y agoI both agree and disagree with this. I was very careful about how I phrased my comment. Languages can gain points by being greppable, and they can gain points by having a well–implemented mode for my favorite editor, and they can also gain points by having a well–implemented language server. They can do all three to gain the most points (and of course there are many other ways to gain or lose points; this is just one tiny aspect of language design), but they don’t have to. And nobody should try to force every language designer to shave the yak of writing an Emacs mode or a Language Server. And sometimes you just want to improve some random piece of software written in a language that you’ve never used before, without having to shave a bunch of yaks to get the language server installed. Sometimes all you have is grep and you’ll want to be able to use it on this weird new language.
- lukan 2y agoRegex is a universal tool. Your special tool might not work on plattform X, fails for edge case - and you generally don't know how it works. With regex or simple string search - I am in control. And can understand why results show up, or investigate when they don't, but should.
- troupo 2y ago> 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>
- lukan 2y agoWhen 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.
- troupo 2y ago> 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.
- throwaway2037 2y agoNot to move the goal posts too much, but when I am searching a huge Python or Java code base from IntelliJ, I use a mixture of symbol and text search. One good thing about text search, you get hits from comments.
- troupo 2y agoYup. I do, too. I'm mostly ranting against this weird "we will never use great tools because full-text search" obsession
- renox 2y agoThe thing is: In large codebase the tool may become slow or crash, in a new language you may not have such tool.. Grep is far more robust!
- troupo 2y agoWhen tools don't work or unsuitable, you use different tools. And yet people are obsessed with never using useful tools in the first place because they can invent scenarios when this tool doesn't work. Even if these scenarios might never actually come up in their daily work.
- wruza 2y agoIts current year and IDEs still can’t remember how I just transformed the snippet of code and suggest to transform the rest of the files in the same way. All they can do in “refactor” menu is only “rename” and then some extract/etc nonsense which no one uses irl. By using regexps I have an experience that opens many doors, and the fact that they aren’t automatic could make me sad, if only these doors weren’t completely shut without that experience.
- troupo 2y agoNo one is stopping you from using regexps in IDEs. And you somehow manage to undersell the rename functionality in an IDE. And I've used move/extract functionality multiple times. I do however agree that applicable transformations (like upgrading to new syntaxes, or ways of doing stuff as languages evolve) could be applied wholesale to large chunks of code.