![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| NIFTY! Mark Guzdial |
| Yes. Think about a program that can be helpful for a difficult task. Also, think about what can be easily done in JES. Angela Liang |
| Think about how your hard drive is organized. Do you have a list of everything on your drive in one place or is it separated into folders? Angela Liang |
| Yes, you have the basic idea. Spell it out a bit. How many files do you have on your disk? Imagine that they were all in one great big folder (like an array instead of a tree). What would you do to find a file? Now, think about your disk today, with multiple directories. What do you do to find a file? Why is one faster than the other? Mark Guzdial |
| Not just "modules" – check out the string methods. Mark Guzdial |
| Nice answer! Can anyone come up with a media-related example? Mark Guzdial |
| That's not what we meant. When would you create a picture in, say, Photoshop, vs. writing a program in JES to create a picture? Mark Guzdial |
| Good explanation of each - Jack DeBussey |
| No – makePicture is a function, reverse and find are methods. Mark Guzdial |
| Whoa! Lots of hiccups here: Modules are the JES library. There is no compiling of interpreters going on in here. What programs does JES run? I'm confused. Mark Guzdial |
| You're right. In Python, modules are very much like objects. Think of it as always being object.partOfTheObject Thus string.find("fred") is saying to call the method find (which is part of that object) on the string object. module.function() is another form of the same thing. As we'll see in a few weeks, we'll also have object.variable. Mark Guzdial |
| What's this notion of "built in"? Both methods and functions are "built in" the same way. "Modules" are "add ins," but modules can add both methods and functions. Mark Guzdial |
| Well (a) it's in the book, (b) it's in the slides, (c) I've explained it several times in class, and (d) there are several answers above, including some that I gave. I'd say that that's "any help." Basic idea: Functions are accessible anywhere – from Command Area, from Program Area, just by using their name. Methods are functions that are known only to certain kinds of objects. Their names only make sense to those objects, and you have to use dot notation to execute them. Mark Guzdial |