We all have utility classes we've built over time, classes and extensions that follow us from project to project. These utilities are usually just good enough to get the job done, but still they save us a great deal of time and effort.
But sometimes it would be easier to not have to write them in the first place.
What if there were a utility library that has something for everyone, one that's been growing for years and is under active development? And one were you can either grab the entire thing in one DLL or just those parts you need?
Oh and where the full source were available too?
Craig's Utility Library
Craig's Utility Library (or CUL, as in cull because I'm not that creative), was initially designed through a number of projects that I've worked on. Over time I assembled a number of classes to handle various tasks and continue to add a number of items in my spare time. The library is written in C# and uses .Net 4.0 but many of the classes are usable in lower versions. More code can be found on my website: http://www.gutgames.com.
For a list of features, take a look at the List of Features page. Note that if you're updating from previous versions, this is a HUGE update and will break existing code. However the break was needed to push the code to a more manageable state.
We're talking a massive list of features...
Here's a few snips from the above List;
Here's a snip from the primary solution;
And I was saying you can get it as one package/dll with everything or just what you need? Here's a snap from the v3 Release folder. This shows
Note: If you've interested in running the included unit tests, you'll need to head over to the MoonUnit project (and see Building Your Own Unit Testing Framework in C# - Part 1 and Part 2). Also note the Library uses the .Net 4 Full and not Client profile.
Let's see it in action. One of the areas that I thought cool was the image stuff (well I thought many areas cool, but the image stuff is easier to show off...
Here's a very quick and dirty console test where I play with the ASCII Art extension.
Where we take this picture;
And turn it into this (Shown in Notepad);
Just two lines of code (it could have been done in one) and it just worked (My favorite kind of code. )
The included Unit Tests are a great way to learn how to use the Library and there's also some auto-generated doc's included too.
The next time you feel the need to write a utility class/extension or block of re-usable code take a peek at CUL to see if the work has already been done for you...
Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.