Hacker News new | ask | show | jobs
by IshKebab 1718 days ago
Using a statically typed language and an IDE is about a billion times better than grep.
4 comments

It is, at least until the codebase grows so much that the IDE can no longer keep up with it.

(Or maybe it's just a problem specific to C++ projects and IDEs. The largest codebases I worked with, the ones where I hit this problem, were C++ ones.)

Yeah that can happen, though in my experience it's far more common that IDEs are broken by some janky custom build system set up by people that use Vim or Notepad++.

I think you're also right that some languages make this harder for IDEs than others. C++ is probably a worst case. Something like Java is trivial because the file structure matches the namespaces. It's probably not a coincidence that every Java IDE I've used has absolutely top class code intelligence tools.

Yeah I went from Java to JS and was surprised how much worse the code browsing experience is.

C is probably not as good as Java but I remember using Eclipse the first time with C for operating systems class, and being amazed with what a large codebase looks like and how easy it was to maneuver.

Intellij's webstorm does js pretty well - almost as well as their java offerings.

Having said that, VSCode these days are also pretty damn good.

Yeah Typescript in VSCode is pretty good. I guess because the VSCode developers use it all the time!
C++ contributes a lot tot his problem. IIRC you can't even reason about C++ code until you've parsed all of it. Undoubtedly, IDEs employ clever tricks and shortcuts, but even they can do only so much.
That's a mighty big assumption that someone is going to go to the trouble of setting up an IDE for a project they want to read the code of. I pull up code all the time that I have no intention of modifying just to understand how it works a bit better.
I've found out that Github provides clickable Java identifiers. Like IDE. Incredibly convenient for your use-case, if it works.
This was my though too, who cares what lines match where - when an IDE can take me to the line, and more importantly, show me the context for that line.
This comes nowhere close to eliminating the utility of grep, especially in large code bases.

Grep helps you search for things in comments and in documentation. It allows you to conveniently ignore files and directories.

Grep and related tooling contain decades worth of insight and wisdom (in a decades-old field) that we should not be so quick to dismiss.