Did you guys self study or take a class?
Combination of classes, self study, and professional activity.
It was self study initially. My first exposure to any kind of programming was applescript on classic MacOS, which I followed with learning C from a book.
My professors threw a Mathematica notebook at me, and told me to come back in the morning and tell them what it did and where the error was. And forgot to tell me about the documentation.
G (Labview): self-study.
C and MATLAB in classes
C, various assembly, HDL, MATLAB in classes and through personal projects. I learned Python through self-study.
It gets easier after learning your first language.
Pascal at high school, C++ at University.
Oh I wasn't really counting assembly, but we did some of that in our microprocessors and microcontrollers module as well
I self studied some Pascal coding but I stopped, hence now I'm confined to the basis of it (using variables, doing simple calculations and giving variables an user given value)
Fortran, C++ and Java: Class
Matlab: School of hard knocks
I learned both C++ and Python through the books and undergraduate research project. I do not think the class is necessary for learning the programming languages.
please refer a literature that is easy and knowledgeable for learning c++
For more discussion of C++ books, do a search in the textbooks forum for "Stroustrup." Most threads about C++ books mention Stroustrup along with other books.
As for how I learned to program:
Fortran - one lecture class and one seminar-type class as an undergraduate more than 40 years ago, then 15 years experience in graduate school (experimental particle physics) and teaching.
Assembly languages for Digital Equipment PDP-5 and IBM 1620 "minicomputers" - self-taught from books and documentation, also as an undergraduate.
Pascal - self-taught from books about 30 years ago, so I could teach a couple of courses that used it.
C++ - self-taught from books about 20 years ago, so I could convert the Pascal courses to C++.
Perl - self-taught from books and the web, also beginning about 20 years ago, for Unix system-administration tasks and a collection of programs for moderating a Usenet newsgroup.
HTML - self-taught from books and the web about 20 years ago, later some CSS and recently a bit of PHP.
SQL - self-taught from books and the web, about 10 years ago, so I could migrate my music-collection database from a proprietary classic Mac OS database to MySQL before my classic Mac died.
The first language is always the hardest, because you're both learning how to program (how to translate a real-world problem into a solution in program code), and the details of a particular language. If you learn how to program well in that first language, the following languages are much easier because you can focus on the details of the languages (syntax etc.).
It was genetic for me! I just knew how to write programs starting with BASIC then FORTRAN and calculator programming... This was before there were formal classes for kids. We learned in Explorer Scouts at GE but I was taught some by my uncle when I was a wee lad.
I took a class on C++. This was my introduction to the world of programming.
My university also offered Mathematica workshops which had homework assignments making up part of your grade in a couple of upper division Analytical Mechanics classes.
I started learning Verilog HDL on my own, though this is because learning how to work an FGPA was a research assistant project for a Physics lab. It was the first time I actually used a library for Physics. Checked out a couple of books, used a lot of online resources, including StackExchange.
I also started learning Python on Codecademy... probably about 50% of the way through.
Other than these formal programming languages, I've had some "informal" experience playing around with game development programs like Game Maker, RPG Maker, and designing maps for Source Engine games (Left 4 Dead, Alien Swarm) .
Books and 20 years of tinkering around. I'm still not very good
IMO, if you're just starting out with programming, it's better to take a class. That way you will have someone looking at your work who can provide more valuable feedback than you can if you're self-studying. After you become competent with your first language you can pick up other languages on your own.
Here is some info about my experience.
PL/C, Fortran, Modula-2, C - class
Edit: Oh, and Basic in several flavors.
I started with BASIC, a long, long time ago. There were no computer science classes where and when I went in high school, there were no teachers who knew how to program. I taught myself.
I also taught myself some bad habits. I unlearned those with my first class in PL/C. (I further unlearned those bad habits by being an undergraduate TA for the intro computer class.) I learned MIXAL (Knuth's MIX assembly language) as a small part of another comp sci class. (The next step was to write a MIXAL emulator in PL/C. The last step was to use the emulator to write a compiler of a subset of PL/C in MIXAL.)
Since then, most of languages I've learned I have learned on my own, sometimes with a rare short seminar. That includes Fortran, Pascal, IBM360 assembly, 8086 assembly, APL, lisp, prolog, ART/CLIPS, C, smalltalk, HyperCard, Ada, Java, perl, awk, shell (many forms), matlab, Tcl/Tk, C++, mathematica, python, ruby, and a bunch of other languages/tools/libraries, many of which no longer exist. The only ones that involved short classes or seminars were Pascal, ART, and Ada.
I got a degree at a fancy university, but 95% of what I know I learned myself. The programming instruction didn't amount to much.
The language is important, but what really matters in big programs is planning and organization. They don't teach you that.
Separate names with a comma.