Pinterest Stumbleupon Whatsapp
Ads by Google

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.

sample code website

Ads by Google

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.

sourceforge

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.

sample coding asp.net

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

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.

devx- sample code vb.net

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.

sample code in java

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 Google Code, 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 10 Google Services That Get No Love 10 Google Services That Get No Love Read More ,” by Mark.

google code

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.

sample code dev articles

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.

  1. Andrew Bartlett
    November 8, 2016 at 6:23 pm

    www. w3schools.com is my favorite. It has options to try your code and see if you're correct as well as has certificates to earn with coding.

  2. ram
    March 14, 2016 at 4:55 am

    jshdghgsaghjks

  3. MelissaFernandez
    February 3, 2016 at 7:45 am

    Worthy content,keep doing the good job.Developing an android or ios application is not a back-breaking process,I got a completely developed application pleasing my requirements in four to five working days and was also provided with tutorials plus source code. Checkout at -http://learnsauce.com/androidtutorial/

  4. MelissaFernandez
    February 3, 2016 at 7:28 am

    Developing an android or ios application is not a back-breaking process,I got a completely developed application pleasing my requirements in four to five working days and was also provided with tutorials plus source code. Checkout at -http://learnsauce.com/androidtutorial/

  5. Ali
    April 18, 2015 at 5:58 pm

    Good Afternoon Ladies & Gentlemen,

    I am interested in learning php programming. I do not have any programming background in any other programming languages be it computer programming (C, C++, C#, Perl, Java, etc.) or web programming ( Server Side: Php, Perl Cgi, Python, Ruby on Rails; Clientside: Javascript, Xml, Xhtml, CSS, etc.).
    I only know basic Html and currently use a bot programmign tool "Ubotstudio" but that's all.
    Can you be kind enough to recommend me a paper book where I can learn php without getting confused ? It must teach the latest stable version.

    Q1. Which php version is stable and which version is installed on webhosts the most ? 5.5.8 ? If so, where can I get a paper book to learn it or where can I learn it online from some free tutorial ?
    I actually prefer to learn it from a paper book as I am not always connected to the internet. I am using internet cafe to send this message/post.
    I was just checking Amazon now but a lot of books meant for the beginners have got bad reviews/ratings from customers and that has left me confused and worried.
    The book must be for total beginners and not for intermediate or advanced programmers.
    It must not leave out any basics but teach it.
    Must teach the full default library (all the "Commands", "Functions", "Sub functions", "Syntaxes" or whatever that exists in the language from top to bottom and not miss out anything. Must teach the full grammer of the language and not leave-out anything).
    You may recommend any free tutorial websites too but like I said I actually prefer to learn it from a paper book as I am not always connected to the internet. I am using internet cafe to send this message/post.

    Q2. What is Php frame work ? Reusable code blocks meant for a specific task such as deal with database, etc. ?
    If so, I'm not interested in getting into heaviuly learning one framework and not learn the full language.
    No good being just an eye specialist or a bone specialist (one field only). Might aswell be a general doctor (GP) that knows a little bit of all fields. I think you know what I mean. Let's learn the basics of the general stuffs first (the core of the language), I can them later-on move-on to other fields such as database, etc.
    And so, the book must not concentrate on one field only such as to build CMS or Social Network Account Logins or Forums or Database (MySql) because then I'd only learn one aspect of php and not the basics. In short, I want to learn the basics of the language and get a strong background in it. I prefer to build php scripts for Unix/Linux, Apache Webserver using MySql database. Book must teach step by step. Must teach A, B, C then 1, 2, 3 and 1+1=2, 2*2=4, 5-2=3, 25/5=5 and so on before jumping into the algebra and geometry (if you understand what I mean when we speak in terms of learning basic English and Maths).
    I don't want to program in one version and then see my webhost uses another version. Currently, my webhost is Hostgator.
    If I have come to the wrong department/category then kindly forward this message/post to whoever can help.
    I await every php lover's reply.

    Q3.

    Where did you learn php ? WHich website you used and which paper book ? Were they good or not so good or bad ?

    PS - What do you think about this book:
    http://www.amazon.co.uk/PHP-Programming-Ultimate-Course-Beginners-ebook/dp/B00PSNRK16/ref=sr_1_12?s=books&ie=UTF8&qid=1429028734&sr=1-12&keywords=php+5

    It seems it's not a paper version. Do you reckon it will do the job or not ?

    PPS - if you can't recommend any paper books then do you recommend any website where I can go and printout the tutorials ?
    The website must qualify all that I said earlier about the book.

    Anyway, I was expecting the Php Board to provide basic teachings of the language on their website but I'm disappointed to see they don't!

    Thank You

    Mr. Ali

  6. PRISM
    December 11, 2014 at 6:41 am

    One is Stack Overflow for general coding related queries and help
    http://stackoverflow.com/

  7. sanjana
    December 11, 2009 at 11:59 am

    hi..which is the best site which will help me to build a website using ruby on rails?

  8. Ron
    March 27, 2009 at 11:19 am

    If you are a C# coder, c-sharpcorner.com/ is the best site for C# stuff.

  9. ebookey
    March 7, 2009 at 3:29 pm

    My favourite is hotscripts.com - loads of free scripts in all programming languages and many categories.

  10. Joe Martinez
    February 24, 2009 at 10:01 am

    GitHub should definitely be on this list. GitHub

  11. Arif
    February 24, 2009 at 6:43 am

    For PHP people follwoing site is very much useful:

    phpclasses.org/

  12. Ryan Dube
    February 23, 2009 at 9:03 pm

    Cool thanks for the great additional resources everyone. I've added a many of these suggestions to my personal list - thanks a lot!

  13. Vince
    February 23, 2009 at 5:44 pm

    Ryan,
    This is an awesome top ten list, you can tell you put a lot of effort and thought into picking the most relevant websites. You can post this to our site http://www.toptentopten.com/ and then link back to your site. We are looking for content and in return our users will track back to your site. The coolest feature is you can let other people vote on the rankings of your list.
    -Vince

  14. Ivan Rivera
    February 23, 2009 at 4:05 pm

    freshmeat.net is anoter god source of code.

  15. alfred
    February 23, 2009 at 10:43 am

    Thanks for this list :). BTW you should also bookmark stackoverflow.com ;)

  16. mike
    February 23, 2009 at 10:33 am

    No love for dreamincode.com?? Great community and a ton of snippets for a bunch of languages.

  17. Cindy Dalfovo
    February 23, 2009 at 10:07 am

    Hey, thanks, this came just when I needed it :-)

  18. DC
    February 23, 2009 at 11:46 am

    Java-centric but indispensable to me: kickjava.com

Leave a Reply

Your email address will not be published. Required fields are marked *