Skip to main content
GameDev.net gamedev.net
🔒 Locked

Storing Code Snippets for Newbies

Started by Bronco78th Jan 29, 2018 at 1:05 PM 4 replies 2k views
Original Post
Bronco78th
Bronco78th

Hi All,

Im running through some video tutorials in C# as im newbie. One thing im doing is adding lots of comments to the code so I can go back and revisit the code later and know exacly what is going on.

What id also like to do is store the code snippets in an easy to find place so I can reuse/analyse them later.

I kind of just want a long scrolling page with all my code and commented snippets on that I can use as reference later which also maintains the snippet format and is of course searchable.

There seems to be a few apps as well as Git Hub etc to store code snippets but im just wondering which one from a newbie perspective works best for you and why?

Kind Regards,

John



Rutin
Rutin
5 hours ago, Bronco78th said:

Hi All,

Im running through some video tutorials in C# as im newbie. One thing im doing is adding lots of comments to the code so I can go back and revisit the code later and know exacly what is going on.

What id also like to do is store the code snippets in an easy to find place so I can reuse/analyse them later.

I kind of just want a long scrolling page with all my code and commented snippets on that I can use as reference later which also maintains the snippet format and is of course searchable.

There seems to be a few apps as well as Git Hub etc to store code snippets but im just wondering which one from a newbie perspective works best for you and why?

Kind Regards,

John



I've heard lots of a good things about GitHub, however I personally just create a blank source code file in Visual Studio, and just paste all my code in there. You can format everything as needed.

As someone that has been programming for a very long time, I tend to have folders with a lot of class files for various things that I can include into new projects, or make copies, then modify. I don't store code online.

In your case, you can use either GitHub, or create and file in Visual Studio (or whatever IDE you use), then add comment lines above the code and paste it in. No need to get too fancy for just review code. :)

Programmer and 3D Artist
Andress Martin
Andress Martin

I second on what @Rutin said, however, I myself use GitHub because I tend to program in different computers (work, home, college), and it is easier for me to access the code online. Do what is more accessible to you. Of course, there are more options other than GitHub, I guess you can take a look at different options here.

Good luck!

swiftcoder
swiftcoder

GitHub's Gists, specifically, tend to be the most convenient way to do this. Saves needing to actually have git on the computers you are working on (very handy if some of them are shared/lab computers).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Bronco78th
Bronco78th

Excellent, thanks everyone will try out GitHub/Gists and see what suits!

Regards,

John

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.