Most programmers are not just desktop programmers, web programmers or scripting gurus – they are often all of the above. Over time, most software developers find that it’s much easier to re-use code components than it is to recreate the wheel every time you write an application. Over time, these developers typically archive a library of these reusable modules in order to save time the next time they need to do the same task.
Now, thanks to the power of the Internet, there is a proliferation of websites where professional programmers offer these modules to the general public for absolutely free. For other application developers, these libraries are a goldmine. Whether you write in VB, C, C++, C#, Perl, PHP, Ruby, or any other programming language, there’s a website out there where you can find such reusable sample code.
Choosing the Top Websites for Sample Code
Every developer has a list of their favorite websites where they not only search for free sample code, but they also take part in the developer community that exists at these sites. Programmers often develop a very passionate attachment to some of these websites.
The following is, by no means, an exhaustive list of the best developer websites online. Such a list would be difficult, since there are thousands of excellent resources throughout the net. The following is simply a list of ten of the best places to start if you’re looking for high quality sample code. So please, folks, no food fights if your favorite isn’t mentioned. The following websites are listed in no particular order.
#1 – Programmer’s Heaven
programmersheaven.com (The site is no longer available) is a huge online resource that is very much a community of many different programmers. The site includes information, tips, and forums on languages like Basic, C++, Delphi, Java, Perl, PHP, Python, Ruby, Visual Basic and more. You can also search the site by application or platform.
Programmer’s Heaven has forums, blogs, articles, files, links and news for every single programming language listed on the site. The size of this website is impressive, and the community is growing quickly into one of the largest developer communities on the net.
If you need sample code that’s not already on the site, just ask for help in the forums.
#2 – SourceForge.net
It goes without saying that SourceForge is one of the most significant open source communities on the Internet. When you need to review sample code to learn how to do something, this is a great place to search.
From the main page, just click “Find Software,” and then “Development.” The next page will astound you. You’ll discover an entire world of open source projects.
You read that right, that’s over 54,000 listings under “Software Development.” If you find a software project that sparks your interest, and you can see how the software could be greatly improved, you might consider joining up with one of the many open source projects.
See the SourceForge overview for how this works. Open source is a way of life, and these coders take it very seriously.
#3 – CodeGuru
CodeGuru is also a cool site for developers. It mostly covers just Visual C++/C++, .Net/C# and Visual Basic. While this isn’t a huge selection of programming languages, the site is filled with articles that are far more comprehensive than your standard short forum posts that you find at other websites. CodeGuru offers useful explanations of how to accomplish specific tasks.
The example above is an article on how to load images from or save images to a database using Visual Basic. The article has quality screenshots and well written sample code.
#4 – The Code Project
CodeProject is a booming developer community that’s organized very much like a free article directory website, except in this case the content producers are actually programmers who are trying to provide the best programming articles available. Most of these come complete with well written explanations along with the sample code.
The Code Project isn’t your run-of-the-mill resource where you’ll sift through the site for the code you need and then run. You’re likely to get sucked into the many prize competitions, surveys, articles, message boards, or even the job board. This community is a lot of fun and a good way to connect with other programmers with common coding interests. Before you know it, you may be tempted to write an article yourself!
#5 – DevX
No list of developer resources would be complete without a mention of DevX. This site is a massive programmer’s paradise – a huge portal to other huge sites covering the most popular programming topics such as Java, C++, Database programming, Visual Basic, Mobile programming and much more.
Running your mouse over the left menu bar, as shown above, will display the sub-communities that exist under the DevX umbrella portal. When I had a significant Visual Basic project to complete in 2001, this website quickly became my home away from home.
#6 – Planet Source Code
Planet-Source-Code is one of those websites that you hate to like, but you need it anyway. It’s horribly designed, with a weird tiny-font menu listing at the top and ads splattered throughout the page, but if you know where to click, you’ll find a huge library of very useful sample code. At the top right where it reads “To start, just choose:” select the programming language of your choice. The site covers most of the major languages. On the next page you’ll see many categories of sample code to choose from.
Most of the languages have search filter options, and as you can see here, each category has tens, and even hundreds of thousands of lines of sample code available.
#7 – GNU and The Free Software Directory
If your thing is Open Source, then you can’t miss out on the Free Software Directory that’s linked directly from the GNU home page. This directory is just an impressive list of free software within categories like audio and video, database, email, games, graphics, Internet apps, communications and much more.
#8 – Google Code
Google has also joined the open source crowd with, a site that offers mostly web based sample code within categories like browser apps, website ads, product APIs, and social networking apps.
Google Code received a honorary mention in the MakeUseOf article “10 Google Services that Get No Love,” by Mark.
As always, Google uses its standard format – a very clean and easy to use website where you’ll have no problem quickly finding exactly the open source code that you need.
#9 – DevelopersDex
developersdex.com (The site is no longer available) is another developers community that has rewarded some of the highest quality contributors with “guru” status. The site is essentially a giant developer’s forum, currently approaching just under 50 thousand members. The site covers ASP, C#, SQL, VB, and XML.
Each programming category features complete subcategories such as FAQs, job directories, news, and of course forums and newsgroups.
If you’re a developer using one of these languages and you’re looking for a massive web portal to browse through, this is a good one.
#10 – DevArticles
Saving one of my favorites for last, DevArticles offers one of the most comprehensive directories of articles offering sample codes on the Internet. The list of available software categories is astonishing, including like Flash, embedded tools, and even mobile Linux.
Clicking on any one of those categories turns up a list of useful articles complete with sample code and full descriptions.
Is There More?
This list of developer resources that offer quality sample code snippets is nowhere near complete. The internet is chock full of resources, and everyone has a list of personal favorites, which often depends heavily upon which software languages you prefer, and what type of programming you’re doing.
Are you a regular visitor to any of the websites listed above when you’re looking for sample code? Do you have any personal favorites that aren’t listed here? Share your own favorite sample code resources in the comments section below.