This whole section is a disaster


#1

I've been programming in PHP and Java for a few years now and I've burnt through the course so far because all I have to learn is Python's syntax and get familiarised with the built-in functions.

This section has almost reduced me to tears - it's very poorly put together. The explanatory text is much too light given the solutions involve remembering barely explored built-ins (eg. .join() and .split(), as well as a lot of the type casting evidently necessary in Python), but that would be nowhere near as large an issue if you were able to debug your scripts properly; if you fail you can't even begin to debug your script, you're reliant purely on the compiler debug message popups.

It's utterly maddening and is completely putting me off finishing the course - I'm only muddling through to get to the later topics, and at present it's feeling like I'd learn a lot more, a lot faster, if I just forked a project off GitHub. If i was just starting out learning how to code this section would probably put me off programming entirely.

Either the hints and instructional text need dramatic improvement, or this section should be either skippable or just plain cut. And you should definitely be able to view the full output in the terminal frame in the event of an error.


#2

I am going to get a lot of hate for this, but here we go anyway.

This section actually pushes your programming to the next level, because you have to design the program and find the function you need. For this, you can check earlier exercises, python docs, notes if you made them. You can write pseudo code if you want

Is it difficult? Yes, absolutely. Is it frustrating? Yes, absolutely. Will you get stuck? Yep, but that is what the forum is for, to get help. Is it good to do this section again later? Yep.

The lightweight instructions is what makes it programming, with heavy instructions its coding. Coding != Programming. Coding is so much more, and so much more difficult.


#3

I can full well appreciate that's the intent, and it's a great aim, but in my opinion the execution falls completely flat.

Firstly - when would you ever code without debug output? The only reason I know roughly where my loops are breaking is because I can make sense of the compiler errors - for a total beginner who's only followed this tutorial that's a big ask. An enterprising beginner might try and print a variable to see its value, type, whatever. That's good - they're learning how to debug. Can't do that here - I've been copying my stuff into a .py file and running it in a terminal.

Second, it either needs better reference materials - there's a really well thought out (for the most part) glossary page, surely that should contain all built-ins a student should expect to use or, if you're not going to have comprehensive internal references, state at the start of the lesson block that people should look at external resources for help, and link them to the Python docs or SO.

i really agree with the idea behind the approach - it's a common one and usually works very well (see all of Eloquent Javascript), but like I said - I've been coding for about 3 years, I've done most CA courses over that time, and this has been annoying as sin. Maybe it's actually harder for me because I keep trying to use built-ins from other languages out of reflex, I've burned through most of the course so far without really paying attention, I'm very reliant on debugging when I have issues, and I've had a few beers. I can't imagine it'd be any easier for new/prospective coders though.


#4

Functions are new, at this point you worked with them.

You can perfectly add the function call the error message throws you, to get interpreter error, which you can google.

yes and no, programming is also a certain mindset and critical thinking. If you are already told what to do what and when, you will never get there

i hope you did something outside codecademy? To be honest, codecademy is beginner level, some content is intermediate, at best

I agree with some of your points, i have seen people struggle here big time. (myself included), but it helped me reach higher level

