How does one become proficient in programming?

  • Thread starter kingkong11
  • Start date
  • Tags
    Programming
In summary, the experts in this conversation suggest that in order to become a skilled programmer, one should take an algorithm theory class, study data structures and algorithms, and practice programming by building non-trivial software. They also recommend developing critical thinking skills and a good grasp of abstraction. While it is beneficial to learn multiple programming languages, it is important to have a deep understanding of at least one language. It is possible to self-study these skills, but having a mentor or expert to ask for help is also helpful. Additionally, it is crucial to have a solid understanding of the basics of programming, such as how data is stored and manipulated at the hardware level.
  • #1
kingkong11
18
0
Hello all,

I'm currently taking a programming course using C, and I find programming to be pretty interesting. After I finish the course, I want to learn a couple other popular programming languages (C++, java etc) on my own.

So, what should I do to REALLY become good at programming besides just reading the book
and write some basic programs?

Please be specific, don't just say "keep practicing", we all know that.

Thanks for any advice!
 
Technology news on Phys.org
  • #2
Take an algorithm theory class and study it to death. You'll learn about many tricks of the trade in order to write good programs. There's an endless number of ways to write a program to accomplish a goal, but knowing how to write good algorithms will vastly help you in any programming language and help you write efficient programs. Once you're exposed to enough theory and application, you'll be able to write pseudocode for what you want to do and apply it to the programming language that you want.
 
  • #3
