Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I, from my very knowledge, know C/C++ pretty good.

I have good memory of how to use all of the features, keywords, loops, structures, conditionals, pointers, classes, object-oriented programming, etc.

But my problem is that I suck at writing code terribly.

I know all the tools I have and know how to use them, but cease to put together a working project.

I have never made anything useful, although I know the language very, very well.

My problem is that I can't write good code, and that's the worst thing of all.

I'd be better off knowing LESS C/C++ and being better at writing code than knowing more and sucking more as well.

I fail to see through what I need to do, and end up going on a bad trail of code writing, and become hazy in the process, even though I know the language well.

Is there any way I can ever get better at this? It's like I can't put it together in a C/C++ logical sense, but I know C/C++ enough to be able to. Help?

EDIT: The software I write varies between anything really. From network server programs to games to even operating systems, the problem is that I can't implement what I know; like a writer's block sort of thing.

I think it may have to do with the fact that I never stick to one kind of software(e.g. game software) and that's why I struggle completing programs.

share|improve this question
2  
Is knowing English words different from knowing how to speak it? –  Oded Dec 21 '12 at 20:51
    
Yes. I know some Japanese words and I can say they with dead-on accent and such, but I can't put a sentence together without sounding stupid. 私はダメプログラム <-- –  leslar Bonar Dec 21 '12 at 21:15
1  
Domo, Jessica. I believe you have answered your question ;) –  Oded Dec 21 '12 at 21:16
    
In addition to all the great answers, you have been programming professionally without getting fired so you must be doing something right. You might have a lot to learn, but you might need to cut yourself some slack. –  Paul Hiemstra Dec 21 '12 at 21:48
add comment

closed as not constructive by GlenH7, gnat, Yusubov, Walter, Dynamic Dec 21 '12 at 22:01

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

8 Answers

up vote 6 down vote accepted

There is a difference between theoretical knowledge and applied knowledge.

Programming is not just a matter of knowing the right words, its knowing how to use them.

Software is not just a bunch of munged together syntax, its problem solving encoding to instruct a computer how to execute the solution.

Writing a (non-trivial) application is not just a matter of knowing how to do it, its having the perseverance to work it to completion.

In the same way, knowing a natural language such as English "very well" does not mean that you would be able to write a good book in that language if you lack the ability to construct a convincing narrative with plausible dialogue or apply the labor necessary to produce it.

Having said that, in a more practical vein, I would suggest that rather than attempt to solve problems / write software in C++ by just opening an IDE and coding you instead spend some time off the computer thinking, and write out in your natural language a step by step solution to that problem on paper. Spend some time on paper trying to reduce your step by step solution as much as possible, removing duplication, looking for any easy abstraction, and honing it down to the bare minimum necessary to make it work. You might want to try using a modeling technique to further refine the ideas, or not, until you have a clear mental picture of the entire solution.

Only then open your IDE of choice and translate your solution into C++ (or whatever language you like). Just code it top to bottom; don't spend undo time on idiomatic expressions or premature optimizations; just get the most straightforward solution you can working as fast as you can. Test it for completeness; I like doing Unit Tests / TDD, but if that is outside your comfort zone just get some kind of feedback loop around your nascent program so you can interact with it.

Once it works, commit it to version control (or make a backup copy). Now start applying your advanced language skills (C++, whatever) and refactoring the working logic into a better design. Your test mechanism should be sufficient to allow you to feel confident you are not changing the functionality, only the implementation.

Once you get more comfortable, have a few completed applications under your belt, and have learned some things about which language features you really ended up using in the end and which didn't seem worth it or weren't really necessary you will have much more confidence and should be more able to start off at a good design rather than brute forcing and incrementally improving as you progress in your career.

All in my opinion, and your mileage may vary, of course.

share|improve this answer
1  
Great answer! I'll kind most of the things you said in mind later today. –  leslar Bonar Dec 21 '12 at 20:54
    
Good luck, and remember that none of us started out as genius rockstar make-it-look-easy programmers. If you keep at it you will eventually get better. “Life is so short, and the craft takes so long to learn”. - Geoffrey Chaucer –  Ed Hastings Dec 21 '12 at 21:02
    
