News for hackers. Stuff that matters.
Re:Show HN: Online C/C++ Code Browser by alschwalm on Monday March 07, 2016 @03:34PM (#11241408)
Awesome work! I've actually been making something in a similar vein myself, but it's not nearly this polished.

One issue (I'm not sure how it could be fixed) is that sections of code that were disabled by the preprocessor are not highlighted at all. For example, the compiler (or flags) used when parsing the boost code did not support move semantics, so "BOOST_NO_CXX11_RVALUE_REFERENCES" was defined, which means this line is not parsed:

https://code.woboq.org/boost/boost/boost/any.hpp.html#69

But this is a minor thing, and I'm not sure there's really a solution.

Re:Show HN: Online C/C++ Code Browser by guruz on Monday March 07, 2016 @03:43PM (#11241461)
Thanks everyone for the upvotes :)

Right now we're wondering how to make a bit of money out of this. Do you have any hints or recommendations? (consulting/contract work is the main income for the company currently)

Current license and price: https://woboq.com/codebrowser.html#license

Re:Show HN: Online C/C++ Code Browser by Jyaif on Monday March 07, 2016 @04:17PM (#11241758)
I've been wanting a service like that for a long time.

Here's what I would have thought of doing if I were you:

Step 1: Copy github, but with features people want.

Step 2: Online IDE for the projects (with distributed compilation/testing).

Step 3: Market place where people can hire programmers on demand to work on their project.

Re:Show HN: Online C/C++ Code Browser by sdesol on Monday March 07, 2016 @09:39PM (#11243238)
> Step 1: Copy github, but with features people want.

I hope you are not suggesting they implement a new Git hosting product, because that would be an extreme waste of time/money. Implementing the hosting logic/UI would probably chew up a year or two of development time. I don't know how long sourcegraph has been in development but this is what they are doing.

The smart thing to do in my mind is just build on top of Gogs/GitLab/Bitbucket/GitHub. You may want to focus mainly on Gogs/GitLab/Bitbucket instead though. And the reason why I say this is because I think the vast majority of GitHub/GitHub Enterprise customers are script related shops that develop in JavaScript, Ruby, etc.

> Step 3: Market place where people can hire programmers on demand to work on their project.

Unless you can draw an audience (millions of users) like GitHub/Stackoverflow, I wouldn't even ponder this. What I really think is a smart play is

https://www.starfighters.io/

which doesn't require millions of eyeballs. They just need to continually attract really bright university kids/seasoned programmers for this to be viable. This is definitely not monster.com, but if it works out, they are looking at a very comfortable lifestyle business.

Re:Show HN: Online C/C++ Code Browser by kjksf on Monday March 07, 2016 @08:17PM (#11242976)
My 2 suggestions for making money:

1. Offer a hosted version where I can log-in with my github login, select a repo with C++ and have it indexed.

Use github model: open-source repos are free (and act as advertising for you) and charge for private repos.

Alternatively, create an index for a current version at the time of importing but charge for re-indexing new checkins. Allow people to sponsor a given repo (i.e. anyone could sponsor indexing a public repo, not only the owner).

2. Put more effort into making self-hosted version easy to use, e.g. provide a docker image.

Independently, there are possible UI improvements, like:

* a keyboard shortcut for going to search field (see how I use '/' or Esc for activating search field in https://quicknotes.io/u/w9Yw/kjk)

* tabs. When e.g. doing a search for all usages of a symbol, I usually don't want to loose focus. This is additional information but currently it replaces what I'm looking at. It should be launched in a separate tab or split into 2 windows and have the results in a side window

Re:Show HN: Online C/C++ Code Browser by kjksf on Monday March 07, 2016 @08:19PM (#11242979)
Also, change the name.
Re:Show HN: Online C/C++ Code Browser by vmorgulis on Monday March 07, 2016 @04:21PM (#11241788)
Woboq works well!

I use it for few months: http://vmorgulys.github.io/stackcity/doc/woboq/html/stackcit...

I have a lot of errors (from clang) because I use some C++17 stuff (from gcc, not yet in clang) but the output is still generated.

I wonder I anybody as an experience with DXR:

https://dxr.mozilla.org/mozilla-central/source/

About money I think it's difficult to sell something like that but those guys are in that domain too:

https://sourcegraph.com/

Someone pointed static analysis. It's a good idea to add a value that is not accessible with the free version.

Re:Show HN: Online C/C++ Code Browser by aksx on Tuesday March 08, 2016 @12:55AM (#11243762)
I believe sourcegraph[0] is doing something similar, they don't have support for c++ yet though.

[0]https://sourcegraph.com/

Re:Show HN: Online C/C++ Code Browser by mynegation on Monday March 07, 2016 @04:28PM (#11241848)
In the spirit of this site: make something similar for JavaScript and Ruby, get bought by GitHub or Atlassian, continue working on it on their payroll. (I am only half-joking)
Re:Show HN: Online C/C++ Code Browser by quadrature on Monday March 07, 2016 @04:00PM (#11241611)
I would love for this to be baked in with repo hosting, it would make reviewing PRs easier.

Also ruby/python support would be awesome, although a huge can of worms.

Re:Show HN: Online C/C++ Code Browser by Ono-Sendai on Monday March 07, 2016 @04:01PM (#11241624)
Maybe you could combine it with static analysis or code coverage output?
Re:Show HN: Online C/C++ Code Browser by tlrobinson on Monday March 07, 2016 @01:09PM (#11240380)
I don't know if it's my relative unfamiliarity with C++ or those syntax highlighting colors but I find that code incredibly hard to parse quickly.
Re:Show HN: Online C/C++ Code Browser by hvs on Monday March 07, 2016 @01:47PM (#11240650)
C++ is definitely a language you need to spend some time with before you can visually parse it quickly. C++11 also allows you to trim down the verbosity with things like "auto".
Re:Show HN: Online C/C++ Code Browser by aurhum on Monday March 07, 2016 @01:14PM (#11240412)
Different themes are available depending on your taste. Just pick one from the style combo box at the top right.
Re:Show HN: Online C/C++ Code Browser by jlarocco on Monday March 07, 2016 @02:05PM (#11240782)
I suspect they wanted to show off features, so they crammed as much code as possible into the smallest area possible and stripped out the white space.

IMO it'd be pretty nice with decent white space.

Re:Show HN: Online C/C++ Code Browser by GFK_of_xmaspast on Monday March 07, 2016 @02:38PM (#11241018)
It would still be pretty gross, especially with all those variable declarations/assignments inside conditionals.
Re:Show HN: Online C/C++ Code Browser by jlarocco on Monday March 07, 2016 @03:48PM (#11241499)
Oh, yeah, I wasn't trying to nitpick the overall code quality.

I just meant using white space would be more readable for demonstrating the code browsing capability.

Re:Show HN: Online C/C++ Code Browser by slazaro on Monday March 07, 2016 @02:25PM (#11240917)
There's a lot of whitespace removed, but also IMO they used way too many colors. Once you highlight everything, you're highlighting nothing.
Re:Show HN: Online C/C++ Code Browser by ogoffart on Monday March 07, 2016 @03:27PM (#11241368)
The color theme is based on KDevelop's theme, which happen to be my favorite IDE. I find color really helpfull while reading code since they each have a different to which you quickly get used. But there are other themes that one can choose.
Re:Show HN: Online C/C++ Code Browser by personjerry on Monday March 07, 2016 @03:13PM (#11241271)
IMO having variables be different colors is a little distracting.
Re:Show HN: Online C/C++ Code Browser by guruz on Monday March 07, 2016 @03:26PM (#11241357)
There is a combobox on the top right to change the theme. The other two themes don't have this feature.

Try it for example here: https://code.woboq.org/llvm/clang/lib/AST/Expr.cpp.html#3537