News for hackers. Stuff that matters.
Re:But no, 80-column terminals in 2020 isn't “reasonable” an... by joshuamorton on Friday May 29, 2020 @07:36PM (#23356898)
Well the real answer is that we shouldn't treat code as "line oriented". It's a tree. Use a tool meant for tree processing, like clang-format or the various similar tools for other languages. These let you query the AST or CST of the language, which is very useful.

Often you combine this with a line oriented but overly false-positive prone query, like a file-level grep for `foo`, since the AST parsing is slower. Then you reprocess with AST-based tools.

There's some fairly ergonomic tooling for this kind of transformation, although often you need a tool per language, which is annoying.

Re:But no, 80-column terminals in 2020 isn't “reasonable” an... by saagarjha on Friday May 29, 2020 @07:39PM (#23356909)
Unfortunately, this now means that your code searching tool must have knowledge of the language you are running it on. Generally, since you want one tool, that means it needs to either support them all or be designed like LSP…
Re:But no, 80-column terminals in 2020 isn't “reasonable” an... by _ZeD_ on Saturday May 30, 2020 @12:59AM (#23358608)
Or... You can use and ide for this... (Eclipse have generic text and specific programming search for that)