Well, one important thing (particularly if you're self-taught) is to study the subject. For example, I recall a talented young programmer I worked with who didn't know how signed integer math worked with 2's complements and such. Took very little time to explain it to him, but that was quite a gap in his knowledge.

If you're going to teach yourself, you will need to seek out such knowledge and learn it.

Also, you would need to study data structures and algorithms. I would suggest at least a bit of discrete mathematics as well. I have a Discrete Math book that goes over tons of useful subjects, like combinatorics, format of floating point numbers, converting between different number bases, and so on.

As for the practice of programming itself, that really is a matter of practice. Read a lot about the language you are currently learning. Read books about good coding practices. And you should try and build some non-trivial software. Come up with an idea for a program you would like to write (something that interests you will help), and write it. After a bit, perhaps get involved with an open source project. Work on getting that "10,000 hours" in if you want to be truly proficient. Make it quality practice. Like in music, if you practice poorly, you will learn to do it poorly. So don't think "Oh, it's just practice, I can cut corners here". Practice doing it right. As I like to say: "Practice doesn't make perfect. Practice makes permanent."

Learning a few programming languages is, I find, very beneficial. But do get to know at least one very well. It's great if someone knows, like, 40 languages. But if they're terrible in all of them, it's just not very useful.
 
  • #4
Well there is little helpful advice beyond what's already stated.

There are however some qualities which are extremely helpful in that regard.
1. Critical thinking - questioning everything, always looking for a better solution. When writing something, always looking for ways to break it, crash it, make it spontaneously combust or whatnot(you know - so the guy using it doesn't get that chance...).

2. Good grasp of abstraction - that one I feel is one of the most important, especially for OOP languages. Breaking down the task and structuring your code properly can make your life soooo much easier as a programmer. In a sense that's the basic idea behind all high-level languages.
 
  • #5
Good stuff guys, thanks!

I'm an EE major, so in order for me to take a class on data structures and algorithm I would have to declare a minor in CS. A minor in CS in my school requires 16 credit hr worth of work. At the moment, I have no plan to do that.

Would you say the subjects mentioned above can be self-studied, and what kind of books would you recommend?
 
Last edited:
  • #6
kingkong11 said:
Good stuff guys, thanks!

I'm an EE major, so in order for me to take a class on data structures and algorithm I would have to declare a minor in CS. A minor in CS in my school requires 16 credit hr worth of work. At the moment, I have no plan to do that.

Would you say the subjects mentioned above can be studied by myself?

Very much so! Much of what I learned, I learned myself. I've come to the realization, however, that most people just are very bad at that. Auto-didacts are somewhat rare. Rare enough that the spell checker complains about the word "didacts". :biggrin:

But yes, it's certainly possible. I will say, though, that it is very useful to have an expert around to ask questions from when you don't quite get it, or otherwise need help. A mentor, if you like. Most of the time, I have no problems, but when you get stuck, it's very useful to know such a person. I suppose this forum does serve as such, at least a bit.
 
  • #7
LEARN THE BASICS (at the hardware level where they really ARE basic)

I'm always amazed at how much young programmers DON'T know about the very most fundamental concepts ... things like the first thing grep mentioned. Learn how data is stored in the computer. What is big endian and little endian?. Learn how data types are actually stored and manipulated AT THE HARDWARE LEVEL. Learn how radix number systems work. You can do a huge amount of programming without knowing any of this but the first time you get a funky result, you will most likely not have a clue what is going on.

For example, I'm always astounded by how many programmers do not instantly understand why the following is false

1.4 + 2.6 = 4.0

[by the way, if anyone sees this and doubts my sanity and wants to argue about it, I am not interested. I have explained this for over 40 years and am tired of it. see here: http://www.vbforums.com/showthread.php?s=&threadid=211054 ]
 
Last edited:
  • #8
Very well said, phinds. My point exactly.
 
  • #9
Indeed. Never test equality on floats :)
(has to do with how some numbers cannot be represented precisely in binary)
 
  • #10
martix said:
Indeed. Never test equality on floats :)
(has to do with how some numbers cannot be represented precisely in binary)

Which is EXACTLY what I am talking about. Simply knowing that "it has something to do with ..." is not enough, Kingkong, you need to understand exactly WHY it is that way, and this is just one of many such fundamentals that good programmers understand and bad ones don't. So knowing, as matrix does, THAT there are certain "rules" you can follow doesn't help nearly as much as actually understanding WHY the rules exist.
 
  • #11
phinds said:
LEARN THE BASICS (at the hardware level where they really ARE basic)

I'm always amazed at how much young programmers DON'T know about the very most fundamental concepts ... things like the first thing grep mentioned. Learn how data is stored in the computer. What is big endian and little endian?. Learn how data types are actually stored and manipulated AT THE HARDWARE LEVEL. Learn how radix number systems work. You can do a huge amount of programming without knowing any of this but the first time you get a funky result, you will most likely not have a clue what is going on.

For example, I'm always astounded by how many programmers do not instantly understand why the following is false

1.4 + 2.6 = 4.0

[by the way, if anyone sees this and doubts my sanity and wants to argue about it, I am not interested. I have explained this for over 40 years and am tired of it. see here: http://www.vbforums.com/showthread.php?s=&threadid=211054 ]

I agree with the comment that learning things at its most fundamental level is the way to start. However, the book I'm using for C doesn't have too much information about how computers actually store data (other than the fact they are stored in binary).

If you know any good readings about programming or CS in general, please let me know.
 
  • #12
kingkong11 said:
If you know any good readings about programming or CS in general, please let me know.

Wish I did but I can't help you with that. Been away from formal studies for much too long. I learned C from the White Book but I don't even remember where I learned hardware-oriented fundamentals.
 
  • #13
kingkong11 said:
Hello all,

I'm currently taking a programming course using C, and I find programming to be pretty interesting. After I finish the course, I want to learn a couple other popular programming languages (C++, java etc) on my own.

So, what should I do to REALLY become good at programming besides just reading the book
and write some basic programs?

Please be specific, don't just say "keep practicing", we all know that.

Thanks for any advice!

What do you mean by programming exactly?

Programming is just a language, so practice is the real key to becoming proficient.

On the other hand, if you are asking about the design of software, here are a few useful tips...

1. Develop mathematical maturity.
2. Don't design a program by simply programming it; instead, start with the input and outputs, and develop a stratigy for achieving the goals.
3. comment in complete sentences.
4. common often
5. Learn to pull a design from existing code.
6. Prove a design works before programming it.
7. Test as many paths as possible for errors.
8. Learn algorithms and their strengths and weaknesses. For example, what is the most efficient way to sort 1 million integers?
9. Learn enough about software patents to become pissed off.
10. Learn why open source is not necessarily better than closed source. Hint: how a project is designed is more important than closed/open ideologies.
 
  • #14
phinds said:
LEARN THE BASICS (at the hardware level where they really ARE basic)

I'm always amazed at how much young programmers DON'T know about the very most fundamental concepts ... things like the first thing grep mentioned. Learn how data is stored in the computer. What is big endian and little endian?. Learn how data types are actually stored and manipulated AT THE HARDWARE LEVEL. Learn how radix number systems work. You can do a huge amount of programming without knowing any of this but the first time you get a funky result, you will most likely not have a clue what is going on.

For example, I'm always astounded by how many programmers do not instantly understand why the following is false

1.4 + 2.6 = 4.0

[by the way, if anyone sees this and doubts my sanity and wants to argue about it, I am not interested. I have explained this for over 40 years and am tired of it. see here: http://www.vbforums.com/showthread.php?s=&threadid=211054 ]

If a number library is used, the result could be true. So its a matter of implementation.
 
  • #15
SixNein said:
If a number library is used, the result could be true. So its a matter of implementation.

Yes, there in fact used to be machines that were decimal at the hardware level, and for them it would be true. Also, some languages on some machines will do some automatic rounding which makes it LOOK true. Also, there are data constructs (e.g. CURRENCY) that will also make it true.

None of that is my point. My point is that the way most machines store floating point numbers causes this result and it is important to understand why.

In fact, your point as stated makes MY point, which is WHY does this occur? Why should some implementations show it as true and some not? Understanding the hardware and data constructs is what I'm driving at.
 
  • #16
phinds said:
For example, I'm always astounded by how many programmers do not instantly understand why the following is false

1.4 + 2.6 = 4.0


phinds said:
Yes, there in fact used to be machines that were decimal at the hardware level, and for them it would be true.
There are still are machines that support decimal math. IBM system 390 and most business oriented mainframes fully support BCD (Binary Coded Decimal). So do Intel cpus on PC's if you bother to use or create a library based on their BCD instructions. Most business and almost all (if not all) bank accounting systems use decimal based math to avoid any issues with binary versus decimal floating point conversion issues.

Getting back on topic, part of becoming a good programmer involves some form of specialization, for example writing interrupt driven device drivers versus writing math intensive code. There are some common generic aspects to being a good programmer, but a lot of this is the result of experience with a variety of program types and algorithms.
 
  • #17
Learning about data structures and algorithms as suggested above is essential. Learning other languages, particularly object oriented languages like python, ruby or c# makes these concepts much easier. Spend some time playing with some of these languages, many of which are available for free as open source, and find one you really like. Most professional programmers know more than one language, but frequently have a favorite (mine is python).

Explore new features and study others codes. Take a program and study it so you fully understand how it works, then add new features or improve the algorithms to work like YOU want it to. Take your old programs and rewrite them to take advantage of object oriented features, exception handling or other techniques you're learning.

I've been programming professionally (i.e. being paid) for over 30 years now (plus 8 years before I got paid) and am still learning new things. While you indicated "don't just say 'keep practicing'" you need to write a lot of code to become proficient. Read as much as you can about how to program new features, but you also need to practice. Once you've finished your program throw it away and do it better.
 
  • #18
phinds said:
For example, I'm always astounded by how many programmers do not instantly understand why the following is false

1.4 + 2.6 = 4.0

[by the way, if anyone sees this and doubts my sanity and wants to argue about it, I am not interested. I have explained this for over 40 years and am tired of it. see here: http://www.vbforums.com/showthread.php?s=&threadid=211054 ]
I read that thread and I must say (perhaps for the benefit of the readers on this forum) you were a little hard on a bunch of Visual Basic programmers for not knowing IEEE 754. There's no reason to expect BASIC programmers to understand hardware implementation details...

Incidentally, despite what you think, whether a number is irrational or not is independent of whatever number system you use to represent said number. It doesn't matter whether you represent the number in decimal, hexadecimal or binary, a rational number is rational and an irrational number is irrational...
 
  • #19
Jocko Homo said:
It doesn't matter whether you represent the number in decimal, hexadecimal or binary, a rational number is rational and an irrational number is irrational...

That is incorrect. Do the math.
 
  • #20
A bit off topic, maybe this should be split off into a separate thread.

phinds said:
For example, I'm always astounded by how many programmers do not instantly understand why the following is false ... 1.4 + 2.6 = 4.0
It's not false in languages like APL, which have a tolerance factor for comparasons.

Jocko Homo said:
It doesn't matter whether you represent the number in decimal, hexadecimal or binary, a rational number is rational and an irrational number is irrational...

phinds said:
That is incorrect. Do the math.
Am I missing something here, every rational number can be represented as the result of division of two finite sized integers regardless if the number is stored as decimal or binary (my calculator has a factional display option but the size of the integers is limited). An irrational or transcendental number can not be represented as the division of two finite sized integers. I don't see how a number is stored in a computer changes this.
 
Last edited:
  • #21
rcgldr said:
Am I missing something here, every rational number can be represented as the result of division of two finite sized integers regardless if the number is stored as decimal or binary (my calculator has a factional display option but the size of the integers is limited). An irrational or transcendental number can not be represented as the division of two finite sized integers. I don't see how a number is stored in a computer changes this.

Hm ... you are correct in the definition of rational number of course and perhaps where I am being misled (or not, I haven't done math to follow through on this) is that I have taken it as being a number which, when that ratio is taken, results in either a terminating decimal number (at some point it just becomes all 0's on out) OR a number that at some point comes to a repeating pattern (that continues forever).

My belief, and I have not yet verified this, is that when you convert some numbers from decimal to binary and then do the division in binary, you do can get an infiinite non-repeating binary real number. I doesn't SOUND logical, now that I think about it and perhaps when I did 16/10 as 10000/1010 I didn't carry it out far enough (or it might have been 14/10 as 1110/1010, I can't remember whether both of them seemed irrational in binary or just one of them.

Guess I'm now going to have to do the math. GADS I HATE doing long division in binary, but in this case, I KNOW you can't get the computer to do it for you because it doesn't have enough bits, so it gets to a rounding error which is the point I was making in the post I referred to.


LATER: OK, I didn't go very far w/ the long division in binary (horrible stuff) but I'm convinced you are correct, as you logically MUST be. The problem of 1.4+2.6 not being equal to 4.0 in computers has nothing to do with the rationality of the number in one system or the other, it just has to do with the fact that when you do the division in binary you have to truncate before adding so you get a rounding error.

As I pointed out in the other thread, the decimal-based computer's equivalent of this is that 1/3 + 2/3 is not equal to 1.0 because when you put them into floating point representation you get (I'm going to assume a 10-digit memory) .3333333333 + .6666666666 which comes out to .9999999999 so the equality doesn't work.

Thanks for pointing out my mistake about the rationality.
 
Last edited:
  • #22
Wikipedia said:
Irrational numbers are precisely those real numbers that cannot be represented as terminating or repeating decimals.
There are a few important points here in the above.

Given that, I know for a fact that there are numbers which can be represented accurately in a finite string of digits in one number system, while requiring a representation with repeating digits in another. (I just can't think of any examples in binary right now)
 
  • #23
martix said:
There are a few important points here in the above.

Given that, I know for a fact that there are numbers which can be represented accurately in a finite string of digits in one number system, while requiring a representation with repeating digits in another. (I just can't think of any examples in binary right now)

For sure one of the examples I gave (either 1.4 or 1.6) converts to binary with an infinitely repeating pattern (I've tossed my scratch notes and don't remember which it was ... might have been both).
 
  • #24
This is a niche part of programming, still thinking it belongs in another thread.

phinds said:
when you do the division in binary you have to truncate before adding so you get a rounding error.
Some environments will round instead of truncating to get more accurate results, when doing floating point math.

phinds said:
1/3 + 2/3 is not equal to 1.0 because when you put them into floating point representation you get (I'm going to assume a 10-digit memory) .3333333333 + .6666666666 which comes out to .9999999999 so the equality doesn't work.
Depends on the comparason "tolerance factor", and also some systems will convert 2/3 into .6666666667, since that is the more accurate answer.

There are numbers which can be represented accurately in a finite string of digits in one number system, while requiring a representation with repeating digits in another
Depends if the denominator has any prime factors that are not factors of the base number. 3 isn't a factor of either 2 or 10, so 1/3 in decimal = .33333333 and in hex = .55555555. 1/5 = .2 in decimal, but .33333333 in hex. 2 is a factor of 10, so fractions involving powers of 2 are finite (but possibly long) strings in decimal, such as 1/256 = 0.00390625 in decimal, and .01 in hex.
 
  • #25
phinds said:
Jocko Homo said:
It doesn't matter whether you represent the number in decimal, hexadecimal or binary, a rational number is rational and an irrational number is irrational...
That is incorrect. Do the math.
I would please like an honest answer to the following question: what makes you think that I haven't done "the math?"

The way you put this makes you sound like you're so sure of yourself, which is exacerbated by how wrong you are. Honestly, it's pretty insulting...
 
  • #26
martix said:
Wikipedia said:
Irrational numbers are precisely those real numbers that cannot be represented as terminating or repeating decimals.
There are a few important points here in the above.

Given that, I know for a fact that there are numbers which can be represented accurately in a finite string of digits in one number system, while requiring a representation with repeating digits in another. (I just can't think of any examples in binary right now)
Two points:

First, please read your claim of knowledge above. Can you see how it's irrelevant? According to your quote, irrational numbers "cannot be represented as terminating or repeating decimals," emphasis being mine. While a number may be represented with a finite number of digits in one system and a repeating set of digits in another, this doesn't change whether that number is irrational or not...

Secondly, please take care to quote in context:
Wikipedia said:
In mathematics, an irrational number is any real number which cannot be expressed as a fraction a/b, where a and b are integers, with b non-zero, and is therefore not a rational number. Informally, this means that an irrational number cannot be represented as a simple fraction. Irrational numbers are precisely those real numbers that cannot be represented as terminating or repeating decimals.
The emphasis is mine...

It seems to me that you're referring to an "informal" definition. While these informal descriptions can aid in understanding, I wouldn't rely on them as evidence as much as you do...
 
  • #27
kingkong11 said:
I agree with the comment that learning things at its most fundamental level is the way to start. However, the book I'm using for C doesn't have too much information about how computers actually store data (other than the fact they are stored in binary).
Trying to get back on topic here. For storing floating point numbers, most computers use IEEE format:

http://en.wikipedia.org/wiki/IEEE_754-2008

For most computers integers are stored as 32 bit or 64 bit signed binary numbers, although some computers support larger integers.

How the data is stored isn't that important for programming proficiency. There a lot of different types of programming, business, scientific, operating systems, data base, website design, embedded code for peripherals or consumer devices that have computers in them, ... .

Many students and engineers find MatLab to be helpful, although it's more like a mathematical tool as opposed to a programming language. There's still a large amount of legacy like scientific code still being written in Fortran. C and C++ are popular for a lot of types of programming.

You didn't mention what aspect of programming you like. As mentioned in prevoius posts, most jobs involve specializing in one type of programming. The main issue for learning programming is finding a good set of tasks to implement for the learning experience. Even if you don't take a class, getting the assignments from a class to implement programs yourself can be useful, but you made need help if you run into issues. I'm not sure what book to recommend these days.
 
  • #28
phinds said:
That is incorrect. Do the math.

No he's correct.

The mathematical reason floating point numbers behave as they do on computers has nothing to do with binary; instead, it is due to the inability of processors to work with fractions. So when you ask the computer to store 1/3, it does the calculation as 1 divided by 3 in decimal notation. So the computer winds up with .33333333-> and is truncated to a certain precision. If an operation such as 3 * (1/3) is performed, the computer takes .333333333 and times it by 3 to arrive at .9999999999. But its still a rational number because it repeats.

For example... the .333333333 can be expressed as a fraction by taking 33 (the pattern) and dividing by 99. The .999999999 can be expressed as fraction with 99/99.

Irrational numbers, like PI, are always irrational. There are no patterns.
 

1. How much time does it take to become proficient in programming?

There is no set amount of time to become proficient in programming as it largely depends on the individual's dedication, previous experience, and the complexity of the programming language. However, with consistent practice and learning, one can become proficient in a programming language within a few months to a year.

2. What are the best resources for learning programming?

There are many resources available for learning programming, including online courses, books, video tutorials, and coding bootcamps. It is recommended to start with a beginner-friendly language like Python and then move on to more complex languages as you progress.

3. Do I need a degree in computer science to become proficient in programming?

No, a degree in computer science is not necessary to become proficient in programming. Many successful programmers are self-taught and have learned through online resources and hands-on experience. However, a degree in computer science can provide a strong foundation and can be helpful in understanding advanced concepts.

4. Is it necessary to have good math skills to be a proficient programmer?

Having a good understanding of math can be helpful in certain areas of programming, such as data analysis and machine learning. However, it is not a prerequisite to becoming a proficient programmer. Many programming languages have built-in functions and libraries that handle complex math operations.

5. How can I stay motivated while learning programming?

Learning programming can be challenging and it is important to stay motivated throughout the process. One way to stay motivated is to set achievable goals and track your progress. It can also be helpful to find a mentor or join a community of fellow programmers for support and motivation. Taking breaks and celebrating small victories can also help in staying motivated.

Similar threads

  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
1
Views
705
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
8
Views
832
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
22
Views
870
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
2
Replies
69
Views
4K
  • Programming and Computer Science
2
Replies
49
Views
3K
  • Programming and Computer Science
2
Replies
54
Views
3K
Back
Top