Open Side Menu Go to the Top
Register
edx: Free education available edx: Free education available

11-08-2012 , 03:24 PM
Quote:
Originally Posted by Shoe Lace
I'm liking C because I'm finding a lot of value in having a language that requires you to declare the data type up front. I'd rather have a compiler tell me I'm wrong right away rather than have it runnable but then get unexpected results later on in the program.

It's like the compiler is doing extra debugging for you for free and a compiler is certainly going to be better at figuring out what's wrong with a program vs a human.
I started working through the K&R book. I'm starting to be convinced that C is a decent language, though I do take issue with the idea that there are several different syntactic choices for every program. I have to withhold judgement until I see the larger picture with this issue.

I can post examples later on.

Python seems to always drop a peg with every new language I become familiar with. Python is still great for many cases and well worth learning.
edx: Free education available Quote
11-08-2012 , 06:03 PM
I think in the land of web apps Python will have more reach. There's not too many people coding "websites" in C but a million people are with Python.

I'm looking forward to going through K&R though. Probably going to start reading it in a week or so. I think a lot of the concepts learned will be applicable to any language that's a bit higher level than C.

I wish I was at the live 6.00x class to ask the professors what they thought about functional programming languages as a main stream web app choice vs a more OOP-style languages.
edx: Free education available Quote
11-08-2012 , 11:32 PM
OOP is going to take some getting used to. Haven't fully wrapped my mind around it yet.
edx: Free education available Quote
11-08-2012 , 11:46 PM
Quote:
Originally Posted by Shoe Lace
I think in the land of web apps Python will have more reach. There's not too many people coding "websites" in C but a million people are with Python.

I'm looking forward to going through K&R though. Probably going to start reading it in a week or so. I think a lot of the concepts learned will be applicable to any language that's a bit higher level than C.

I wish I was at the live 6.00x class to ask the professors what they thought about functional programming languages as a main stream web app choice vs a more OOP-style languages.
It would be hard for me to take them seriously since they aren't in full-on production mode. Not sure how they did the debugging class this time, but according the lectures, debuggers aren't useful and you should just use print statements.

If you watch the lectures from 2008 or 2007, Grisham takes several stabs at Python, even outright saying he hates the language. He taught SICP for several years, which is pretty anti-OOP. I would imagine his answer would be pro-FP and anything not Lisp would be bad.
edx: Free education available Quote
11-08-2012 , 11:48 PM
Quote:
Originally Posted by splashpot
OOP is going to take some getting used to. Haven't fully wrapped my mind around it yet.
When looking at OOP in Python, I can't help think that there has to be a better way. Then people dislike Java's OOP style, so that leaves what, Ruby?
edx: Free education available Quote
11-09-2012 , 08:00 AM
The only weird thing I've noticed with Python's OOP is that you have to pass in "self" all the time which seems strange to me. Other languages like Javascript don't require that, but you can still get access to "self" inside of the method (known as "this" in Javascript).

I guess Python is more explicit. JS probably does that under the hood for you?

Ruby yep, probably "Go" too as well as PHP. All of them have notions of class-like things AFAIK.
edx: Free education available Quote
11-09-2012 , 11:40 PM
Quote:
Originally Posted by Shoe Lace
The only weird thing I've noticed with Python's OOP is that you have to pass in "self" all the time which seems strange to me. Other languages like Javascript don't require that, but you can still get access to "self" inside of the method (known as "this" in Javascript).
Oddly enough, this is probably connected to the fact that Python doesn't technically have a name for "self"; that's just accepted convention. You can actually call that parameter anything you want. I don't know enough about language design to know the reason for any of this.

EDIT: Guido's explanation - http://neopythonic.blogspot.com/2008...s-to-stay.html

