Top 100 Snippets
After 20 years of programming, what code do I find to be most useful? I've found
many of my applications do have a lot of code in common - user interface,
file access, internet /email functions, etc. - whereas the balance of the code is unique
to the application. Here's my list of commonly used code - the Top 100 functions/capabilities
that programmers might typically include in their applications.
My freeware gbCodeLib code librarian
has the VB source code for all of these - and has Top 100 listings snippets for
other languages aw well.
The list was updated on 8 March 2005.
I welcome comments and suggestions for improvements to the list.
Return to top of document
Top 100 JavaScript Snippets
These snippet titles reflect my cut at the most common JavaScript code a webmaster
will use in creating a website. Not are are going to be on any one web page,
but it's not uncommon to see 10-20 of these on a single page. Complexity ranges from
a single line to full scripts taking over a hundred lines of code.
My freeware gbCodeLib code librarian has
the source code for all of these snippets, as well as source code for the Top 100 snippets
in other languages. gbCodeLib also provides short language tutorials which discuss
the basic syntax and common functions offered by several languages, including VB,
VB.net, VBA, JavaScript, Perl, Java, HTML, and other languages.
I've found that my opinion continues to shift on about 10%-20% of the list, so don't
be surprised to find the list changing - or growing as I consider the list in more detail.
Applications
1. Associate an extension with an application
2. Create a shortcut to an application (to a specified folder, including Windows special folders)
3. Open a Color dialog
File - Binary
39. Read/write data at a specific location
40. Read entire file at once
41. View contents in hex or binary-stripped format
System
96. Get computer name
97. Get user name
98. Get name of special folders (Windows, System, SendTo, Startup,
99. Get Windows version
100. Reboot / restart / logoff system
|
|