
Most of the code you write, has probably been written before. Why not reuse it? - Apsion
Would love some feedback on a feature I am validating for a startup.<p>The feature &quot;Code Seeker&quot; finds the code you need. It shows you real code from your, your teams, your organization or even public repositories. You can navigate the code by selecting next or previous and zoom in or out to see more of the code.<p>The benefit is code reusability as well as learning from existing code.<p>Any feedback is welcome - thanks
======
mooreds
I love code reuse!

However...

License matters.

Control matters (what if I need to make a change to fit a certain scenario?
How does that happen? Is it propagated upstream? How/when?)

Searchability matters. How do I know what I am looking for, especially across
domains and companies?

~~~
Apsion
We though we may be able to actually show the license type as well. However
keeping it simple to start with and just track new ideas/improvements.

The Code Seeker feature would not actually apply changes, it will allow you to
import into whichever IDE you are using and the mechanism or VCS you currently
use will still apply. Does this make sense or am I not understanding the
Control matters part?

Indexing and Searchability are going to be interesting to implement. I use
IntelliJ and Rubymine and at times the indexing is too heavy handed and they
are only indexing the current project.

------
bbcbasic
I doubt most of the code I have written has been done before, as most of it
relates to the business domain and specifically the parts of the business
domain that are currently under focus.

Anything that is generic, e.g. a double entry accounting system, an Actor
model, etc. should be in a package management system - a Gem, a Nuget Package,
a NPM pacakage etc. rather than copy pasted.

At the micro level for specific line-of-code level problems (usually due to
language/platform quirks) we have StackOverflow.

------
CarolineW
Sounds great - where is it? Can I test it? I'm not sure what you mean by
"next" and "previous", or what you mean by zooming in and out.

How do I specify what I'm looking for? What level of granularity does it work
at? What languages does it cover? How is this different from using libraries?
How can I trust the code I find?

Does it exist yet?

~~~
Apsion
At this point just validating that the feature should be built. So nothing
yet.

I will be posting some more details, videos... Which will give you more detail
of how we think it should work.

------
Apsion
Hey - I now have a video
[https://youtu.be/9EPaBi1_pwo](https://youtu.be/9EPaBi1_pwo) It explains in
more detail how "Code Seeker" could work. And I included a couple of your
suggestions. Hope you can take a look and give me some additional feedback.
Thanks

------
billconan
I think it's difficult to search a functionality by words. For example, if I
want to fund matrix multiplication, the function name could mulmat,
matrixProduct .... could be anything.

second, even code is found, building requires lots of work. missing
dependency, mismatching interfaces, unsupported os...

~~~
thisrod
Smalltalk had a neat solution to this. You gave some arguments and a result,
then it tried all the methods with the right types, and listed the ones that
gave the result. Searching for '(a b c) and 'a would tell you what car is
called in Smalltalk.

~~~
segmondy
prolog does this too, but it's not enough. if you don't have enough data, you
could find a match that will fail in the future.

To answer OP's question, the reason people rewrite is that it's "faster" to
write a new one than find what's out there

OR

I don't want an entire house when all I want is a faucet. Today if you want a
faucet. you might have to do something such as house = new House(); faucet =
house.getFaucet(); So you have to tear apart/copy and paste the code, if it's
loosely coupled enough, you find yourself dealing with all the dependencies.

This is a question lots of people have been asking tho, checkout this talk
from the creator of Erlang asking the same question
[https://www.youtube.com/watch?v=lKXe3HUG2l4](https://www.youtube.com/watch?v=lKXe3HUG2l4)

~~~
Apsion
The house analogy makes sense - I need to research Smalltalk and Prolog
Checking out the video - thanks

------
ssivark
A tangential comment: Isn't the whole point of higher order functions (in
functional programming) this kind code reuse? So what you're looking at sounds
like a way to search for higher order functions and patterns in a codebase.
That way of framing it suggests similarities with Hoogle:
[https://www.haskell.org/hoogle/](https://www.haskell.org/hoogle/)

------
miguelrochefort
99% of the code I write has already been written before.

99% of programs/apps already exist.

99% of things I say and do have already been said and done before.

Code reuse is not the solution. We must rethink software and communication as
a whole. As far as I know, nobody is attempting anything close to this.

PMs are welcome.

------
mattbgates
I am always reusing code from prior programs that I've written. No point in
re-writing it again, especially if i need it to do the same exact thing. Even
if it only needs a few changes, I'll just copy and paste the code and tweak
it.

------
dyeje
Seems like it would encourage bad design. You should be keeping your code DRY
by creating reusable functions in the first place. If it's across repos, then
you should probably make one of the repos usable as a library.

~~~
Apsion
Agreed - copy and paste can definitely be problematic.

DRY typically is discussed as it relates to a single project. What are your
thoughts on this? Code reused across projects or repos is not the same. We can
and should have duplicated code but why write it from scratch? For a simple
example if I always want to have an Avatar in a navbar, why not make it easy
to find and reuse in another project.

------
crispytx
Sounds cool. A little bit like Github's "Gist".

------
pravenj
Would love to test it. Where do I use it from???

~~~
Apsion
I will post additional info here. Probably next week.

------
rajacombinator
Not a very well thought out product.

~~~
crispytx
Haters gonna hate.

~~~
Apsion
:) not a product yet vetting an idea but haters could identify real issues

