How does one assess progress when learning a programming language?

In summary, the conversation discusses the process of learning a programming language, specifically for a physics major who wants to learn Python. The individual has taken a C/C++ class but does not feel confident in their knowledge and is seeking a more detailed explanation of how one learns coding. Suggestions are made to practice coding and use resources such as the Python documentation and "Python Crash Course, 2nd Ed." by Eric Matthes. The conversation also mentions the use of VPython for interactive 3D visualizations and simulations, which can be useful for physics applications.
  • #1
dpatnd
64
20
I'm a physics major (Junior) who would like to learn a programming language. Many suggest Python as a good starting language, so let's suppose that is the language I want to first learn. This isn't for employability or general usefulness; rather, I'm just curious.
How exactly does one go about "learning" a programming language and how does one determine what has actually been "learned"? When can you say you "know" a given language? The issue is that I have no idea what "learning" looks like when applied to coding. I can very easily determine what I have learned and how well I have learned it when it comes to things like physics and mathematics, but not for coding.

I have taken two coding classes (technically one, since the second focused on a hardware description language). That one class was on C/C++. I got an A, and it seemed like my professor thought that an A translates to "knowing" how to code in C; at least, we should be able to put it on resumes as a skill without being deceitful. Yet, I would not dare put C/C++ on any resume. As far as I can tell, I learned nothing. So, if after a semester ending in an A I am no closer to "knowing" C, what exactly does "learning" look like in the first place? This bothered me a lot, since if I end a semester with an A in, say, a math class, I can confidently demonstrate that I "learned" most of the course material at a later date.

I guess I'm just asking for a more detailed explanation of how one "learns" coding. All the answers I've encountered thus far have been vague and unsatisfying. I hope to take a computational physics class in Python next semester, which will hopefully leave a more long-lasting impression on my brain than that C class.
 
Technology news on Phys.org
  • #2
dpatnd said:
That one class was on C/C++. I got an A, and it seemed like my professor thought that an A translates to "knowing" how to code in C; at least, we should be able to put it on resumes as a skill without being deceitful. Yet, I would not dare put C/C++ on any resume. As far as I can tell, I learned nothing. So, if after a semester ending in an A I am no closer to "knowing" C, what exactly does "learning" look like in the first place? This bothered me a lot, since if I end a semester with an A in, say, a math class, I can confidently demonstrate that I "learned" most of the course material at a later date.
Did you write programs in your C/C++ class? I've taught both C and C++ many times, and have always had my students write and submit programs. To my way of thinking a good test of whether you've learned a language is to be able to write programs using that language.

Some of the basic ideas of C and procedural C++ (i.e., non-object-oriented C++ with little discussion of classes) include the basic types, control structures for making choices (if ... else, switch ... case), control structures for looping (for loop, while and do ... while loops), arrays, functions, input and output.

Most of these ideas are also present in python, so if you remember anything at all from the class you received an A in, you should be able to make good progress. For myself, when I'm trying to learn a language, I write short programs that focus on one or two concepts, and then alter it to see how well I understand it.

I have programmed in Python a little bit, mostly using the Python documentation that is provided with it. I recently purchased "Python Crash Course, 2nd Ed." by Eric Matthes. I found the first half of the book to be a useful compendium of the basic concepts as they are implemented in Python. The latter half is devoted to larger projects, some of which I'm not so interested in.

dpatnd said:
I guess I'm just asking for a more detailed explanation of how one "learns" coding.
See above.
 
  • Like
Likes sysprog
  • #3
dpatnd said:
I guess I'm just asking for a more detailed explanation of how one "learns" coding.
The best way to learn coding is by coding. Find some program that you would like to code, and code it. Since you are a physics major, you could try writing a program to solve some physics problem.
 
  • Like
Likes pbuk and robphy
  • #4
Here's https://www.glowscript.org/ , which is a web-based incarnation of VPython.
It supports the Matter and Interactions physics textbook by Chabay and Sherwood
https://www.glowscript.org/#/user/GlowScriptDemos/folder/matterandinteractions/
Computation is integrated into the course.
It is especially good for interactive 3-D visualizations and simulations.

https://www.glowscript.org/#/user/m...terandinteractions/program/S1-hard-sphere-gas

https://www.glowscript.org/#/user/m...der/matterandinteractions/program/03-3body-3D

