Sign in to follow this  
Endar

Copying code

Recommended Posts

On my first project that is something more complicated than a game of pong, I find myself copying a lot of code from other sources (not just cutting and pasting, obviously). Not simple stuff, but things that I've been trying to think how to make work for a while, and end up having no idea, I'll look at the source from a graphics engine, and seeing what they have, I'll try to understand it and then incorporate it into my code. Its just that I sometimes have a feeling that what I'll end up with will be only a fraction of my own work. Thoughts, criticisms?

Share this post


Link to post
Share on other sites
Creating a non-trivial game involves a lot of problem solving. You could probably get by without seeing other people's solutions but it would take you a _lot_ longer.

I wouldn't worry about using other algorithms and ideas. As long as you understand the theory behind it and produce your own code then you are doing what 99%+ of programmers do.




+ based on my own, pessimistic, guess

Share this post


Link to post
Share on other sites
What Kuladus said.

Especially when I was starting out, I used a lot of copy and pasted code which was then heavily modified. Even if I didn't exactly understand all what I was doing, I was able to figure out how to combine, for example, a mandlebrot set program using one graphics API (which I didn't have) with an example program for another graphics API into a single working mandlebrot set displayer, with zoom soon added :-).

Even now, there tends to be a lot of APIs which require a lot of boring boilerplate code, stuff which although in need of adaptation, won't change drasitcally. I've taken to wrapping such boilerplate code behind interfaces with sane, overrideable defaults, which helps cut down on the copy and pasting I do, even if it does end up with the same effect.

Share this post


Link to post
Share on other sites
I think that it's sometimes important for you to sit down and try to solve a complex problem for yourself without even looking at someone else's source. It really starts to open new doors of greater understanding... Or even breaking up the problem and asking questions about it on these forums would be just as benefitial.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this