Looking for advice


#1

Hi all,
I was wondering where I should start if I wanted to learn computer science/programming. I am in my 40’s and have an occupation (not computer-related) but I am really intrigued to learn programming. Going back to school is not an option so how would one start? Books, videos? Any advice would be appreciated.

Thanks


#2

MIT OpenCourseWare: http://ocw.mit.edu/index.htm

Watch the lectures, do the assignments.

Stanford also has a similar thing on youtube.

Here’s a link to a list of other schools who offer the same:

http://degreedirectory.org/articles/25_Colleges_and_Universities_Ranked_by_Their_OpenCourseWare.html


#3

Joseph,
Thank you very much for the links. They are very helpful


#4

concerning the programming it may be a bit too much when you start with MIT’s material. it’d suggest to buy a good book about C/C++ or whatever you would like to start with. maybe even python would be a good start for you since you can achieve a lot of things very quickly

grs
Patrik


#5

Seconded.
Open CourseWare and similar initiatives are great, and well worth watching even if 90% of it will go over your head, but they are academical, presume a fair amount of reading around them, and decoupled from the university environment and the drive people already had before getting there, can be overwhelming.

Picking up a general line of interest that’s close to something you understand already (so plugins for your 3D software if you use one, or simple game dev if you have some experience with mods and so on), picking up a couple books and starting easy, would be a better way to ease in.

C++ di per se’ isn’t that bad as a beginner’s language actually, not with the kind of literature, examples and libraries out there today, but all that said, it will have a steep entry point learning curve while you figure out why the hell your hello world refuses to link or compile. Python or Java are probably easier introductions to OOP and modern programming, particularly the former, and can both easily take you to rewarding results.


#6

Thank you all for your replies. I picked up Python Programming for the Absolute Beginner, 3rd ed. So far it is very good and easy to understand and follow. I can already tell I will be very interested in GUI development.

Thanks again to all!!


#7

If GUI development is what gets you going, then after you get accustomed with Python a bit, your next step is definitely picking up Qt.
The extreme object orientation of its model can be a bit daunting in the beginning, but ultimately, it’s pretty much the best GUI kit around, and both the libraries and the Python bindings are free.

I always recommended to my students O’Reilly’s learning Python and got pretty good results with it (assuming you can find the one for 2.6 or 2.7, python 3k adoption might be premature now).


#8

Sorry for the newbie question but what is Qt? I believe you mean PyQt right? There is book I was checking out:
Rapid GUI Programming with Python and Qt
The Definitive Guide to PyQt Programming
by Mark Summerfield

The only thinkg is it came out in 2007. Will that make it a problem for someone using Python 3?

Thanks


#9

http://qt.nokia.com/qt-in-use/qt-in-visual-effects


#10

Qt is the set of libraries and all that provide cross platform GUI (and a number of other) services. Natively it’s C++ oriented.
PyQt is the set of bindings that allow you to use it with Python instead of C++.

Any particular reason you are using Python 3k? 3k is what you would probably call next gen, as in available but not the predominant version yet.
Books, adoption, libraries and a number of other things are still strongly 2.x focused.


#11

thanks for posting those links


#12

I just downloaded the latest version of Python which is 3. Other than that, there is no particular reason. Should I go and download 2? Would it be better to learn 2 and then jump to 3 when comfortable with Python? Are the versions that much different?

Thanks


#13

Python 3 (also known as py3k) is sort of a big change from the previous versions, it’s a generational hop.
Because of how widely it’s adopted and all, even with 3 in advanced beta and then released, 2.x kept being developed.

Currently we’re at 2.7, which is the last of the 2.x, but for that reason will be patched and maintained longer (than the usual couple years).

For learning purposes, I doubt you would really notice the differences, they are comparable in learning curve and all. Professionally speaking, 2.x will still be dominant for at least another two or three years, but if this is a hobby on the side for you, that’s also irrelevant.

The only argument I would make in favour of 2.x over 3k right now, is that the majority of the sites/examples on the net, most libraries, and most of the best literature, are still in the 2.4-2.6 range. If you’re finding what you want and what you need for 3k just fine, go ahead with it, nothing wrong.
If you’re unsure, to spare yourself some confusion, I would probably lean towards 2.x for at least this year.


#14

just to jump onto this thread, ive always wanted to learn c++, but everytime I sit down and read a few tutorials i get totally lossed. I have a good understanding of OOP in Python and RSL, but C++ just does my head in. Can anyone recommend a good learning path? I’ll mostly be using it for writting DSO’s and RiFilters for Renderman, vray shaders and plugins for maya (although im loving the python api).


#15

Raffaele - thanks for the info and taking the time to post. I have been working thru some exercises in the book I bought and one thing I noticed is that I am experimenting with the code and finding that I can omit/change some things in the code and still get the same result.

For instance: In the section using escape sequences with strings,

print(“can’t”)
>>>
can’t
>>>

and

print(“can’t”)
>>>
can’t
>>>

So is Python just forgiving or will I be in for trouble later if I don’t learn it to the letter?

