Live data from Hacker News

Ask HN: How do you search large codebases before adding a feature or fixing bug?

news.ycombinator.com

21–30 of 87 posts

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#21
post #4
post #2

You can almost always ask for help from a colleague who has seen the codebase.

It is common that the developer who built might already left the team.

Seen != Built.

You don't always have to optimize for the right answer right away. Just asking someone who's worked with/on the codebase will often give you a jump start.

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#22
Tools I use:

- grep

- ag - Same as grep, but faster!

- find - when looking for a file by name

- helm (an epic Emacs package which does interactive search)

Used to work at a Windows shop and we used Entrian in visual studio. That was pretty good, bust closed source and a pain to setup.

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#23

Tools I use: - grep - ag - Same as grep, but faster! - find - when looking for a file by name - helm (an epic Emacs package which does interactive search) Used to work at a Windows shop and we used Entrian in visual studio. That was pretty good, bust closed source and a pain to setup.

How do you get those tools to work with git branches?

We use bitbucket at work which goes out of its way to stink regarding search. But I personally find it hard to find some code in some branch of some repository that uses x.

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#24
post #14
post #11

This skill is what differentiates really good developers from not so good developers (that may wrongly believe themselves they are good): How good are you at reading code, finding out how smaller parts work in a larger system and understanding the context&domain is a large part in how good you are. Not so good developers, when they are not so good at this, often start blaming the system and people who have worked on…

Quoted post unavailable.

Maybe your comment is off topic? We are talking about searching. You are talking about good vs not good developers and understanding code. Searching != understanding.

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#25

At Oracle (keep in mind every org within Oracle is very different) I wrote a crappy script to grab all repos in my org and hook them up to Etsy Hound [0]. But I couldn't stick with it long enough for it to be useful. It's surprising to me how much effort is not being put into whole-org code search. Most projects focus solely on single-repo search. If you need to make breaking changes or find examples and you don't ev…

Thanks! It is also a concern that I was looking for an answer!

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#26
post #21
post #4

Earlier quoted context omitted.

It is common that the developer who built might already left the team.

Seen != Built. You don't always have to optimize for the right answer right away. Just asking someone who's worked with/on the codebase will often give you a jump start.

If someone worked on JIRA/Task we can find, otherwise, how do we even know about who has seen the codebase?

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#27

I work on code bases with millions of lines, so I wrote a tool called Septum to help me ( https://github.com/pyjarrett/septum/ ). This isn't to replace grep or ripgrep or silver searcher, those are all great tools you should have! Septum is neighborhood based (context-based) search, so you can find contiguous groups of lines which contain specific things, but exclude other things. It's also interactive so you can add…

Thanks for sharing! This is an awesome tool. I also like seeing it is written in Ada. I don’t often find open source tools I like to use written in Ada. Super well organized, too!

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#29

Sourcetrail (Google) had been my primary go-to for large multi-MLOC C-code and C++ project like Mozilla Firefox recently for me. I can now insert instrumentation testpoints deep inside Firefox JavaScript JIT engine within two days from zero-knowledge, quicker there on. - Sourcetrail (GUI/Linux/Windows, closed-net-capable, archived) - https://github.com/CoatiSoftware/Sourcetrail - SourceInsight (repo/web-server/closed…

There is also a company called SourceGraph which parses the AST of the various languages and lets you get CLion-like features with regex search.

https://about.sourcegraph.com/

Re: Ask HN: How do you search large codebases before adding a feature or fixing bug?

#30

I almost always fall back on ag ( https://github.com/ggreer/the_silver_searcher ). Honourable mentions to cscope and ctags. They work for me since most of my $dayjob involves me mucking around with C++. All tools get invoked from within Vim. (Which _also_ works reasonably well in Windows Terminal).

I use cscope and tags. Making sure vim is set up to navigate by tag is a must too. But given those I always wondered what the other methods mentioned in this news item offer that cscope/tags doesn't
Post reply on HN