topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday October 31, 2024, 6:54 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: In search of ... opinions on code snippet libraries  (Read 16083 times)

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
In search of ... opinions on code snippet libraries
« on: June 12, 2012, 11:32 PM »
Folk,

I've been using gbCodeLib for a while now, but I cannot help but wonder if there might not be something else.  It works well enough, but it's not portable.  So I'm wondering what, if anything, the rest of you prefer - and why, of course  :tellme:.  Portability would be important, but not necessarily a killer.  Yeah, I could find any number via search, but I really don't want to go through eleventy-seven programs when I can find more appropriate - and effective -  ;) opinions here  :P.  

Edit:  nice to have pre-populated stuff, but mostly for mine own devises  :P.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #1 on: June 13, 2012, 05:16 AM »
I prefer version controlled libraries to code snippets, I haven't used any for years, should I?

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #2 on: June 13, 2012, 11:52 AM »
I prefer version controlled libraries to code snippets, I haven't used any for years, should I?
I suspect that's as much a matter of taste as of circumstance.  If you're in a fixed [spatial] position, or can rely upon always having network access, a VCS could work, especially if you're part of a team.  However, if you're solo, hopping around, frequently lack Internet access, then something on a stick would be a bit more tenable.

robinsiebler

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 83
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #3 on: June 13, 2012, 12:41 PM »
CherryTree - Here is a review
Happiness is laced with shards of pain

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #4 on: June 14, 2012, 03:20 AM »
I suspect that's as much a matter of taste as of circumstance.  If you're in a fixed [spatial] position, or can rely upon always having network access, a VCS could work, especially if you're part of a team.  However, if you're solo, hopping around, frequently lack Internet access, then something on a stick would be a bit more tenable.
That's why there is distributed version control. Does not require network access, would fit fine on a stick.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,188
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #5 on: June 14, 2012, 05:14 PM »
^ I think perhaps I misunderstood your original answer.  Or something was lost in translation.  Did you mean a library of methods and such that would be referenced?

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #6 on: June 14, 2012, 07:14 PM »
What I seek is more a hint file than library - prolly shouldn't have used that term  :).

I've long maintained a list of code snippets - not libraries or plug-ins - that I can cut and paste into what I might be doing at the moment.  Or, perhaps, I need a reminder of the syntax for a particular command, complete with all the possible qualifiers.  Basic laziness, for the most part, but once in a while exact syntax matters.

For instance, there is a script that is useful for debugging JavaScript errors.  With gbCodeLib, I just find that particular error handler, copy the script, paste it as needed.  It's generic, so no need to edit.

Other JS might need to have certain values edited, but it's easier to edit appropriate values than to try to remember the exact syntax.  For instance, there is a JS script for handling a calendar by month.  It's 109 lines.  I won't remember 109 lines  :-[.

Right now, for portability, this is all in a text file, but traversing that file is inefficient and time-consuming at best.  Putting it into CintaNotes is only marginally better.  So I'm looking for a tool, preferably portable, that is designed for the purpose of storing, cataloging, tagging, and searching these code snippets.