Also, in the section Concatenating and repeating strings, there is this code:
print("
This string " + "may not " + “seem terr” + "ibly impressive. "
+ "But what " + “you don’t know” + " is that
" + “it’s one real”
+ “l” + “y” + " long string, created from the concatenation "
+ "of " + "twenty-two
" + “different strings, broken across "
+ “six lines.” + " Now are you” + " impressed? " + "Okay,
"
+ "this " + “one " + “long” + " string is now over!”)

Which prints:
This string may not seem terribly impressive. But what you don’t know is that
it’s one really long string, created from the concatenation of twenty-two
different strings, broken across six lines. Now are you impressed? Okay,
this one long string is now over!

But I can remove the \ at the end of each line and get the same result. Am I missing something?

Thanks


#16

Python is, in general, fairly forgiving.
I disagree with the learning path some books suggest, that seems to always be aimed towards instant gratification, but tend to put idiomatic and string tricks in too early, forsaking programming principles.

In the second case you mention, the \ in python means “interpret the next line as if it was indented the same of the one you started parsing from”.
In the case you mention having it or not having it makes no difference, because the interpreter already knows to keep concatenating until it meets your closing ), and it doesn’t need new line and tabs to identify scoping, therefore will ignore it and not error.

It would if you had it inside a scope determined by tabbing in (an if in example), and didn’t indent the following lines, in which case the backslash would instruct the interpreter to ignore that mistake (so that you can occasionally break the tabbing syntactical rule in favour of readability).

It’s something that doesn’t really have a place in that example, same as escaping an apostrophe that, within a string like that, will be read just fine, since you are enclosing the string within double quotation marks anyway.

In the first case, to understand the difference this is a better example:


   print 'doh\''
   print 'doh''
   

The first will run, because the interpreter finds the backslash, and knows to interpret the next character as a literal, and therefore doesn’t think it’s the end encolsure for the string.
The second line will error because unescaped, that apostrophe will be interpreted as the closure of your string, and te next one will be syntactically incorrect.

For the second example this would explain the situation better:


   if 1:
   	print "blah"
   print "zomg"
   else:
   	print "umpf"
   

Will error, because print being indented back takes the interpreter outside the if scope, and then an else is found without any pending if scope to merge it to.

If for some reason (highly articially in this case) you wanted to break Python’s formatting rules, you could write it like this:


   if 1:
   	print "blah";\
   print "zomg"
   else:
   	print "umpf"
   

In this case the ; at the end of the first print tells Python that that line is basically done, the backslash tells it that the next line, regardless of indentation, should be interpreted within the scope of the previous one (tabbed in once), which means the above, interpretation wise, reads like:


   if 1:
  	print "blah"
  	print "zomg"
   else:
  	print "umpf"

Edit: to detail the blurb about statement VS function call in print (something that changes from py 2.4 to 3k, and was backported for future compatibility in 2.5 and on)
The first example might have made sense with Python’s old print, which was a pseudo statement and didn’t require parenthesis to call, it will not error the way the author intended it to error if you removed the backslashes with parentheses though.
It would if you used


 print "blah" + " blah" +
 "blah"

whereas


 print "blah" + " blah" +\
 "blah"
 

will run fine.
This is only valid in pre py3k though, and when books are re-edited from 2.x for 3k instead of being rewritten, crap like that makes it in, and confuses the hell out of neophytes.

IMO, get py 2.7 and a pre 3k O’Reilly’s “learning python”. Best money you could spend on yourself if you’re enjoying python. It’s a book that doesn’t make the mistake of treating the reader as one of two categories chosen between “drooling idiot in need of condescension” and “proficient programmer that’s just picking another language up”, and caters to the middle ground of “normal to smart people who did some homework but aren’t pros already who want to learn programming and python at the same time”.


#17

If you’re familiar with object orientation, you’re a proficient programmer in other languages, then your barriers are purely language specific, and possibly with the hurdle of linking/compiling vs interpreted or JIT.

The only way out of that is doing it again and again, until you get over it.


#18

Ha, agreed! Someone tried to explain pointers to me back in '99, still don’t get them. Think I need to start a project and just nut it out.


#19

Raffaele- Thank you again for the great reply. What you said makes alot more sense. I am going to get that book and use py 2.7. BTW, do you mean the 4th edition of the book, or the 3rd?

Thanks,
Chris


#20

totally agree with raffaele

concerning nicks issues with getting started with c++:
there are so many books which are quite useful but i strongly suggest that look for someone to ask questions. i’ve read several books about c++ and mostly they have some parts which i assume very confusing for beginners. pointers for example are in fact a, in my opinion, very natural and easy to understand principle. most ressources however tell you some basics about pointers and then start to throw chinese source code at you to show how powerful pointers are. having a book is good to have some kind of learning path. then when you don’t understand something go and ask someone how understands it. if the first answer doesn’t clear things up just keep on asking (hoping that your instructor is a patient man :smiley: ). like this its just, as raffaele said, about self-discipline and keeping oneself motivated.

fortunately the programming skills needed for writing dsos and rifs are pretty low. don’t get me wrong, one can get as complex as he wants but basic rifs can be written with only a little language knowledge and thus are a good thing for excercising

good luck!

grs
Patrik