I've been using VPython since 2001.
(I have a lot of old code that doesn't run in the new versions. I have to revise them.)
 
  • Like
Likes dpatnd
  • #5
PeterDonis said:
The best way to learn coding is by coding. Find some program that you would like to code, and code it. Since you are a physics major, you could try writing a program to solve some physics problem.
Just an idea on how to know if you have learned the, (or a) language.

There was a recent post in the Homework section about a cannon firing horizontally while placed on a slope of 42°. Where in, X, Y coordinates from the cannon, does the cannon ball land? (Assume the cannon ball lands further down th slope.)

Then modify the program to take user input for slope angle; then also for firing angle.
Then modify the program to write output to a disk file.
Then modify the program to take input from a disk file. (Created with a simple text editor, not a word processor.)

(Does the pgm gracefully handle non-numeric input? It better, because in the real world it happens. What happens if the angle is entered as forty two?)

When you get the above to work, you can confidently state that you are 'familiar' with, or 'have used' the language and have written some small programs in it. (But not an 'expert' yet.)

If you are interested, you could perhaps extend the program to find the firing angle of multiple cannons, in multiple positions, to lay down a barrage with a specified spacing of landing points.

Have Fun!
Tom

p.s. You may have noticed that one of the hard parts of programming is making sure it does something 'reasonable' when the programmers assumptions are not met.
 
  • Like
Likes dpatnd and PeterDonis
  • #6
Being able to write some simple games is one way to exercise your skills. Tictactoe, Guess a Number, or Gunner (previous post with cannon elevation to hit target)

Whenever I tackle a new language, I try to do these tasks in it:
- read files, search for text write results to a new file (a poorman's grep command)
- read user input, validate it and display it (eg temperature converter fahrenheit to celsius and back)
- read directories and display the tree of files with size, date and permission attributes shown
- run external commands ie concatenate strings together to create a command and execute it
- access and process html/xml or json data
...

These tasks are useful when trying to develop custom tools for some work project you may have.
 
  • Like
Likes dpatnd
  • #7
Mark44 said:
Did you write programs in your C/C++ class? I've taught both C and C++ many times, and have always had my students write and submit programs. To my way of thinking a good test of whether you've learned a language is to be able to write programs using that language.
We did have weekly coding assignments. The most complicated program I wrote in C was a "bookstore" that read from a file containing an inventory of books, their quantity, prices, etc. The user had to be able to navigate a menu allowing them to view the info of any book searched by title. They then had to be able to purchase their chosen books in the desired quantity, after which the program would write an invoice file and update the inventory file with the remaining quantities.
It took me quite a while, and I certainly wouldn't know where to begin if I wanted to replicate it.
 
  • #8
Tom.G said:
Just an idea on how to know if you have learned the, (or a) language.

There was a recent post in the Homework section about a cannon firing horizontally while placed on a slope of 42°. Where in, X, Y coordinates from the cannon, does the cannon ball land? (Assume the cannon ball lands further down th slope.)

Then modify the program to take user input for slope angle; then also for firing angle.
Then modify the program to write output to a disk file.
Then modify the program to take input from a disk file. (Created with a simple text editor, not a word processor.)

(Does the pgm gracefully handle non-numeric input? It better, because in the real world it happens. What happens if the angle is entered as forty two?)

When you get the above to work, you can confidently state that you are 'familiar' with, or 'have used' the language and have written some small programs in it. (But not an 'expert' yet.)

If you are interested, you could perhaps extend the program to find the firing angle of multiple cannons, in multiple positions, to lay down a barrage with a specified spacing of landing points.

Have Fun!
Tom

p.s. You may have noticed that one of the hard parts of programming is making sure it does something 'reasonable' when the programmers assumptions are not met.
I see. This is more the sort of detail I was looking for in an answer, thank you.
It seems to me that -- at least with the type of problem you gave as an example -- the purpose of writing a program is not to extract a result that would be difficult to get by hand, but rather to extract multiple results quickly for varying initial conditions.
 
  • #9
dpatnd said:
It seems to me that -- at least with the type of problem you gave as an example -- the purpose of writing a program is not to extract a result that would be difficult to get by hand, but rather to extract multiple results quickly for varying initial conditions.
For the example given, yes - definitely.

For a different example the purpose for the program might be to take a crazy number of variables and possibilities into consideration and come up with a 'reasonable' conclusion.

What comes to mind would be many trains traveling both directions on a few one-way tracks with turn-outs scattered at various distances.

With only a few trains, your brain, pencil, and paper would have a chance of finding a usable schedule and train speed. With tens or hundreds of trains to schedule your short term memory is quickly overloaded for details, and even for where to find the details that you have already written.

So yeah, use a computer for multiple answers to the same problem, or to handle the bookkeeping for large problems. And once you are comfortable with a language, sometimes you will be surprised at how small a problem can be where it is done quicker by writing a program for it!

Cheers,
Tom
 
Last edited:

1. How do I track my progress when learning a programming language?

One way to track progress when learning a programming language is to set specific goals and objectives for yourself. This can include completing certain projects or mastering certain skills. You can also use online resources, such as coding challenges and quizzes, to assess your understanding and progress.

2. How often should I assess my progress?

The frequency of progress assessments can vary depending on your learning style and goals. Some people prefer to do daily or weekly self-evaluations, while others may do them monthly or after completing a major project. It's important to find a schedule that works for you and allows you to accurately track your progress.

3. What are some ways to measure progress in programming?

Some common ways to measure progress when learning a programming language include completing projects, solving coding challenges, and passing online quizzes or tests. You can also track your ability to read and understand code, as well as your efficiency in writing code.

4. How do I know if I am making progress or just memorizing code?

A good way to assess if you are truly making progress is to apply your knowledge to different projects or challenges. If you are able to solve problems and write code without relying on memorization, it is a good indication that you are making progress in truly understanding the language.

5. How can I use feedback to assess my progress?

Feedback from others, such as peers or mentors, can be a valuable tool in assessing your progress when learning a programming language. They can provide insights and tips on areas where you can improve and also offer encouragement and recognition for your progress. Additionally, seeking out feedback from others can help you identify blind spots and areas for growth that you may not have noticed on your own.

Similar threads

  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
22
Views
2K
  • Programming and Computer Science
Replies
4
Views
636
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
Replies
1
Views
729
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
2
Replies
54
Views
3K
Back
Top