PDA

View Full Version : Looking for advice


Pesto
01-29-2011, 05:06 AM
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

gawl126
01-29-2011, 04:11 PM
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

Pesto
01-29-2011, 08:06 PM
Joseph,
Thank you very much for the links. They are very helpful

Gravedigger
01-30-2011, 04:10 PM
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

ThE_JacO
01-31-2011, 01:50 AM
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
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.

Pesto
01-31-2011, 03:35 AM
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!!

ThE_JacO
01-31-2011, 03:49 AM
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).

Pesto
01-31-2011, 06:32 PM
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

gawl126
01-31-2011, 08:32 PM
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

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

ThE_JacO
01-31-2011, 08:57 PM
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
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.

DuttyFoot
01-31-2011, 11:14 PM
thanks for posting those links

Pesto
02-01-2011, 12:27 AM
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

ThE_JacO
02-01-2011, 02:02 AM
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.

ndeboar
02-01-2011, 03:14 AM
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).

Pesto
02-01-2011, 03:48 AM
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("\nThis string " + "may not " + "seem terr" + "ibly impressive. " \
+ "But what " + "you don't know" + " is that\n" + "it's one real" \
+ "l" + "y" + " long string, created from the concatenation " \
+ "of " + "twenty-two\n" + "different strings, broken across " \
+ "six lines." + " Now are you" + " impressed? " + "Okay,\n" \
+ "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

ThE_JacO
02-01-2011, 04:35 AM
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".

ThE_JacO
02-01-2011, 04:41 AM
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).
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.

ndeboar
02-01-2011, 05:45 AM
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.

Pesto
02-01-2011, 07:27 AM
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

Gravedigger
02-01-2011, 03:55 PM
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 :D ). 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

ThE_JacO
02-01-2011, 10:49 PM
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
I believe the latest edition is for py3k, the previous one is probably going to be for 2.6 (it should say in the top right corner of the cover). Go for 2.x.
Even a couple editions ago (2.4) it would still be good, as most of the changes between 2.4 and on are probably not something that would crop up or appreciated when you're starting anyway.

Pesto
02-01-2011, 11:19 PM
Thanks again for all the help. It is much appreciated!

GunO
02-12-2011, 04:42 AM
Thanks again for all the help. It is much appreciated!

I hope your doing well with your Python book. There is another helpful thing that could be useful to you. Video tutorials. Now they are different between sites but I found this one quite helpful:

http://www.thenewboston.com/?cat=40&pOpen=tutorial

Each video is short and teaches one thing at a time, brilliant for beginners. You can take a look at it and maybe it'll be a helpful perspective on what you are picking up from the book.

Carina
02-21-2011, 12:47 PM
In addition to Raffaele's excellent points above...

For what it's worth, the key, in my opinion, to learning C++ is understanding WHY you want to learn C++. If you try to use C++ to write a program you could just as well write in Python - it's going to seem clunky. If however, you have chosen to learn C++ is because you need to - for example because you want to be able to handle memory more efficiently, or if you could do with providing more low level optimisation than is offered by the language you're currently using - it will straight away give you a motivation and a route to understanding what it's all about.

For example, say you've decided to learn C++ because you need to make better use of memory. The reason you might take a C++ approach to this is because unlike "managed" languages allows the programmer to control where memory is allocated and deallocated. However, as a programmer if you do allocate memory "manually" rather than relying on your runtime to handle it, you need to keep track of it - this is where pointers come into the picture.

Pointers are inherently a simple concept - a pointer is nothing more than a very basic variable that simply holds (or "points to") a memory location. The major problem I find with my students (I teach C++ for Games Programming) is that they try to use pointer syntax without actually considering what's the reason for using pointers is in the first place. If you have a C++ book, I'd recommend looking at the chapters on pointers and dynamic memory allocation and make sure you READ the rationale rather than simply doing the exercises. Most of my students seem to find once they understand the reasoning for using pointers all of a sudden it all starts clicking into place.

CGTalk Moderation
02-21-2011, 12:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.