Last edited by Xhad; 11-10-2012 at 12:09 AM.
edx: Free education available Quote
11-10-2012 , 07:55 AM
Yeah, I just meant the notion of having to pass the instance as an argument in directly. Not the name of it specifically.
edx: Free education available Quote
11-10-2012 , 08:51 AM
Quote:
Originally Posted by Shoe Lace
I think in the land of web apps Python will have more reach. There's not too many people coding "websites" in C but a million people are with Python.

I'm looking forward to going through K&R though. Probably going to start reading it in a week or so. I think a lot of the concepts learned will be applicable to any language that's a bit higher level than C.

I wish I was at the live 6.00x class to ask the professors what they thought about functional programming languages as a main stream web app choice vs a more OOP-style languages.
Python is also pretty valuable for most scientists

Regarding OOP: I think Ruby does it pretty well. Would probably be my language of choice for teaching OOP right now.
edx: Free education available Quote
11-12-2012 , 02:49 PM
I just finished pset6 for 6.00x. I thought it was pretty tough and I feel like I cheated a little because I went to the comments and saw examples of other people having trouble.
edx: Free education available Quote
11-12-2012 , 05:56 PM
Quote:
Originally Posted by daveT
For the ex-poker players / unemployable, there is a computational investing course going on coursera right now. Pretty easy so far.
I'm just about finishing week 3 of this now. So far the class reminds me of something business major freshman would take as an easy A. I'll stick with it though because this seems like a good way to learn to use the popular python data analysis libraries.
edx: Free education available Quote
11-12-2012 , 06:09 PM
Quote:
Originally Posted by e i pi
I'm just about finishing week 3 of this now. So far the class reminds me of something business major freshman would take as an easy A. I'll stick with it though because this seems like a good way to learn to use the popular python data analysis libraries.
It feels like it won't be interesting until this "Part 2" he keeps referring to.
edx: Free education available Quote
11-12-2012 , 08:38 PM
I found it to be pretty tough too for week 6. I get the concepts like inheritance and how OOP works in general but applying it from written text into a specific spec is much easier said than done.
edx: Free education available Quote
11-13-2012 , 02:38 AM
I'm having trouble with the last bit of PS6. My code works just fine on my machine, but keeps generating errors in the grader
edx: Free education available Quote
11-13-2012 , 08:31 AM
Quote:
Originally Posted by blackize
I'm having trouble with the last bit of PS6. My code works just fine on my machine, but keeps generating errors in the grader
The error is probably that your function is returning None which is what they asked for but their grader is checking vs the actual trigger name.

So you have to return the trigger name instead of None.
edx: Free education available Quote
11-13-2012 , 08:37 AM
It would help immensely if the writing was a tad clearer and not... I don't know if it is straight-up wrong or if the writing was too confusing:

Quote:
WordTrigger should be a subclass of Trigger. It has one new method, isWordIn, which takes in one string argument text.

...


Because this is an abstract class, we will not be directly instantiating any WordTriggers. WordTrigger should inherit its evaluate method from Trigger.
This would lead one to believe the course didn't want a new evaluate() definition the WordTriggers class or any of the subclasses at all.

Am I missing something here?
edx: Free education available Quote
11-13-2012 , 08:39 AM
Quote:
Originally Posted by e i pi
I'm just about finishing week 3 of this now. So far the class reminds me of something business major freshman would take as an easy A. I'll stick with it though because this seems like a good way to learn to use the popular python data analysis libraries.
I totally agree with this. After watching the first 3 weeks, I could have written everything I learned on the palm of my hand. I think this class is more about the process of setting up a portfolio, not actually doing anything with it. The class gives a poor impression of the knowledge-level needed to profitably trade.
edx: Free education available Quote
11-13-2012 , 09:01 AM
dave,

I wouldn't feel bad about it. Most of the problem set is worded horribly and requires you to spend more time trying to decipher their lingo while attempting to learn new complex information.

I'm not sure I can explain this clearly enough because I don't think I know the material well enough but I'll try.

WordTrigger extends Trigger. Since it inherits (extends) from Trigger then it automatically gets access to everything that Trigger can do.

