What resources are available for a beginner in computer science and physics?

In summary: In a nutshell, when you are writing code you should be aware of the order of operations (OP):Operator precedence- This is the order of operations in a strict mathematical sense. It is basically the order of operations that you will see in school.Left-to-right- This is the order of operations that you will see on a computer.Parentheses- These are important because they tell the compiler (or computer) how to process the code. For example, if you want to multiply two numbers and put the result inside a variable, you would put the parentheses first and then the multiplication.You will also need to be aware of how to use variables correctly and understand types. Types are
  • #1
zoiberg137
28
0
I am planing on taking physics as a major, and am also considering studying computer science on the side (my school offers a 5 year cs masters when your majoring in physics). The thing is, I know nothing about computers. I barely understand the difference in software and hardware. When I see an example of code, I am just baffled and don't get how so many people have caught on to such a concept while I have not even been aware of its existence!

In any case, I am naturally attracted to things I don't understand. And so I can't help to humor the idea of taking computer science classes to see how I like it.

But first, just thought Id ask and see if anyone has any suggestions on a book or website I might want to read first to determine if its something that would actually interest me. How much math is involved for introductory computer science? The intro course at my college uses a book called Big c++. If i get this book and read it on my own, would I be able to follow it and make sense of anything without being in a class?


Thoughts? (Im 26 and in my first year of college by the way...Still trying to get a handle on what I want to do with myself in the long run...)
 
Physics news on Phys.org
  • #2
You should be able to get the hang of the basics from the internet, try:

http://www.e-booksdirectory.com/programming.php
http://thenewboston.org/tutorials.php

To see if there is anything you like. In terms of mathematics you need to know the basics but it really depends on what your programming, of course a piece of drawing software needs geometry etc.

As for Big C++ feel free to read it, but try not to get caught in the trap of thinking "I know C++!" because you may know the syntax but without the understanding of the concepts its virtually worthless. Think "I am a programmer, I know how to make computers do what I want, It does not matter which language". For example arrays are similar in most all languages I have come across, when you get a problem and realize you need an array you would go look of the syntax for your paticular language that your using (This might not make sense until you know what an array is, sorry!)

Hope this has helped.

P.s if you do get into programming I recommend "The Pragmatic Programmer" book. Very good!
 
  • #3
Hey zoiberg137 and welcome to the forums.

For CS, one of the major components is programming which is what I used to do for money for a little while. You can learn it just like learning to drive a car for the first time or learning how to play a sport: it focuses on different things but the point is you can learn it.

Here is some advice for you to keep in the back of your mind when you are dealing with any kind of programming:

Be aware of two things: state and flow-control.

State just means every bit of data and information in memory that you use in some form and flow-control has to do with how data gets processed and in what way. Let's make these comments less confusing:

When you start programming you'll do simple programs like set an integer to a value, print a simple sentence on the screen amongst other things.

The most important thing that you will have to learn is how to track the state of your program. You will start with simple short pieces of code but it will get a lot larger and you will have to manage the states in your head using good coding techniques and all the stuff that you will taught in your CS courses.

You will learn a lot of different techniques and if you understand how to track the state of all these different things then it will be easier for you to really understand what is going on and also when you have to debug your code (which can be a nightmare). If you know what's going on with the state of each variable and the state of the overall runtime environment (for now just think inside your program), then it will make your job a breeze in comparison to if you did not.

Now comes flow-control.

With flow-control you will be no doubt introduced to procedural and quite possibly object-oriented paradigms like C or C++ if its OOP.

The flow-control is basically a way to say how data gets processed and how that gets done. For a procedural language its basically going to be from top to bottom inside some context.

A context is something like a loop or a function where once you've say called a function or you are inside a loop then you still go from top to bottom but its inside the loop or function until the loop ends or until you exit the function. Also with a loop if the condition isn't satisfied to end the loop you go back to the start of the loop and do the top to bottom thing again.

Again you will start off with simple examples and build them up to things that are more complicated developing your ability to organize everything in your head over time.