(I did look at CherryTree, but my eyes don't deal well with text on a black background.  It's a viable alternative, but difficult [for me] to use, so I'm hoping for something better.)

robinsiebler

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 83
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #7 on: June 14, 2012, 08:16 PM »
Cherrytree comes with several different color schemes and you can create/import others. Here is the scheme I am using (the red on black you see is my WindowBlinds theme, not the program).
Happiness is laced with shards of pain
« Last Edit: June 14, 2012, 08:45 PM by robinsiebler »

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #8 on: June 14, 2012, 09:00 PM »
Cherrytree comes with several different color schemes ...
-robinsiebler (June 14, 2012, 08:16 PM)

Yeah, I saw that.  But it wouldn't let me change the color scheme while using code highlighting.  Maybe more there than I've seen, I've only spent ~half an hour with it so far.  Still testing.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,188
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #9 on: June 14, 2012, 10:05 PM »
What I seek is more a hint file than library - prolly shouldn't have used that term  :).

I've long maintained a list of code snippets - not libraries or plug-ins - that I can cut and paste into what I might be doing at the moment.  Or, perhaps, I need a reminder of the syntax for a particular command, complete with all the possible qualifiers.  Basic laziness, for the most part, but once in a while exact syntax matters.

For instance, there is a script that is useful for debugging JavaScript errors.  With gbCodeLib, I just find that particular error handler, copy the script, paste it as needed.  It's generic, so no need to edit.

Other JS might need to have certain values edited, but it's easier to edit appropriate values than to try to remember the exact syntax.  For instance, there is a JS script for handling a calendar by month.  It's 109 lines.  I won't remember 109 lines  :-[.

Right now, for portability, this is all in a text file, but traversing that file is inefficient and time-consuming at best.  Putting it into CintaNotes is only marginally better.  So I'm looking for a tool, preferably portable, that is designed for the purpose of storing, cataloging, tagging, and searching these code snippets.

(I did look at CherryTree, but my eyes don't deal well with text on a black background.  It's a viable alternative, but difficult [for me] to use, so I'm hoping for something better.)

Ah... sounds cool.  Like templates sort of.  Yeah... I use snipplr for that and hook into http://www.snipitpro.com/ on windows and http://www.snippetsapp.com/ on mac.  Not free, but they work well...

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,645
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #10 on: June 30, 2012, 02:24 AM »
For those looking for a snippet library manager, it might be worth looking at QSnipps since it will be offered for free on BDJ sometime in the near future:

  - http://www.bitsdujou...com/software/qsnipps

It supports Windows, Mac and Linux and can pull snippets from a snipplr account.  It can't can't push new snippets to snipplr as far as I can tell, but I'm not sure if that's a limitation of the snipplr API or not (can other snippet managers do it?).

If anyone is familiar with the program, I'd appreciate comments on how it might compare with others.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #11 on: June 30, 2012, 09:47 AM »
Tried Qsnipps a while back.  At that time, I was underwhelmed  :down:.  The help was an FAQ (a series of Fantasy Asked Questions) online, and even that was incorrect  :down: :down: :down:

I know how difficult it can be to create documentation, much less keep it up to date, but there are numerous tools available at [semi-]reasonable costs to accomplish that task.  There are also folk for hire who put a program through its paces and document it accordingly, many of whom charge much less than their work is worth.

The cross-platform aspect was nice  :Thmbsup:, albeit a bit buggy, or so it seemed to me at the time.  However, to be fair, I didn't spend a great deal of time dealing with that aspect.  Their five (5) limit was a bit too restrictive - five (5) categories containing five (5) snippets each in the free/demo version - to really examine the inbuilt search capability  :-\.

Information on adding/editing a syntax highlighter was sparse to the point of nudity - little or no coverage at all  :o - although that may be a failing on my part, since I've never created nor customized highlighting code.  I'm unfamiliar with whatever conventions might exist.

One (1) of the features touted was the ability to create a shell/DOS command:
~~~~~ start paste ~~~~~
Run Shell/DOS commands
Do you use the Console/DOS prompt often? Save your commands as ShellApps and run them directly from QSnipps.
~~~~~  end paste  ~~~~~
However, I could not find a way to perform that particular feat of legerdemain  :(.

The drag and drop aspect worked nicely  :),

I'll look at it again when it comes up on BDJ but, as mentioned, my first experience was underwhelming.

So far, Gary Beene's product has been the most useful, but there is considerable difference 'twixt the portable and stationary products.

mitzevo

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 462
  • Control is power
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #12 on: June 30, 2012, 10:14 AM »
If you just need a simple way to store text/code/snippets, try AceText. I wrote a review a few years ago. It's fine for my purposes of storing code snippets, templates, etc. and has a bunch of other handy features. Another big benefit of it is that it is a Clipboard extender also.. Oops, are you using Windows or another? It's a Windows app  ;)

You can assign each clip/text/snippet a tag, and use the AceType  feature (hotkey -- Win+Q) to paste any tagged item into the currently focused window, that's just some basic usage. You prob want to check out before and after snippets too if you need to wrap certain things  ;)

Oh, one last thing, it's commercial/paid software, but hey, if you end up liking it and seeing it's great potential as a powerful snippet library, it's a good investment. Also has portable install option if you wish to put it on a portable drive.  :-*
The clock is running. Make the most of today. Time waits for no man. Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it is called the present.
« Last Edit: June 30, 2012, 01:21 PM by mitzevo »

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,645
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #13 on: June 30, 2012, 03:18 PM »
Tried Qsnipps a while back.  At that time, I was underwhelmed  :down:.

Yes.  I've played around with it a bit now, and it doesn't seem to be quite finished.  There's no doubt that the documentation leaves a lot to be desired.  However, the author is responsive to bug reports and suggestions - at least discussing them via email.  It remains to be seen if those discussions turn into action.

I think the application shows some promise.  Since I have to do some work in the Linux world, I like the multi-platform story.  I hope the rough edges can be worked off sooner rather than later or never.

One (1) of the features touted was the ability to create a shell/DOS command:
~~~~~ start paste ~~~~~
Run Shell/DOS commands
Do you use the Console/DOS prompt often? Save your commands as ShellApps and run them directly from QSnipps.
~~~~~  end paste  ~~~~~

However, I could not find a way to perform that particular feat of legerdemain  :(.

As best that I can tell, when you've selected a "ShellApp" script in the main window, a ">" button shows up on the bar above the display of the snippet contents.  Pressing that button will execute the script. the feature seems a bit incomplete:

  - I'd expect that double-clicking on the entry in the snippet list would execute the script, but it doesn't seem to
  - the output from console programs simply goes to a bitbucket somewhere
  - errors (like a bad program name) go unreported

I'm sure there are more. To make this feature usable would require quite a bit of work on the details, I think. Or at the very least clear documentation on how it works so people have a hope of understanding what can and cannot be done.  All that said, this isn't a feature I'm interested in at the moment, so I'm not too worried about it.

I've tried Snip-It Pro in the past, and it was a nicely featured program, but a program like this needs to be light on it's feet, and Snip-It Pro seemed a bit too heavyweight (I think it's a .Net program and that may be part of the story there). My recollection was that Snip-It Pro also hd some issues with multi-monitor setups.  Maintenance/development of Snip-It Pro has stopped or at least slowed to a crawl.

In the meantime, I live with a random collection of files. That has the benefit of being free, portable, and cross platform (more or less - line ending problems sometimes piss me off, but it's actually less of a problem than I would have guessed).

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,645
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #14 on: June 30, 2012, 03:26 PM »
So far, Gary Beene's product has been the most useful

I assume you mean http://www.garybeene...om/sw/gbsnippets.htm

I'll have to look at that sometime - the description makes it sound like it's intended for the PowerBASIC IDE, but maybe it'll work well via the clipboard with other programs, too?

I'll tell you what though... I'm most fascinated by the encyclopedic information on Pepsi he has on his website.

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,193
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #15 on: June 30, 2012, 03:32 PM »
I'll tell you what though... I'm most fascinated by the encyclopedic information on Pepsi he has on his website.

Offtopic
Nice find
* rgdot is a big Pepsi addict :D


barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #16 on: June 30, 2012, 05:27 PM »
I'll tell you what though... I'm most fascinated by the encyclopedic information on Pepsi he has on his website.

Hm-m-m ... last time I remember having a Pepsi was with a bag of Planter's Peanuts at the corner - and only - store during a summer when my parents had farmed my sister and me out to my paternal grandparents' farm.  Pour in some peanuts, then upend the bottle to catch the fizz and the peanuts at the same time  :P.

Mr. Beene's gbCodeLib has a few bells & whistles missing, but I've been using it for several years w/o trouble.  Mostly with PHP/CSS/JS/SQL, but there've been a few forays into more typed languages, e.g., VB or Delphi.  I just can't get comfortable with his portable version, gbFlashLib, for some reason.  I use it, but it seems cramped, somehow.  He also has gbXML - Language File Generator, But I've never had occasion to make use of that one, so I really am not able to comment on it except to say that it looks good  :P.

Addendum:  gbCodeLib comes with libraries for ASP, C++, Cobol, C#, Delphi, DOS, Excel, HTML, Java, Outlook, PERL, ..., and there may be more available on his Website.  Some of those libraries are simple placeholders, some have minimal tutorial listings, some are fairly complex.  Since I'm relatively weak with JS, that particular library has helped me immensely the times I've needed JS.
« Last Edit: June 30, 2012, 05:33 PM by barney »

caveatrob

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #17 on: July 04, 2012, 08:20 PM »
Good topic - I've also been underwhelmed by snippet managers. I use UltraEdit, and their snippet management is language sensitive, but I've talked them into making it so you can choose snippets from other languages while in a file. EditPlus does the same thing, except you can literally drag snippets into the snippet sidebar.

I've got two other hacked-together solutions; one is an AutoHotkey context menu that I hotkey to Win-Z that pops up a menu with some basic code snippets (open database/close database/insert header). I also have a small program that grabs the clipboard when I highlight over something to make a snippet, and saves it to a text file named for the language/basic function. So I can then use Everything or something like DTSearch or PowerGrep to search across those files and put the code in.

I *also* write tiny AHK guis to generate standard css/page templates for the ASP and PHP code I write. I click on what libraries to include, choose the style (1 or 2 column) and it opens a text file, fills in the spots that I've tagged, and then copies the output to the clipboard.

I have not yet found an easy, usable single solution to this, but I'm getting closer on my own FrankenCode.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: In search of ... opinions on code snippet libraries
« Reply #18 on: July 04, 2012, 08:47 PM »
Yeah.  I've been told that the manly way is to just remember the code, then type it in.  "Real programmers don't paste code," or words to that effect  :P.  My current environment for such is Komodo Edit - I'd get the IDE version, but it's way too focused on teams, and I'm a team of one (1) - which has a decent snippet manager, but it's unique to Komodo, which is not portable.  (Tried UltraEdit some time back - don't recall why I didn't care for it  :-\.)  gbCodeLib works admirably, but I just cannot seem to get comfortable with the portable version.  I cannot help but believe that there's something better, but if so, it's well concealed  :( >:( :D.