# Study Advice for a CS Student

It's my second year in my computer science degree, 2nd semester. I feel like I am still not good enough and not satisfied with myself! I still can't program and when I have a task I can't think. I just go to google and copy the solution most of the times! Is it normal? I do study a lot even in the summer, but there is something missing.

What can I change in my study technique, to help me become a better programmer?

• Hi, Elsayegh88, welcome to Computer Science Educators! You're in the right community, but if you want help, the question will have to be re-formed a little bit. It can be a little confusing as a newcomer, but if you make it one question, and I will help you edit it to bring it to site standards. (You can post as many questions as you want on the site, so there is no need for multiple, unrelated questions within one prompt) – Ben I. Sep 1 '18 at 20:39
• I have edited question to address concerns. @Elsayegh88 can you create a new question for the bit I removed (One question per question). Click edited … to see edit history (So you can find the bit I deleted). – ctrl-alt-delor Sep 4 '18 at 8:31
• Welcome Again. Some feedback on how to use this site. First let me say that you are doing well. However a nice may to show appreciation is to click on the up-vote buttons. And if there is an answer that solves the problem for you then click the tick ✓ (this can be a much harder decision, as you can only do this for one answer). Some people wait a while, and then tick the answer with highest votes, that they them-self have up-voted. – ctrl-alt-delor Sep 6 '18 at 10:55
• i can't up vote answers as i am still less than 15 reputation :) – Elsayegh88 Sep 6 '18 at 13:49
• @Elsayegh88 not anymore :) – UnhandledExcepSean Sep 7 '18 at 13:53

I will only answer the 1st question (as Ben says move the 2nd to a new question (the rule is, one question per question)).

So you want to get good a programming.

# Where to start

The first thing to do is to stop cheating (your are harming your-self). You will have to start with much easier problems, than you are currently on (It will seem that you are going backwards).

# Practice

Then you need to practice, practice, practice. There is an exercise called programming kata, where you just do the same exercise over and over, until you master it.

# To copy or not to copy

If you do copy code, then:

• you have not mastered it yet, so you will have to repeat the exercise.
• copy from your previous projects, not the internet or other people.
• don't paste code, type it.
• if you have to use the internet/book/other-people, then use reference manuals, Don't copy completed solutions.

To learn to write, first learn to read. Therefore read other peoples code. It is OK to read solutions. Read then, study them, understand them. Then do the exercise yourself. (It is not about memorising, it is about understanding.)

# Choice of language

The language you use will have a big effect. Some languages are unsuited as a beginner language.

e.g. Javascript is not a good choice of language, for learning to program.

• I agree with most of this answer, but I'm not sure the last sentence applies to everybody. Different languages are good choices for different people. Plenty of people learn how to program using JavaScript. – Kevin Workman Sep 5 '18 at 16:51
• @KevinWorkman Javascript is not an impossible first language, it is just not an ideal first language. However your can do a lot worse. – ctrl-alt-delor Sep 6 '18 at 8:50

Speaking very generally, coding requires two different kinds of skills:

1. Knowing the syntax of various concepts, e.g. what a for loop looks like.
2. Knowing when to use the concepts to solve a problem, e.g. to know when to use the for loop.

Going to google and copying some code might help with the first skill, but it doesn't help with the second skill at all. And it turns out that the second skill is much more important than the first skill!

The only way to improve your ability to code is through practice. Here's what I recommend:

• Create a personal website. Use something like GitHub Pages. Start with something very simple.
• Give yourself a project. The project should give you an opportunity to explore a topic you're interested in, but it should be small enough to finish in a few days. (Think a weekend, not a month.)
• Finish that project, and add it to your personal website. Write a blog post talking about what you learned, include screenshots or an interactive demo.
• Repeat. Build up a portfolio website of the stuff you're interested in, and slowly work your way up to more advanced topics.

The idea is that you need to practice breaking down a problem into smaller steps and working on one small step at a time.

Also see the answers to this related question: Advice for becoming more confident in programming

• Thank you , as i mentioned its the solving problem is my issue! its always the start . from where and how! will make sure to read these links thank you – Elsayegh88 Sep 6 '18 at 10:37

There's often a huge difference between sitting in a class and solving problems. It's the difference between knowing how to do an integral and realizing that in this specific instance it makes far more sense to use the trapezoidal method to numerically find the integral.

So, how do you learn to solve problems? By solving problems. Which of course sounds mildly circular. Here's what I'd recommend: pick an easier problem, one you know you can solve. [If you're looking for problems, try out the Euler problems, which are a ton of fun, and start easy and then get harder.]

Solve that problem as many ways you can. Try to go for at least five. Bonus points for all the extra solutions you come up with. Then, go through each solution and explain to your handy rubber duck what makes each solution good or bad - the pros or cons to each. Try to invent situations where each solution would be optimal, or decidedly non-optimal.

This sort of work will improve you far more than studying. Studying will expand your toolkit to some extent, but you have to use the toolkit to really understand whether or not certain things will work in certain situations. When you're in a woodshop class, there's a reason you'll spend most of your time on the shop floor. The human mind gains far more from experience than reading or lecture.

Finally, let me make something very clear. While you shouldn't make someone else do your schoolwork, you have to be careful not to completely fence yourself off from help. My dad (an engineer) often says that one of the great mistakes of engineers is believing they are working on a completely unique problem that has never been solved before, or somehow believing that no one can help them (or that they shouldn't have to ask for help). All of that is false.

My time breakdown when working on a project is generally 1% programming, 49% debugging, 50% googling/stack-overflow-ing. It's not a bad thing to ask the almighty google. It's more about knowing when something is within your capabilities, and when you need help. And always, always, read about why the code works - critical so you can adapt it to your application.

Tl;dr: solve them problems. And don't use google too much.

What can I change in my study technique, to help me become a better programmer?

I've always found that programming is a way of thinking; a thought process. I started with Pascal, C, COBOL and Assembler. was a system admin for a long while and suddenly I am programming in VBA now. Learnt VBA in 2 weeks and still learning more.

Well to be a better programmer, the first thing you need is a mind that thinks in terms of processes. What must come first then follow on to the second and go on to the third.

Have you got that ? Practice with a simple task like opening the door, If you were to instruct a computer/robot to do so... how would the commands be like. Don't worry about what language its going to be in. Start with the psuedocode/algorithm. What is the general flow. ie 1. approach the door; 2. take note of the door ( opens towards or away ) distance ( within reach) how to activate door opening procedure. and most importantly IS IT OPEN. 3. depending on the conditions of the previous checks you proceed to either open the door or walk right through.

Comment all your code ! I had a Lecturer return 0 for any program that had no comment on it. Comments are meant to show the logic/process/thinking of your program. So no comment equates to no thinking or no logic. didn't matter to him if your program worked or not.

Understand what you are copying, read the commented sections of the code that you are copying. It will give you a hint of why some commands are there and why some are not.

These were the basic tenets that were drilled in to me in my first years of programming. Still sticks.

Language is just how you say something. If you got the mindset right, and the ability to think out the process/logic of a program. You can program in any language, Java, JSON, C#, C++, python or even VB; Its just how to type the syntax of the commands. a good IDE will stop you from screwing that up too much.