Flow-control and state have a very intertwined relationship: if you get a weird kind of error for a variable then knowing the flow-control will help you track the error down. For example you might be in a language like C++ and for some reason some hidden function gets called that doesn't do the right thing and you need to find this to fix your program.

Keeping these two things in mind will put everything in perspective when it comes to writing code of any sort, in any environment and on every platform. The state and flow-control might be different paradigms or include different things but the idea itself does not change.

I wish you all the best with your courses.
 
  • #4
zoiberg137 said:
But first, just thought Id ask and see if anyone has any suggestions on a book or website I might want to read first to determine if its something that would actually interest me. How much math is involved for introductory computer science? The intro course at my college uses a book called Big c++. If i get this book and read it on my own, would I be able to follow it and make sense of anything without being in a class?

The best book I have seen for teaching yourself C++, after having done C++ for over 12 years would have to be:

C++ Without Fear: A Beginner's Guide That Makes You Feel Smart

Its very good for beginners, and teaches all the right concepts in my opinion.
 
  • #5
zoiberg137 said:
If i get this book and read it on my own, would I be able to follow it and make sense of anything without being in a class?

If the class mostly deals with the syntax et al. of the langage, then feel free to use the book. Learning a programming language is something you can do by yourself, and I recommend doing just that.

On the other hand, one doesn't learn programming by reading a book. You have have to actually *read* and *write* code. If the class is very programming-heavy, if there are loads of examples and exercises where you have to write new code, then by all means, go to the class. Or work on a project. But at least do anything other than just reading a book about the language and understanding those minimal examples.
 

1. What is the relationship between computer science and physics?

Computer science and physics are both branches of science, but they have different focuses. Computer science deals with the study of computers and computational systems, while physics is the study of the natural world and its phenomena. However, there is a strong overlap between the two fields, as computers are used extensively in physics research and simulations, and concepts from physics, such as algorithms and data structures, are essential in computer science.

2. How does computer science contribute to the field of physics?

Computer science has greatly contributed to the field of physics in various ways. Computers are used to collect, analyze, and visualize data in physics experiments, making research more efficient. Computer simulations are also used to model complex physical systems, allowing scientists to study phenomena that are otherwise impossible to observe. Additionally, computer science has helped develop new algorithms and computational techniques that have advanced the field of physics.

3. Can computer science be used to solve problems in physics?

Yes, computer science can be used to solve problems in physics. As mentioned earlier, computer simulations are an essential tool in studying complex physical systems. By creating virtual models of these systems, scientists can run experiments and test hypotheses without the need for expensive equipment or risking harm to human subjects. Computer science also provides tools and techniques for analyzing and interpreting data, which is crucial in understanding and solving problems in physics.

4. Are there any specific areas of physics that heavily rely on computer science?

Yes, there are several areas of physics that heavily rely on computer science. One example is computational physics, which uses computer simulations to study physical systems and phenomena. Other areas include astrophysics, where computers are used to analyze large amounts of data from telescopes and satellites, and high energy physics, where computers help process and analyze data from particle accelerators.

5. What skills from computer science are useful for a career in physics?

There are several skills from computer science that are useful for a career in physics. These include programming languages such as Python and C++, data analysis and visualization, and knowledge of algorithms and data structures. Familiarity with software commonly used in physics research, such as MATLAB and Mathematica, can also be beneficial. Additionally, strong problem-solving and critical thinking skills, which are essential in computer science, are also valuable in the field of physics.

Similar threads

  • STEM Academic Advising
Replies
6
Views
1K
Replies
3
Views
109
Replies
2
Views
933
  • STEM Academic Advising
Replies
8
Views
1K
  • STEM Academic Advising
Replies
6
Views
1K
  • STEM Academic Advising
Replies
10
Views
1K
Replies
15
Views
2K
  • STEM Academic Advising
Replies
1
Views
441
  • STEM Academic Advising
Replies
23
Views
3K
  • STEM Academic Advising
Replies
6
Views
3K
Back
Top