Some people seem like they're so good at analytical problem solving skills and math that they make people like me feel behind always. :( –  leslar Bonar Dec 21 '12 at 21:16
    
It's true, a good developer is usually also a good problem solver...but even if you are not naturally gifted in that area you can learn / develop one or more methodologies to help you compensate. I've known a few people who couldn't reason their way out of a paper bag on their own but had a system of some kind (such as checklists, or a methodology) that allowed them to overcome it. Search the internet for "problem solving skills" and maybe you'll stumble across something that appeals to you. –  Ed Hastings Dec 21 '12 at 21:39
    
+1 for less coding and more thinking. This is biggest gotcha I had in the 5 years following my masters degree (not computer science). –  Paul Hiemstra Dec 21 '12 at 21:40
add comment

Programming is a skill that only gets better with use. It is entirely possible to know the tools of programming like the various programming languages, algorithms and design patterns but still be a poor developer. The only way to address that much like any other skill is practice.

Even with great practice and daily use, you will always find some people that are so natural at it that it makes your own skill look bad so one must be careful not to always look at how they are doing compared to others. Having said that though, this is skill that always has new things to learn and lots of challenges to hone one's skill. If it is possible to get a mentor to work with you and point out areas of improvement and share tricks of the trade so to speak you will be ahead of the game.

Don't give up. Keep at it. Be humble. Study and learn voraciously the tools that you have, but more than anything practice and use them. You will get better.

share|improve this answer
1  
So you don't think it's weird for someone to have a broad sense of programming knowledge and features, computing, computer science and computer hardware, but be terrible at writing real-world software? I have done software before under Windows API, Assembly, C/C++, Java, etc. But software that is actually useful, no. –  leslar Bonar Dec 21 '12 at 20:37
    
@JessicaLundry I don't think it is weird necessarily. I just find it probably is a lack of experience in the actual skill of programming. Without using the skill and honing it is possible to be "book" smart or even practically smart, but not great at programming. That is OK too. Just keep working at it. –  Akira71 Dec 21 '12 at 20:45
    
Well, that's weird considering @Dima doesn't think I can know a language without knowing how to use it. –  leslar Bonar Dec 21 '12 at 20:52
    
@JessicaLundry, no I don't. I mean no disrespect, but it seems to me that you have simply memorized the terminology, like reference, pointer, etc. Knowing a programming language is more than that. It is the ability to take a set of requirements, and translate them into a working program in that language. –  Dima Dec 21 '12 at 20:56
1  
It is perfectly ok to look up functions. In fact, many IDEs will help you do that very fast. A good coder is someone who writes code that works, and that can be easily understood by another coder. –  Dima Dec 21 '12 at 21:11
show 3 more comments

Take a look at Bloom's Taxonomy. Your issue is you have good knowledge and comprehension, but poor synthesis skills. Probably the best way to improve is simply to practice. However, your practice will be most effective if you practice the design process instead of just using the pieces. Learn about design patterns. Take a problem and solve it 5 different ways to figure out which is the best. Figure out your classes and their relationships before you write any code. Practice breaking down a problem into smaller and smaller pieces, until the pieces are so small they are trivial to write. Solve a problem in English first, then just "transcribe" it into C++ code.

share|improve this answer
    
+1 for breaking things down. this is absolutely great practice for the novice. Being able to see a problem as multiple parts immediately is a common skill to experienced devs Do it on a whiteboard/paper for the added benefit that it helps develop their own visual style which every engineer has and is ever so important, it's like a common lexicon for themselves to relay things to themselves and in ones personally consistent visual cues one often identifies patterns on ones own. There's a reason we all have whiteboards/stenos everywhere, and it's not because good engineers think they're useless. –  Jimmy Hoffa Dec 21 '12 at 21:35
add comment

So if you can't write code, then what's the point? This is like saying "I really suck at chess, but I know how all the pieces move really well."

Then let's expand on the analogy. Everyone starts learning to play chess by learning how the pieces move. Then you practice playing and have your mistakes pointed out to you. Then you learn common strategies, the beginnings, and the endings.

Same here. Start by writing simple programs. Get a textbook on learning to program with C++ and do all the exercises. Show your code to someone who is good. Learn from the feedback. Then progress to writing larger and more complex programs. Your alternative is to quit, and do something else.

