I am conducting undergrad research in statistical mechanics.
I need to learn C/C++ in order to do so. what is the best way to learn C?
k&r
>>8345083
buy textbook
read it and do the exercises
>>8345108
This will be my first time programming.
I don't know what you want to do, but if it's pretty much anything that includes statistics, couldn't you just use R instead?
>>8345083
don't do:
>>8345109
If you can only learn programming from books, then programming is not for you.
do:
>Think of a project (like sokoban, or a simple text based game)
>do it (use google when in doubt)
A good programmer can join creativity with efficiency and logic. Books pretty much kill the first and second of these. Those are something you need to learn on your own
>>8345507
I feel like that's true after a certain amount of time, but setting up an environment for C/C++ can be hell if you don't know what you're doing, and just getting the syntax and nuances of the type system in both languages as well as memory management can make even starting impossible without a concrete reference
>>8345334
statistical mechanics has very little statistics.
same with "bose-einstein statistics"
in physics, x-statistics or statistical x means " you use one or two distributions in x"
>>8345108
Why is .cpp bad?
just use python
if you're doing undergrad research, you probably won't be doing serious calculations anyway, so use an easy scripting language
SICP is the only introductory programming book I've read that I've liked, everything else is bad.
>>8345083
just do it. Find some one else's code, get a compiler and debugger to work, then start fucking with the code. Make it draw giant dicks, write out naughty messages, whatever, just have fun fucking around with it.
If you can't even render a 1 kilometer long cock and balls in a 3d program, you aren't learning programming
c++ is easier to learn. I watch thenewboston on youtube. Bretty gud. Then i would read a book like c++ programming by malik
>>8346282
I spent 6 weeks just learning C++. It is a very difficult language to master, as it is almost completely user-dependable. I wouldn't consider it bad though.
>>8346111
It's true that I started on VBScript but I can imagine a similar progression for C/C++
just get CodeBlocks, you install it and it's ready to go, with all stuff setup... OR get virtualBox or a live version of Ubuntu and it has a cpp compiler built in, and you will also learn how to create makefile's like that.
Pretty much everything you need is to sit behind any working environment and start googling
"how do i get input from user C++"
"how do i print something on screen C++"
"how do i store user input C++"
and you do this until you finish some kind of a simple project.
>>8346282
It has nearly every possible feature that people thought might be a good idea to put in a programming language.
It is an okay language as C with classes but there are a million different features that you really never should use and that will very simply allow you to write code that no one ever will understand.
>>8346335
>c++ is easier to learn
You have no idea what you are talking about C++ is probably the most bloated there is.
If you really know C++ you can with ease program in C (and most other languages), because C is close to being a true subset of C++.
>>8345507
you're retarded. If you can't manage to read a book you're obviously a bad programmer