|
To people out here who work as programmers & computer scientists : I don't have a degree in CS and I have taught myself to code using Java & Python. These are languages which have garbage collections & no explicit references to memory locations(i.e pointers). I chose these languages as I found it much easier to learn & implement algorithms. And because of this, when I attend software developer interviews, I am unable to answer questions about memory leaks, pointers, etc. Even companies which don't use C or C++ seem to enjoy asking these questions. Have I have handicapped myself by not learning C or C++ ? I see that for Udacity's CS101, Python is going to be used as the language. Shouldn't a basic programming course be taught using C so that people understand what is going on inside the machine? (and perhaps be able to answer interview questions in the future.) |
|
Which language should be taught in a first CS class is a non-trivial question. For what it's worth the first languages I learned (in order) were Basic. Fortran, Scheme, C, CLU, Pascal, C++. I think Python is a decent choice. I was going to elaborate, but think this link does it better than I would: http://mcsp.wartburg.edu/zelle/python/python-first.html I don't know if you have handicapped yourself by not learning C/C++, but I would recommend at least learning C. I think it has a major role in the evolution of programming languages and IMHO the K&R book is a model of concise exposition. It also almost defines the "worse is better" school (http://www.jwz.org/doc/worse-is-better.html ) and I think it is valuable to have a sense of both this and "the right thing" school as part of learning to make tradeoffs in software design. You might be interested in some of the discussions from when MIT switched from 6.001 in Scheme to 6.01 in Python (Google will find more if you like). Thanks for your explanation and the links. The Python as the first language article was enlightening.
I've tried to learn C, but I found myself spending most of my time with GDB without actually getting something to work and it literally scared me off. So looks like I just need to undergo the rigor & learn C. (And I hope Udacity/Coursera offer a Systems Programming course in the future).
You're welcome. I'm not surprised by your C experience. Like @NitNatNok said below that's a good reason not to use C/C++ in an intro class.
I learned C from K&R while working as an intern. That was a long time ago so I don't have good current tips other than getting a copy of K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language) and starting small. Perhaps someone else here can offer some better ideas for learning C.
1
If you are trying to learn C and you already know a higher-level language or two, I think it would be helpful to first learn something about computer architecture (how processors work and so on). That way it's easier to understand what pointers are, for example. C isn't sometimes called as a portable assembler for nothing...
2
Similar for me: I learned Basic, Pascal, C, Assembler, C++, Prolog, Java, PHP, JavaScript, Scheme, Python and maybe some other in approximately this order. The only ones that really seemed important were C, Lisp/Scheme and one of the 'simple object oriented' language, like Java or Python.
C helps you understand about the hardware, and especially all the mistakes you can make if you are close to it. Lisp/Scheme helps you understand programming languages in general (because you can pretty much demonstrate all possible programming paradigms in this language, as demonstrated in "How to Design Programs" or the old SICP lectures). You can also learn about pointers in Lisp, if you want, but it won't give you the awkward 'Buffer Overflow'-experience provided by C. The third language can be any implementation language you need for practical purposes (with plenty of libraries available), which is required by your job or you simply feel comfortable coding in. If you have a certain foundation it's easy to adapt to Python or Java or something.
|
|
I learned how to program using this excellent book : http://www.htdp.org/ . Also see http://en.wikipedia.org/wiki/How_to_Design_Programs Though this was not exactly related to you question , but I thought I should share this excellent resource. |
|
I don't think there is anything wrong with not having a degree and teaching yourself to program. However, there are many benefits with learning other paradigms in programming. Every language has its strengths and weaknesses. And learning the deep down internals of HOW computers operate (i.e. assembler) is very useful and makes you a better programmer. This topic makes me think of a paper/web page I read by Dr. Novig, "Teach Yourself Programming in Ten Years" (http://norvig.com/21-days.html). Learning to program isn't about syntax. Anyone can google the syntax. In fact, when you learn to code in many different languages, sometimes the syntax walks over each other as you switch from one to another. However, what syntax does not teach you are concepts. And some of those concepts are very important. Yes, having the language do garbage collection for you makes life nice and easy but there are many times where auto-GC can bite you in the ass. And not knowing why it's doing GC or when can hurt you too. Also, as you've noticed, many questions get asked of GC, pointers, memory leaks, and other topics. This isn't to make you necessarily look bad but instead are probably being asked so that the person understands your breadth of knowledge. This makes me think of a problem I had at work about 15 or so years ago when I worked for SGI. We had a customer who had an issue with some of their hardware when they upgraded to a newer system. Ultimately it turned out to be a timing issue at the hardware layer between the system and their 3rd party where it was our system's timing being off by mere miliseconds... but still being out of spec. This was only determined by looking at the output of a protocol analyzer. I only was able to detect this because I knew what the timing specification was and my mind had a glimmer of "what... that doesn't look right." But not knowing the underlying process, I'd never been able to solve the problem. Note that this customer had this issue for a good 6 months by the time engineering (us) had been asked to take a look. Mel I've read that article by Prof.Norvig. I now realize that knowing what's happening behind the scenes would help me write better code(computers are no more humans who compute as in the times of Turing. So I have to know how the 'machines' work in order to give them better instructions!). I've found this book "Computer Systems: A Programmer's Perspective by Randal E. Bryant" to be useful in my pursuit. Started reading it along with K&R C book. Just that doing it on my own seems like it'd take more time than learning it at school :(
|
|
A good system (and application) language with static/inference typing, garbage-collection, solid co-routine/channel like concurrency, easy and practical syntax, full compilation, near-or-equivalent C performance, many libraries and a large and supportive community is Google's new (2+ years) Go language (http://golang.org). There is excellent documentation, also a number of books and online-learning resources available (the go-tour from the home page). The language has been evolving as a new language does, but has reached a maturity level with a long-term stable "Go 1" release imminent. I believe we'll see many CS courses adopting Go along with Python as the system/dynamic languages of choice. I can certainly personally recommend it as a good and modern alternative to C, C++ and Java. I have adopted Go and Python for all my ML/AI work. Google cant create a language and just expect it to be popular. Language popularity is a fickle thing. I wont go anywhere near one of these new languages until it has made it into the top 30 on the TIOBE index. Go is currently #45.
There are lots of great, mind expanding, language that have not made the top 30 on TIOBE. Factor, Ocaml, Pure, Seed7, J and Logtalk come to mind.
but none of them are serious contenders for real world projects. If I started a work project in Seed7, I'd be fired, and rightly so.
Have a look at http://blog.golang.org/2011/12/building-stathat-with-go.html. (about http://www.stathat.com. Sometimes choosing (the right) new language may give you an edge that's hard to beat with the tried and tested. Yet to see how stathat does - it'll be interesting.
|
|
I think that the programming language is a secondary problem. I've learned how to write program using Pascal, I've learned Basic, Assembler, Fortran, C/C++, Scheme, Java, Visual Basic, Javascript, Lingo (macromedia director), C# and maybe someone else which I don't remember ;) I've also taken a look at http://mcsp.wartburg.edu/zelle/python/python-first.html and I don't like the idea of start with an easy language, I believe that people have to learn how to write "perfect" code from the beginning, even if it's hard, because if you code an algorithm in "correct" way, the language you use is irrelevant. I think that if you really want to learn something about programming the best way is following a book like the one suggest by @chota, the programming language doesn't matter. 1
What don't you like about Python?
Also, starting with Python isn't the same as writing imperfect code. I don't see where you've made that association. With Python you'll spend more time working on the details of your algorithm and less time struggling with the idiosyncrasies of the language.
@jholyhead My comment isn't against the choice of Python, I think that the language is almost irrelevant.
I disagree with the fact that Phyton is better than C (or Java or Pascal, etc...) as first language; the important think is how you program.
For educational purposes I prefer a "rigid" language, because that type of language forces the students to be rigorous.
Of Phyton I don't like the fact that "... is a dynamic, interpreted language. Source code does not declare the types of variables or parameters or methods" (from Google's Python Class - Introduction).
Obviously, I need to write some serious code before decide if I like it or no, probably I will use it like any other language.
|
|
If you already know how to program and are just looking at other languages to fill in concepts, I'd suggest you look at Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages by Bruce A. Tate. I was planning to go through it before I got sucked in to online classes by aiclass. In fact it might be a good basis for a class we run ourselves (AKA AIQUniverSity).
It's not going to make you an expert in any of them but it sounds like fun/another chance to fry your brain with overwork. http://www.amazon.com/Seven-Languages-Weeks-Programming-Programmers/dp/193435659X I'll second that!
It's a good book, but you need to be a good programmer to get through it.
1
This is the part where I say "Aw, shucks" and scrape my toe in the dust ;-)
Seriously, I think the barrier to entry will be a little lower for people who aren't already "good" programmers if a number of us do this together. Being in a "class" with a "schedule" will help keep us motivated to do the work.
I learned to program via the apprenticeship model. That is, I was taught by actual humans who made their living from writing software in a business setting. This isn't quit the same thing but believe me that it helps to have someone besides Google available when you have a question.
@robrambusch it would be nice to do, if there were not too many courses on the list already. Maybe in the summer, when official Universities/course providers will have a break :)
|
|
Learn a bunch of languages. As a professional programmer, I can tell you these are useful: Java C C++ (not the same as C!) bash Python/Ruby JavaScript/ActionScript/Lua Lua is particularly handy when used with C or C++. Also you should learn assembly, Lisp, and a functional language such as Haskell, even though you may never use them, they will affect you. Also learn JSON, XML, CSS, and other languages. |
|
I think you should learn langages that use different paradigms. Learn both staticly typed, dynamicly typed languages, the only untyped langage I know of is Assembely, and you should learn that too. Learn functional, and logic programming. I recomend the book Concepts, Techniques, and Models of Computer Programming |