share|improve this answer
    
That's exactly what my problem is. I seem to be learning everything about the language but how to actually use it. Software is always different and always changing, so I don't know where I went wrong ... maybe I should start smaller and work up, rather than just randomly tackling anything I have less experience in? –  leslar Bonar Dec 21 '12 at 20:35
    
I don't need a book or reference for C++ basics though. I can pull almost every bitwise operator, ternary, binary, unary, conditional, loop structure, keyword, pointer, reference, and feature from the back of my head. The problem I have is actually putting it all together adequately. My problem is not learning the language, it's learning how to code WITH the language/languages. –  leslar Bonar Dec 21 '12 at 20:48
    
I said that you should do the exercises in the book, which ideally should be designed to teach you how to put those features together to do something useful. Have you heard of FizzBuzz? Can you write that? –  Dima Dec 21 '12 at 20:51
    
I never heard of that, no. But I have written console/terminal command-line programs on Windows that have done similar work. I guess I'll try, but I'm pretty sure it's no sweat at all considering I have a much more diverse background in studies. –  leslar Bonar Dec 21 '12 at 21:01
    
Ok, if you can do FizzBuzz, you've got the basics of coding. Do you know data structures, like linked list, stack, queue? In college I had to write a simple airline reservation system, to learn how to use different kinds of data structures together. Do you know about recursion? Trees? Then see if you can write a program to play a simple game, like Tic Tac Toe. The important thing is, every time you write a piece of working code, see if you can refactor it to make it cleaner. Read "Clean Code" by Robert C. Martin. –  Dima Dec 21 '12 at 21:07
show 1 more comment

You may or may not really know C++... I think it's difficult to have a solid understanding of a language until you start using it. I'm not talking about syntax and features, but rather when and why to use those features (and when and why not to).

