Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

General Question to Nietod and any others

I am a student and I have some questions for developers and programmers. When I do a programming assignment I always look at code and a lot of the time and copy and paste or reuse code. I have gotten away with that so far, but to be a good programmer should I be able to sit and write a program without any other type of aid other then what is in my head? I guess what I am trying to ask is am I cheating myself by understanding the code I am copying and pasting and how it works or should I be trying to memorize all of the syntax for as many alogorithm's in the programming language I am learning. I guess, what is the best way to learn how to program? What should I study the most to be productive in school and when I am employed as a programmer? Most of my problems I have with know are code implementation, but I have been told by a experienced programmer that syntax is easy and that the real problems are understanding the logic that you have to understand to be a good programmer.
0
awjackin35
Asked:
awjackin35
1 Solution
 
smitty1276Commented:
You don't need to simply memorize algorithms, etc...  You need to understand the LOGIC behind the algorithms and be comfortable enough with the syntax of the language to apply the logic and develope working code for any situation you may encounter.

Programming is ALL logic.  Learning the syntax of a new language is relatively simple.  Knowing how to logically develope the code you need is fundamental to any language.
0
 
cypherljkCommented:
I agree with smitty1276, when you get to a certain level as a programmer the syntax no longer matters.  It's the knowledge of techniques and understanding of the logic that makes a programmer excell.  In fact one of the common classes taught in college is 'Programming Languages' where the basic ideas are taught and you usually go through several languages implementing applications.  True you don't need to memorize every algorithm but you should understand different algorithms and how they affect you application.  If you understand the code you copy then you may not be that bad off.  The next time you copy code though try to rewrite or improve it, this will test your understanding of the code and what you are trying to do.

My 2 cents...
0
 
jasonclarkeCommented:
> but to be a good programmer should I be able to sit and write a program without any other
> type of aid other then what is in my head?

this is plain wrong.  Much of modern programming technology is aimed at maximising code re-use.  It is quite possible to use an alogorithm without understanding how it works, for example you clearly don't need to understand how a compression algorithm works in order to compress a file.

Good programmers write as little code as they can - reusing code is a good thing.  However, copy/paste of code is probably the lowest form of reuse.

It is also possible to reuse programming techniques and idioms - that is programming language techniques that allow you to solve certain problems.   The Design Patterns book (by Gamma et. al.) is an excellent example of this kind of thing.

> What should I study the most to be productive in school and when I am employed as a programmer?

i) How good experienced programmers work, ii) Good examples in other peoples code.

> but I have  been told by a experienced programmer that syntax is easy

easier, maybe.  Not necessarily easy, this forum would suggest otherwise.  Syntax is a minor part of the equation, however, programming paradigms (OO, procedural, functional, etc.) are more important - they describe a 'mind set' of how you go about solving problems.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
3rsrichardCommented:
If you learned algebra when you took it in school, then if someone gives you an
equation to be solved you look at it and pick a method of solution which is appropiate
to the type of equation.
For instance if someone says solve x^^2 - 9 = 0 you would not choose to use the
quadratic formula, even though it would work.

If you want to be a good programmer you should learn how to use a variety of
techniques, and when faced with a programming problem you should use one
appropiate to that type of problem.

0
 
imladrisCommented:
I agree with jasonclarke that a good programmer is a lazy programmer. You want to write as little code as possible. Reinventing the wheel is done far too often. I often tell this kind of thing to people working in a production environment. And remember the software bottleneck. More than 80% of programming effort goes into maintaining existing code. Only the minority goes into creating new code.

Having said that though, I believe it is also true that programming is primarily learned by doing. I don't think attempting to understand code and then using it by cutting and pasting it into your program, is going to teach you anywhere near as much as developing it yourself.

So in summary; I don't think you need to memorize syntax or algorithms. Code reuse (from cutting and pasting all the way to inheritance) is a good thing. In fact even cutting and pasting is very common in the windows end of things. I do think you need to program things from scratch. It will force you to grapple with programming concepts, and your own flaws (when debugging), to a higher degree, which will cause you to learn more.
0
 
VandanaManneCommented:
question for jason

The Design Patterns book (by Gamma et. al.) is an excellent
example of this kind of thing.
what are you referring here? Is this a name of the book and if so, is it good enough for any developer to go through it.
Thanks in advance.
0
 
jasonclarkeCommented:
> Is this a name of the book and if so, is it good enough > for any developer to go through it.

yes, it is a book.  It describes programming 'patterns', that is pieces of code that solve commonly encountered programming problems.  It does assume an object oriented environment, however.

It is a very good book, highly recommended for any software developer.  It may be be too complex if you don't understand the basics of programming and data structures, however.

Here is a link to info about the book:

http://cseng.aw.com/book/0,3828,0201633612,00.html


0
 
nrajanCommented:
My advice to you is this.

1) Learn the fundamentals of Object Oriented programming. Esp the core concepts of Encapsulation, Inheritance and Polymorphism

2) Learn a good OOP language like C++ and/or Java. Don't worry if the details like 'deep copies' or 'virtual destructors' confuse you. One day, after you have worked for sometime in projects, you will have an 'Aha!' experience which will make you understand the complexities

3) Once you know the nuts and bolts get going into projects. You will learn better under pressure when you will have to complete a project within a timeframe.
0
 
awjackin35Author Commented:
Thsnks for the advice.
0
 
awjackin35Author Commented:
Thsnks for the advice.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now