Sign in to follow this  
Benjamin Loisch

Gain experience by learning(studying) or by doing?

Recommended Posts

Is it better to have well structured code that takes 5 hours in time to make, than have spagetti code that takes 30 mins to pump out? Is it better to become well versed in a particular(or broad) area of study, and then go in and tackle a project, or just learn as you go? I'm wondering, what do YOU guys think are the best ways to learn how to code? btw, for me, it's learning Direct3D right now! :D

Share this post


Link to post
Share on other sites
blueshogun96    2264

My opinion, until you actually apply what you have studied, how do you really know if you've learned anything? smile.png

 

As you study, continuously try to put that new found knowledge into practice somehow.  If you are reading a book or tutorial, feel free to deviate a bit by tinkering with the code to see what changes can do what.  You'll never know when you find an interesting way of doing things.

 

One thing I like to do is read the MSDN documentation on certain functions (assuming you're on Windows).  This way, not only do you understand how the functions work and what different paremters you can use, but at the bottom of the page, Microsoft usually lists some closely related and similar functions.  I've learned much by doing this.  You can do this for Win32 APIs and DirectX.  Win32 is alot of fun once you really get into it (especially multithreading; I enjoy the potential challenge and nightmare of multithreaded code).

 

My final bit of advice is the same advice I give everybody.  Don't rush yourself or bite off more than you can chew.  Study at your own pace, a pace that works best for you!

 

Shogun.

Share this post


Link to post
Share on other sites
Chad Smith    1343

I always say the following: Just Code

 

When you're learning just code.  While we all learn different, I feel just coding is the way for most people in programming.  Don't worry too much on if the solution is perfect when working on a project.  Honest truth?  your code will be ugly starting out.  No matter what you do your code will still be ugly.

 

Just Code.  Read and just code.  Have a question on solving a problem?  Take a step or two back.  Write down in plain English how you would solve it in real life.  Every step.  Most of the time if you can figure out how you would solve a problem in plain English and you wrote down every part of the solution then you can find a way to translate it to code.  While you might not know all the tools of the langauge to solve it, that's when researching comes in handy.  Just type into Google that step and most of the time you'll get some ideas on features of the language you need to learn.  Guess what?  Next thing you know you just learned a new feature of the language and solved a problem at the same time!

 

Don't focus too much on code design right now.  Just code.  Get code reviews.  Apply those code reviews, and guess what?  Continue to code.  Next thing you know you will be writing decently designed code by yourself just because it all of a sudden became instinct to you.

 

I feel it is dangerous spending too much time as a beginner worrying about code design.  Why?  I have experience with that.  it seemed no matter what project I started or how simple it was I could program it with not much difficulty but would make the problem so much harder than it was by just worrying about the code design.  It dramatically took away motivation away from me because I would say "This code sucks!  horribly designed!"  Start all over and next thing I know my motivation is destroyed, which in turn is a guaranteed way to kill a project. 

 

So my advice?  Just code, It'll come.  It really will...

Share this post


Link to post
Share on other sites
french_hustler    479

Cowboy programming is very effective for me.  I find it extremely hard to "learn" and "progress" without some satisfaction from seeing results.  I need that gratification or else I think "what's the point of all this".  This is especially true if you program solo.  Without help, coding takes a looooooooong time.  Unfortunately, with spaghetti code, you will hit a fat brick wall from which you will have to refactor before being able to expand and add features to your project.  I think a better question would be at which point do I start refactoring and create a proper architecture.  There must be a balance of agility and planning in your development process.  Agility is great for learning.  It gives you great flexibility to go into things you'd rather learn about. 

 

Of course, studying proper software engineering WILL help you.  Learn about patterns, paradigms, and learn about different software architectures.  Knowledge is power, but you got to apply these things in your projects.  I love software development because you are the creator...  the application's building blocks is supported by your architecture, and seeing your application done as you invisioned it is the ultimate satisfaction.  And for large scale software, proper architecture and clean code is a must to the product's success.

 

At the end of the day, you manage your own time.  Hence, you must figure out when it is necessary to create clean structures to your code as opposed to hacking things up together.  Both have their own advantages....

Edited by french_hustler

Share this post


Link to post
Share on other sites
TheChubu    9446

It depends on the learning curve of the subject really.

 

I learn't what I know of Java as I went through it. Suddenly I needed linked lists and I read Oracle's Docs about the Collections framework. Needed to interface with native stuff for a library, went to learn about Buffers and how they work.

 

Thats usually the "simple" stuff. Things that require at most a paragraph to explain. LinkedList is circular? Can I use bitwise operators with any integer type? You can find those easily and code what you want to do with them in 10min.

 

Other things, like design patterns, general object oriented programming concepts or complex libraries, APIs and such, take time to learn and its best if you read about them before trying to code with them.

 

I spent quite a while reading about OpenGL before trying to code up something myself with Java, the linear algebra required to do some stuff took me months to learn (though I didn't knew back then I'd use it for OGL :D), most of the object oriented concepts (classes, access identifiers, information hiding, etc) that I'm using in Java right now I read from C++ based material rather than coding my way through it.

 

There are many many "layers" of understanding.  Some of them you can learn just by practicing (trial-and-error) and some of them you need to read quite a bit before even trying to jump in with the code.

Share this post


Link to post
Share on other sites
derekxec    101

the way i figure is do it with the knowledge you have and then after you get something working go back and look at your code...once you get something working youll feel like you have accomplished something 

 

then when you go back and look at your code you could learn new ways to optimize your code and/or do it the proper way...by doing stuff this way i have kept myself motivated enough to keep going with my projects and also have learned the correct and more optimized way of writing things...so now when i write to get something going i remember oh i found a better way to write this last time and then i start doing it the correct way the first time

 

either way i wish you the best of luck on everything you do :)

Share this post


Link to post
Share on other sites
Hawkblood    1018

I generally get bored with examples and small projects for learning, so I will start a large project like a game and implement concepts I learned from my previous projects. I set a goal (finishing the game) and work to that end. It keeps me going and I get satisfaction when I finish a section of it. Most of the time I run into some self-inflicted flaws that might make me quit or start over-- no big deal. I'd say I've started 10 games and only finished 2, but I'm not working for anyone but myself, so whenever I want to start/stop it's my decision. 

 

The point of jumping in with both feet is that you will prod yourself to finish something.

 

Doing small projects that have only one feature won't show you how it will look/interact with other features. This is also a good reason to come up with a large project and push till your fingers bleed.

 

 

 

The fastest code is the code never written.

Share this post


Link to post
Share on other sites
AngleWyrm    554

Is it better to have well structured code that takes 5 hours in time to make, than have spagetti code that takes 30 mins to pump out?

 

If the project is finished after the 5hr/30min time specified, then it doesn't really matter, and so 30minutes is cost effective.

 

But if the project is not finished after the hurried 30minute spaghetti code, it is much less likely to be finished later on, or ever.

 

Building a birdhouse doesn't require much skill. Building a skyscraper does.

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