It sounds like your deeper issue might be problem solving. Try this: Forget about C++ for a bit. Go find some nice little programming problems, like ones from Project Euler or whatever, and write down solutions in English (or in whatever human language you're most comfortable in). Be very specific -- write down each step in the solution as though you were writing a computer program, only in your native tongue.

Once you've written down the solutions to a handful of those problems as unambiguously as you can, then try translating them into C++ (or another computer language). If the process goes smoothly and you're able to create programs that work correctly, consider spending more time working on solutions before you jump into coding. On the other hand, if you run into the same kind of trouble that you've been having, think carefully about where the problem is: Is it your approach to solving the problem that's wrong? If so, keep practicing by solving problems first in prose. On the other hand, if your approach is correct but you have a hard time going from English to C++, maybe your command of C++ isn't quite what you thought.

Finally, don't worry if you find it difficult to do this at first. If it were easy you wouldn't be learning anything.

share|improve this answer
    
The problem I think I have is spending more time learning the language than actually using it. I don't have expertise in C++, but I am, to say the least, an intermediate of the language from all the time I've spent reading, deciphering, and analyzing it, but not spending as much time actually implementing it in to a working software program(I don't have a working PC now, I'm at a friend's house and she won't let me install a platform-specific compiler, etc.). –  leslar Bonar Dec 21 '12 at 21:05
1  
@JessicaLundry Nevertheless, if you "suck" at writing C++ code then by definition you haven't learned all that you need to know about C++ and programming in general. Doing the problem solving and the coding separately instead of trying to do them both at the same time will help. –  Caleb Dec 21 '12 at 21:21
add comment

I think the difference here is between knowing a language and knowing how to program.

Analogies to other jobs may well hold here. You may know English, Spanish, French, German, Russian, Japanese and Mandarin, each one like the back of your hand, but if you have stage fright or no sense of humor, you're going to be a lousy stand-up comedian in any language. You could have $5000 worth of tools in your garage and know how each one of them functions, and still be a terrible mechanic.

Unfortunately, like most things, programming requires a talent and a bit of intuitive knowledge. We call it "groking"; if you "grok" development work, you intuitively think on the same wavelength as other coders and thus can be effective by just diving into a codebase alongside others. You don't seem to "grok" coding.

The way you gain this intuitive grasp is by taking a step back from the tools, and taking a more big-picture look. You have a pretty firm grasp on how, but there are two key questions that must always come first; what, and why. So, ask yourself; what, conceptually, is an object? What are the advantages I gain by having code organized into objects (equivalently, why do I want to use an object, and by extension why do most languages pretty much shove the concept down my throat)?

Look at pseudocode; Wikipedia's full of it. Pseudocode was developed as an intuitive bridge between "what do I want to do" at high levels, and the actual code that will do it. Understanding what the pseudocode algorithm does, and why it does those things, is critical to implementing it in a given language using the how knowledge you already possess.

share|improve this answer
    
That's exactly what I was thinking! Thanks for your answer. I figured there was no exact correlation between knowing a language, knowing computer science, and even knowing many other aspects of computers, but being bad at actually writing sophisticated software through what you know. For example I know C, and if someone told me to write a small scrolling game in the second dimension with a standard library I'd know basically everything about the process, but will lag at actually doing it, even though I shouldn't because I know all the steps in its creation, I just struggle implementing... –  leslar Bonar Dec 21 '12 at 20:40
    
I would still say that if you can't program, you don't know the language. –  Dima Dec 21 '12 at 20:44
    
Oh, trust me I suffered for a long time learning C++ ... but it was worth it because I at least know what I can do with it, I just can't implement that knowledge in working order. –  leslar Bonar Dec 21 '12 at 20:50
1  
Then what you must come to understand is why your birdhouses are unsatisfactory. This one's bottom fell out because you nailed the bottom on from underneath; you should instead have extended the sides downward and screwed into the bottom from either side. That one looks wonky because you ended up measuring the two sides differently resulting in different values; try measuring both sides the same way, and compare the sides to each other to ensure they match. These are lessons you learn, and they not only make your next birdhouse better, but the bookshelf or spice rack as well. –  KeithS Dec 21 '12 at 20:56
1  
Coming back to coding, if your programs break easily, understand why; why does changing this one little thing break something else a long way away? It may be that you're trying to use the same code to do two different things, or that you're doing more things multiple times than you thought you were. –  KeithS Dec 21 '12 at 20:59
show 4 more comments

Just knowing a programming language does not make a programmer. Programming languages are just a mean of expressing what you know. You could know English, but still not say anything meaningful/useful.

There are other skills involved in creating an application: analytical skills, architecure, design, algorithmics etc. All these skills require both theory and practice. In programming, theory and practice go hand in hand, you cannot have one or the other.

In Romania we have a saying, I'll try to translate it "You don't learn a skill(craft), you steal it". That's no problem if at first you look at other people's code before writing your own. And even when you advance you can still do this.

Also a good programmer should know how to choose the tools that makes him efficient. At first you can check out other opinions, but always try to filter them and make your own.

Good luck!

share|improve this answer
    
I seem to have problems with analytical skills, according to some people.... –  leslar Bonar Dec 21 '12 at 21:12
    
Yep, that's one of the biggest issues. You constantly need to "translate" concepts from the real world into an abstract one. You need to integrate this concepts into a bigger picture (architecture, design), but in the same time not lose the focus on details (design, code). Again only practice can help you here, starting first with real world but simple examples. –  Adrian Ber Dec 21 '12 at 21:17
    
Do you recommend I stick with a certain type of software and try to work up on skills, like possibly game programming and design?(I want to be a game programmer, but I also want to know I can apply my programming knowledge anywhere else as well). –  leslar Bonar Dec 21 '12 at 21:21
    
I would recommend you both: to work on one big project so you can learn how to put together different pieces of the puzzle, but also to work on other different smaller projects to develop in other areas as well. –  Adrian Ber Dec 21 '12 at 22:21
add comment

It's like I can't put it together in a C/C++ logical sense, but I know C/C++ enough to be able to. Help?

You may know the syntax and structures in C/C++, however writing software involves algorithmic mind set to solve the problem, depending on what you are trying to develop. In most cases knowing the syntax and structures help to code, but DO NOT help in solving the business/real problem.

Thus, what you are lacking is the practical knowledge of building software application by addressing the problem. You may overcome that by deeper understanding of the data structures and business work-flow of the software application.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.