6 Replies - 427 Views - Last Post: 17 January 2013 - 08:28 AM Rate Topic: -----

#1 agentkirb  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 219
  • Joined: 28-December 08

"Starter" code

Posted 17 January 2013 - 04:49 AM

I know that probably most of us don't like starting our programs from scratch. Whenever I had to do a project, I tend to copy/paste from something I did before, delete the extra stuff that I don't need than then work from there. In C++ for example there was a particular program I wrote for an assignment in college that had input/output as well as a class structure.

I was wondering if there was some kind of starter program that had all the basic architecture common for a C# program a little more complex than what they give you when you start a project in Visual Studio, maybe something simple that defines a class, maybe has simple input/output (printing hello world to screen or to a text file even). I kind of dabble between multiple programming languages and I always blank on syntax when I'm starting a new program and so it takes me about 15 minutes to get my bearings.

I apologize if this is a stupid question.

Is This A Good Question/Topic? 0
  • +

Replies To: "Starter" code

#2 b0zhidar  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 24
  • Joined: 21-December 12

Re: "Starter" code

Posted 17 January 2013 - 04:52 AM

You can code one yourself, and use it for your future projects. Functions, procedures, classes, things like that.
Was This Post Helpful? 1
  • +
  • -

#3 agentkirb  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 219
  • Joined: 28-December 08

Re: "Starter" code

Posted 17 January 2013 - 05:09 AM

View Postb0zhidar, on 17 January 2013 - 05:52 AM, said:

You can code one yourself, and use it for your future projects. Functions, procedures, classes, things like that.


Yeah, usually I grab stuff from old projects like I brought up. The only thing I have done in C# that I still have are things done in WPF and an XNA game I'm working on. So I could piece some things together from that.
Was This Post Helpful? 0
  • +
  • -

#4 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 312
  • View blog
  • Posts: 488
  • Joined: 13-June 12

Re: "Starter" code

Posted 17 January 2013 - 05:19 AM

Quote

I know that probably most of us don't like starting our programs from scratch.

Not me. I much prefer to start from scratch. Although I do have a library of custom utilities I've written that I often use one or more tools from.

If I remember rightly, SharpDevelop allows you to create customised templates really easily for whenever you create a new project.
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3227
  • View blog
  • Posts: 10,837
  • Joined: 12-December 12

Re: "Starter" code

Posted 17 January 2013 - 06:31 AM

Most IDEs, including VS, have snippets, or macro, features that you can add-to. You may even be able to download some VS-snippets, but I've never looked myself.

http://visualstudiog...9B-FAEE50F68392

This post has been edited by andrewsw: 17 January 2013 - 06:35 AM

Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: "Starter" code

Posted 17 January 2013 - 07:21 AM

View Postagentkirb, on 17 January 2013 - 06:09 AM, said:

Yeah, usually I grab stuff from old projects like I brought up.


Don't grab/copy/paste code. Build a project that is your complete starter program shell. Menus, status bar, scrolling workspace in the middle, common properties and events, load/save preferences methods, Event handlers for Window_Closing, references, shared libraries... all that stuff that goes into every program. Then save it as KirbBase or whatever.

The next time you start a new app copy/paste the entire KirbBase solution directory.
Open (in Visual Studio) the solution that you just created and do a global find/replace of KirbBase and replace it with MyAmazingProgram or whatever. Taa Daaa... You have your new application started, and saved hours. Not to mention having the same consistent look, feel and naming convention to start off with.
Was This Post Helpful? 1
  • +
  • -

#7 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3473
  • View blog
  • Posts: 10,709
  • Joined: 05-May 12

Re: "Starter" code

Posted 17 January 2013 - 08:28 AM

And if you are using a source control system, don't just copy and paste... branch. That way if you have a code fix in your base program, you at least have half a chance of picking up the changes in your descendant projects.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1