Internet Programming

Top 10 Professional Sample Code Websites for Programmers

Ian Buckley Updated 22-03-2019

Most programmers are not just desktop programmers, web programmers or scripting gurus—they are often all of the above. Knowing where to find free samples of code online can help you learn and create applications with these working code snippets.


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. There are many of these sites to choose from, but here are ten of the best free code sample websites to get you started!

1. Stack Overflow

Stack Overflow Code Community

The undisputed champion of websites for code snippets, help, and discussion is Stack Overflow. Regardless of whether you are just starting with your first programming language, maintaining old software in an obscure, forgotten language, or working at the cutting edge of Machine Learning, Stack Overflow will have content for you.

Most posts concentrate on a single issue and adding sample code of your own is expected to show what you have already tried. Most users will reply with example code, explaining how it works, and how to implement it.

2. SourceForge

SourceForge Software Development Listings


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, hover over the Open Source Software tab and select Development The next page will astound you. You’ll discover an entire world of Open Source projects.

You read that right, that’s over 44,000 listings under Software Development. If you find software that sparks your interest you might consider joining the development team and contributing to the project or just view the source code to learn how it works.

3. CodeGuru

Code Guru website


CodeGuru is a useful 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 full of articles that are far more comprehensive than the standard short forum posts that you find at other websites. CodeGuru samples explain how to accomplish specific tasks.

Each article contains visual guides, sample code, and use cases. CodeGuru looks dated but it is still an incredible resource, and the forum is active with topics covering every web and software development topic.

4. CodeProject

CodeProject online community for coders

CodeProject is a booming developer community who have created a library of free resources. The content producers are programmers who want to provide the best programming articles. Most of these come complete with well-written explanations along with the sample code.


Due to its community aspect, you’re likely to get sucked into the many prize competitions, surveys, articles, message boards, or even the job board. This community is an excellent 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

DevX sample codes

No list of developer resources would be complete without a mention of DevX. This site is a massive programmer’s paradise and a huge portal to other huge sites. It covers 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. No matter what you are working on, you are likely to find useful resources here.


6. Planet Source Code

Planet Source Code resource website

Planet Source Code has a vast library of useful sample code. Select your programming language from the navigation bar to begin. On the next page, you’ll see many categories of sample code to choose from. The site covers most of the major languages.

Most of the languages have search filter options and each category has tens or even hundreds of thousands of lines of sample code available.

7. The GNU Free Software Directory

GNU 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 an impressive list of free software.

Categories cover almost every application type you would ever need. Since everything here is Open Source, it is a perfect place to see how complex applications work.

8. Google Open Source

Google Open Source Hub

If you want to learn how to make software, why not learn from the biggest and best? Google has a variety of projects available on its Open Source portal to contribute to, along with instructions on how to start your own project and share it.

This site goes hand in hand with Google’s Developer Portal which hosts a wealth of essential information for developers of all types.

9. The Top React Open Source Projects

The Top Open Sourced React projects

More a collection of projects than a single site, this blog post combines the best Open Source resources for React. Many other frameworks concentrate on back end software development and user applications for a specific operating system.

React, however, is the modern face of the internet used extensively in front-end user interfaces. These Open Source projects cover all aspects of learning and using React in a modern development environment. React is one of the top web frameworks worth learning 5 Web Frameworks Worth Learning for Developers Interested in learning advanced web development? Avoid writing repetitive code---use these web development frameworks instead. Read More , as alongside its use in the browser you can write Android Apps using React Native Learn How to Write Your Own Android Apps With React Native Want to learn how to write Android apps? React Native is one of the simplest ways and can be setup with Node.js on your computer. Read More .

10. CodePen

Codepen is an online playground for designers

CodePen is on online code snippet playground. Anyone can create graphics and small apps in the browser without any prior setup.

If you are interested in front-end CSS and JavaScript, CodePen is for you. Regular jams, challenges, and showcases bring together everyone from beginners to industry professionals. CodePen is also a great place to learn new skills like how to create motion graphics How to Make Beautiful Coded Web Animations With Mo.JS Want to thrill visitors to your website with stunning animations? One way to do this is using mo.js, a motion graphics library that you can manipulate in CodePen with JavaScript. Read More with JavaScript animation libraries.

Learn From These Sample Source Code Sites

Each site on this list could provide you with the code examples you need to create your software. The modern web is an incredible resource, and along with these code communities, there are even ways to test code within your browser.

This article is by no means exhaustive, and there are many more resources out there for finding code. Source code is a great way to learn, but if you are a total beginner, you might want to take a course instead. Just make sure you know what to expect from a programming course before signing up!

Interested in creating games? Take a look at using Godot engine and the reasons you should use it 10 Reasons to Use Godot Engine for Developing Your Next Game Need an open source tool for game development? Here are 10 reasons why Godot Engine might be just what you're look for. Read More for game development.

Image Credit: Robert Gourley/Flickr

Related topics: HTML, Java, JavaScript, Programming, Visual Basic Programming, Web Design, Web Development, Webmaster Tools.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

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

  1. Idiomatic Freya
    March 23, 2019 at 3:09 pm

    Hi Ian,
    I just love reading your research. I generally use Stack Overflow but sometimes they mock you instead of helping. Well I have found a couple of good code websites here for me.

    Many thanks,
    Freya, UK

  2. Colleen
    February 7, 2017 at 11:44 pm

    amazing website we have at this time what are anyone's first thoughts
    with our site touching on ultimate ninja blazing cheats

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

    www. 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.

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


  5. 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 -

  6. 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 -

  7. 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.


    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:

    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

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

    One is Stack Overflow for general coding related queries and help

  9. 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?

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

    If you are a C# coder, is the best site for C# stuff.

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

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

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

    GitHub should definitely be on this list. GitHub

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

    For PHP people follwoing site is very much useful:

  14. 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!

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

    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 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.

  16. Ivan Rivera
    February 23, 2009 at 4:05 pm is anoter god source of code.

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

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

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

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

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

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

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

    Java-centric but indispensable to me: