Re: Code "Snippet" Database
For VB 6.0 Koolsid created:
http://www.vbforums.com/showthread.p...89#post3454189
Maybe he can adapt it for other languages as well!
Re: Code "Snippet" Database
Or you could just make one and share it with here. =)
Re: Code "Snippet" Database
Quote:
Originally Posted by dee-u
Or you could just make one and share it with here. =)
I was thinking about that, if I didn't get any responses that I liked.
Re: Code "Snippet" Database
I would also suggest making your own. You can tailor it for your individual needs and tastes.
I first built my Code Library in 1993 with VB3 and an Access 2.0 database, and it has gone through each interation of VB and Access since then.
At the moment, I have 9 Code categories and a total of 1,472 code snippets/routines/tips that I've gathered over the years. This can be real handy when doing contract work at different companies.
One thing I would strongly stress is to write yourself a good search function. What I initially did was fine because I hardly had anything in it. As time went on, however, and I started saving more and more routines in different categories, actually finding what I wanted because a pain.
The .NET version is about 1/4 done... - I work on it when the spirit moves me. :D
Re: Code "Snippet" Database
Hey,
This is something that I would be very interested in as well. If there is anything that I can do to help I would be more than willing. Is this something that could make it onto a CodePlex project for collaboration purposes?
Thanks
Gary
Re: Code "Snippet" Database
OK, well maybe I will start on something rudimentary this weekend and if it looks promising, I will do a codeplex site.
Re: Code "Snippet" Database
I always planned on doing one of these using Web Services and then making applications across multiple platforms (Windows, Linux, OS X, WM, BlackBerry, etc) and have it sync up.
My ideas are always so grand but I never have any god damn time :(
Re: Code "Snippet" Database
Quote:
Originally Posted by Negative0
OK, well maybe I will start on something rudimentary this weekend and if it looks promising, I will do a codeplex site.
Hey,
Let me know how you get on with this, as I would be willing to help out. I have got some study to do this weekend, got a Microsoft Certification exam next week, but I am sure I could convince myself that helping out would actually be a form of studying :)
Gary
Re: Code "Snippet" Database
If any one can give me the .Net Strings which should of color blue then maybe I adapt the code generator to work for .Net as well... For xample I am using this for VB6
"Or|Do|And|Random|Append|Binary|Exit|Then|GoTo|Case|Select|End|ReDim|" _
& "For|Each|Loop|While|Until|Next|True|False|Sub|Function|As|Private|Dim|Open|Access|" _
& "Else|ElseIf|Public|Close|Open|If|ByVal|(ByVal|Set|Nothing|Option|Explicit|Declare|" _
& "Long|Long,|Long)|Lib|LBound|UBound|With|Call|Integer|Integer,|Integer)|Read|Lock|" _
& "Byte|Byte)|Byte,|Double|Double)|Double,|Boolean|Boolean)|Boolean,|Any|Any,|Any)|" _
& "Currency|Currency,|Currency)|Date|Date,|Date)|New|New,|New)|Object|Object,|Object)|" _
& "Single|Single,|Single)|String|String,|String)|Variant|Variant,|Variant)|Alias|Const|" _
& "Public|Not|Enum|Static|Friend|ByRef|(ByRef|ParamArray|Type|WithEvents|Resume|Is|Set|" _
& "Debug.Assert|Debug.Print|False:|Else:|Global|EndIf"
1 Attachment(s)
Re: Code "Snippet" Database
I appreciate your offer sid, but I am looking for something that is a stand alone app that I can use for a multitude of languages.
Based on the responses, I started going down the path of mocking something up. I am thinking that the treeview will driven by the user, they can add groups and sub groups and code as they see fit. The right hand side will be driven by the data.
So there will be a tab for every language that the code is implemented in. So you could have one chunk of code for saving to a text file and have VB.Net, C#, and vbscript implementations of that code. Let me know what you guys think.
Re: Code "Snippet" Database
Hey,
I think it looks really promising!!
I was giving this some thought over the weekend, and I really like the idea of implementing the database as a webservice. That way if you are away from your desk you can maybe use a web front end for looking at the data.
Have you given much thought to the search functionality?
I have got a couple ideas about populating the different languages. Let's say you copy and paste some simple VB code into the application, it could automatically call a conversion web service to convert the code to C# and vice versa. Obviously you may need to be able to edit it incase it is wrong.
Syntax highlighting would be a nice feature as well.
This could go off in lots of different directions, but I definitely think it has potential.
Let me know if you want some help developing this!!
Gary
Re: Code "Snippet" Database
Quote:
Originally Posted by Negative0
Based on the responses, I started going down the path of mocking something up. I am thinking that the treeview will driven by the user, they can add groups and sub groups and code as they see fit. The right hand side will be driven by the data.
Too hard to navigate when you have 1,400+ snippets like Hack.
First off what if I want to add C++ code? So you add a tab for that... then what happens if I want to add LISP? MASM? etc.
I'd think a tagging system would work better than a treeview. For each piece of code you could apply multiple tags and specify any language. Then, when you need to find something you would select from alphabetized tags on the left (similar to how Evernote works) and many languages spread out across the top or in a menu.
I'd love to mock something up but I don't have time. Treeviews are heavily overdone for this kind of thing and I don't think that's very usable.
Quote:
Originally Posted by gep13
I was giving this some thought over the weekend, and I really like the idea of implementing the database as a webservice. That way if you are away from your desk you can maybe use a web front end for looking at the data.
Well at least someone likes my grand ideas :).
Quote:
Originally Posted by gep13
Have you given much thought to the search functionality?
I haven't given much thought to anything other than a really high level look as to how it would work.
I would imagine we'd just implement a set of APIs for the web services that include searching for terms unless it's a desktop application (in which case we'd just download everything and sync with the database with necessary).
Quote:
Originally Posted by gep13
I have got a couple ideas about populating the different languages. Let's say you copy and paste some simple VB code into the application, it could automatically call a conversion web service to convert the code to C# and vice versa. Obviously you may need to be able to edit it incase it is wrong.
I don't think we'd need a web service for this and I'd see this as more of a "2.0" feature but we could build a module that could convert code and just call it locally. Web services should really only be used for sending and receiving data.
Quote:
Originally Posted by gep13
Syntax highlighting would be a nice feature as well.
Syntax highlighting is a definite need. It needs to be a flexible and extensible system, however. This way you could, out of the box, have profiles for C#, VB.Net, etc but others could add C++, LISP, etc.
Re: Code "Snippet" Database
I am not opposed to the web service idea, but that would probably be an easy thing that would be totally separate of the main application. One of my requirements is having it portable, so it could be used from a thumb drive if necessary (provided the machine trusted the thumb drive and it had the right version of the FW).
I like the conversion of vb.net to C# and vice versa.
Syntax highlighting would be nice, but I think that is an easy piece that can be bolted on at any time. I was thinking of even making this a plugin, so if someone wanted to write a highlighter for another language, it would be easy.
All good ideas.
I have never created a codeplex site before, but I'm willing to give it a shot. Plus it will be a good learning experience for me :).
Re: Code "Snippet" Database
Hey,
From my experience, never created a CodePlex site but have contributed, it is fairly easy to do. So yeah, why not, give it a shot.
If you have any specific areas that you are wanting worked on then feel free to get in touch.
Gary
1 Attachment(s)
Re: Code "Snippet" Database
Here is my idea proposal:
Re: Code "Snippet" Database
I like Kasracer's suggestion about an interface like Evernote. I think it makes sense for an app like this. And I agree totally on the any language thing. That is a big requirement for me, because I want to be able to store anything in here. I already know I want to store snippets from the following languages: C#, VB (6, .Net, and script), Javascript, HTML, SQL, Assembly, Java.
I might take this as an opportunity to really dig into WPF as well, because I really like how easy it is to customize the listbox control and I think that will help in the search results.
Re: Code "Snippet" Database
Perhaps an idea or two can also be derived from this sample?
Re: Code "Snippet" Database
Hey,
What is the latest with this? Any more thoughts?
Gary
Re: Code "Snippet" Database
I've gone back and forth on this from a windows app to a WPF app to a totally hosted website. I haven't had much time to dedicate to it.
Some of the evernote ideas have made me think that I might just be able to use Evernote to store the data and live without the color coding of the text.
Re: Code "Snippet" Database
I still like the idea of creating something from scratch, more of a learning curve than anything, but it's the same old thing about getting the time to do it.
Gary