Some people are up for this challenges, others are not. Its tricky to get a balanced course which is challenging for the fast learners and slower learners (being a slower learner doesn't have to be a bad thing, you might be more curious for the underlying reasons) can keep pace.

You seem to be willing to learn, if there is anything i can help you with, let me know :slight_smile:


#5

I'm curious about your debugging argument. I'm not really sure what's the difference in moving your code from Codecademy to a terminal. I am able to print variables to see values, types, etc. via Codecademy when debugging. Or am I missing the point?


#6

I'm not. Not in this section anyway - all output is printed if the lesson is passed, but terminal just displays 'none' on a fail. You've now got me wondering if it's an issue with FF, I'll try using Chromium later on .


#7

i thought i covered this? if you add function call, you will get the interpreter error


#8

Sure, you get the interpretor error in a popup. That's it. No line numbers, no ability to print variables to the console to check what they are. You're asking beginner coders to write multiple nested loops with absolutely no ability to check what values are passed in to each and a severely limited ability to debug at what point they break. If the code is valid, yet incorrect, you don't even get an interpreter error, just a popup stating the returned valued was incorrect. This happened to me - turns out it was because I'd indented the return line incorrectly. I tried to debug the function by printing output at each stage of the loop to see which conditions were evaluated, but that doesn't work; hence why I ended up writing and running all my scripts locally first, because I can at least print output to see where I was going wrong. As things stand the quickest way to debug your code in this section is to rip bits of it out and see if the compiler message changes.


#9

interpreter error includes line numbers

this is possible? You can add print statements

The errors are the same as a normal python interpreter. Unless you special debug tools, there is not much difference to writing normal python code


#10

this is possible? You can add print statements

No you can't, at least not on the latest FF dev edition. Here's a broken solution to 'Scrabble Score', notice the three print commands:

def scrabble_score(word):
    word = word.lower()
    tot = 0
    for wordChar in word:
        print wordChar
        for scoreChar in score:
            print scoreChar
            if scoreChar == wordChar:
                tot += score[scoreChar]
        print tot
        return tot

Here's the console output when I run that:

None

The actual 'failure' message is kind of helpful:

Oops, try again. Your function fails on scrabble_score("pie"). It returns "3" when it should return "5".

But also not really, because I'm unable to print output to easily find out where that '3' comes from. It's not really a big issue in the example I posted, there's only one return statement, but if you've got multiple return statements nested in multiple loops it can get tedious fast. Yes, carefully reading the code line by line will show up your mistake, but it's often quicker trying to print out a few variables and see where stuff breaks, even with smaller blocks of code - we have debug tools and console outputs for a reason.

Let's make a change to that function and break it more by performing an invalid operation on a type, another common error in these exercises:

   tot += str(score[scoreChar])

The 'failure' message output:

Oops, try again. Does your scrabble_score function take exactly one argument (a string)? Your code threw a "unsupported operand type(s) for +=: 'int' and 'str'" error.

No line number to show at which point the compiler choked. And console output is still None.

Once again, not a huge issue here as there's only one typecast in use, but in a couple of the first exercises typecasting was necessary (eg. iterating through ineteger digits) on a few occasions and the easiest way to quickly check at which point of the function I was messing up was to pull out lines of code where I'd normally print some output.

Additionally, try and imagine what that error message (the only feedback they'll get) is going to look like to somebody who's sat down today and decided to do this course as their first ever introduction to programming:

Does your scrabble_score function take exactly one argument (a string)?

This section's actually irrelevant to them - the function does indeed take one string as an argument (although they have no way of checking that for themselves). So the first sentence is already seeding confusion. It's not even a standard compiler message, so I'm assuming it's been added as a hint.

Your code threw a "unsupported operand type(s) for +=: 'int' and 'str'" error.

I know what this means, you know what this means. Would you really expect someone who's been programming for maybe around 5 hours at this point to know what that means? That's a big ask... Sure, it's (mostly) a standard compiler error (except for the lack of line numbers, which I do get running the script locally, and the first sentence), but throwing compiler errors, and only compiler errors, at newbies without any introduction or explanation is, in my opinion, not the best approach.

I've occasionally run into problems with CA courses and Firefox however, and as that's now two people saying console output should work I'll see if it behaves any differently in Chromium.

Edit: No console output in Chromium either, although you do get better indent markers in the script window.


#11

That is strange! Usually if there are errors like broken loops, after None output in console, there should be messages in dark red (maybe hard to see?) That gives you a line number and error. Something like this:


Sorry for the mess. I ran it on my mobile phone using Chrome browser and this is what pops up.


#12

Nope - those errors won't show for me in this section. Syntax errors will show up, but only syntax errors. They may have been more comprehensive in previous sections - I certainly noticed them more, but I was making a lot more syntax errors by reflexively burping out JS before I acclimatised.

Here's what I'm getting in both Firefox DE and Chromium (latest Ubuntu builds of both, clean installs with no addons):

Compared with the substantially more comprehensive output I can get running the script locally:

...
t
w
Traceback (most recent call last):
  File "./test.py", line 23, in <module>
    scrabble_score('word')
  File "./test.py", line 18, in scrabble_score
    print int('foo')
ValueError: invalid literal for int() with base 10: 'foo'

#13

Okay, I've figured out where the problem lies.

Because CA automatically invokes the named functions I've not been adding the line to invoke them in my code on CA (and not purely out of laziness, I've been actively cutting them out when pasting from my local script because for some reason I assumed the script wouldn't work if I added them). This means that if the function is coded correctly you'll pass the exercise, but if you fail you won't get any console output and the popup only displays the last error .

Explicitly adding the function invocation (which I should have been doing) makes the console output messages as expected.

Not knowing how CA works I don't know if it's possible to make it so that the student has to code in the invocation, but it would have saved my dumb, lazy backside a lot of frustration if it had been forced on me.

Furthermore, I retract my 'disaster' comment - I was doing it wrong.


#14

this is what i mean with calling the function.... Sorry i wasn't clear, but with your experience, i assumed you know what function call means


#15

I do know what it means, but I've only just realised that's what you meant by that sentence. I'm afraid that you initially writing this:

confused me as to your meaning, I'm afraid I didn't find it particularly clear.


#16

Feel free to ask for clarification instead of ignoring it because it isn't clear. Could save time :slight_smile: Also, it can help us improve in assisting others with better/clearer solutions. We're all learners here.

Glad you got that solved though!


#17

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.