Trigger already has an evaluate() def which takes in a story (we'll ignore "self" for now). That directly translates to WordTrigger also having evaluate() which takes in a story.

Later on in the pset you'll be making a few classes that extend/inherit from WordTrigger. These will do "something" that requires you to override evaluate(). I can't really say more than that I think.

So yeah, WordTrigger will not have its own evaluate() but its child classes will because their evaluate() arguments will need to change depending on what trigger it is. That is why we override evaluate() for them.
edx: Free education available Quote
11-13-2012 , 09:12 AM
I only have to do the last two parts of the assignment. I eventually caught the issue with the evaluate() part, but yikes. They really should not have wrote that.

EDIT TO ADD: The reason why I decided to redo this class was to brush on on the OOP stuff as I don't feel like I gained a clear understanding of it the first time around. I'm rather pleased that 6 out of the 11 problem sets will be on OOP. By the time I'm done with this, I'll be pleased with the progress.

Last edited by daveT; 11-13-2012 at 09:25 AM.
edx: Free education available Quote
11-14-2012 , 02:18 PM
Did you guys listen to lecture 3 for cs50x?

They explained sorting and it made so much more sense compared to 6.00x. He spent so much time showing it visually away from code that it was much easier to "see". Really good IMO.

The sound example was kind of cool too. It really drove home how the algorithm speed changes based on what time difference there is between start and done.
edx: Free education available Quote
11-15-2012 , 12:00 AM
Yuck.. Procrastinated on PS6 and now I'm too tired to bother finishing the last question after 3 nights of 3-hours sleep. I know it's super obvious, but I'll have to let this one be @ 85%.

Project for tomorrow: I really want to look into that Trigger class. I honestly don't believe it needs to be in the code at all, unless you just want to gracefully handle and error?
edx: Free education available Quote
11-15-2012 , 02:14 PM
Quote:
Originally Posted by daveT
Yuck.. Procrastinated on PS6 and now I'm too tired to bother finishing the last question after 3 nights of 3-hours sleep. I know it's super obvious, but I'll have to let this one be @ 85%.

Project for tomorrow: I really want to look into that Trigger class. I honestly don't believe it needs to be in the code at all, unless you just want to gracefully handle and error?
I don't think it needs to be either but its purpose (I think) is like the student class from the lecture example.

It's there so you don't have to reference individual classes from other classes or get stuck having to check vs a ton of different sub classes. What happens if you want to add 15 more triggers? You wouldn't want some method in a class to be changed to reflect that. If the method using those triggers only needs to check for "is this a trigger?" then we avoid the issue and that's why Trigger exists.

I'm going through PSet7 now and a similar thing looks like it might happen. Our little robot buddy is an abstract class just like trigger. I assume later on in the pset we'll have to implement different kinds of robots.

Similar to the drunken farmer from the lecture. We had a few drunken famers but they were all drunks.

This pset is really cool if you happen to be taking cs50x too because both of them (6.00x week 7 vs. cs50x week 4) seem to be pretty similar so far. They are both so different if you read them isolated from one another but they share some similar requirements once you read both and start working on them.
edx: Free education available Quote
11-15-2012 , 04:59 PM
The grader is being very picky. For some reason it cares what order I initialize position and direction in the Robot class. You need to initialize direction first.
edx: Free education available Quote
11-15-2012 , 05:43 PM
Yeah that was ridiculous. I put position first because it came first in the order of it being written in the skeleton code. Had to read comments to actually fix that one.
edx: Free education available Quote
11-15-2012 , 06:03 PM
StandardRobot spec isn't clear enough either. Tip: don't use a while loop to check if moving the robot will keep it in the room.

Also, considering how tough as I found pset6 to be, I'm surprised how well I'm able to understand pset7. It's definitely cool and encouraging since building simulation models is one of the things I hope to do with my programming skills.
edx: Free education available Quote

      
m