Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looks nice, but my first thought when I looked at the code example:

  1  >>> l = ['spam', 'ham', 314, 23]
was "wait, how are they assigning a list to the number 1? How is that possible? Oh... that's an l". (Not a fan of that. I'm half blind (figuratively) so these things confuse me.)


It's worse than that because the PEP 8 sytle guide specifically mentions to avoid using l as a name!

http://www.python.org/dev/peps/pep-0008/#names-to-avoid


Yeah, that example is a placeholder; we plan on replacing it with something awesome. Thanks!


Replace it with a try-python style interactive shell!


That would be fantastic, and pretty doable, I would think.


Even better if there was a little code like in the example already in there... (the best of both worlds)


Oh, that's what I meant, yes. Have the code as it is there, but the user can keep going.


+1 for an interactive shell.

Something like http://repl.it/languages/Python :)


Cool!

I got as far as:

  import os
  for filename in os.walk('/'):
    print(filename)
before realizing I should probably stop kicking stuff out of curiosity.

What are the dangers of dropping a python interpreter on a site, what are good guidelines to secure it?


+1 to this. I was drawn to Code Academy because I could immediately start playing around with code on the home page. (At least it used to be like that. Not sure anymore.)


This.


The problem is using Courier, not the example. Try 'Monaco, Consolas, mono'


Ah, that explains it, I was about to post "wow, this code snippet does a pretty poor job at convincing me to learn Python" :-)


I'd suggest improving the colour scheme of the code window, dark green on dark grey background is not very legible. Maybe steal some colors from the Sphinx doc colour scheme?


I'm sorry to say that using the same sentence to reply to different comments four times in a short period seems to have tripped YC's spam detectors.


Brilliant.


Yup, we'll change that. All of this content is dummy preview content at this point.


I made the very same observation when Jesse Noller first blogged about it (apparently as my very first HN comment[1]!).

[1] https://news.ycombinator.com/item?id=4842906


Yep, that was my first reaction as well. However, the idea of preview can be extended, codeacademy style. Make a small python interpreter in js, that people can try in, that gives them an interactive tutorial for python.


yup, that's a terrible example, not only because of the stupid variable name but poor example code choice. It's work in progress I assume.


Yeah, please use a slightly longer variable name.


I use customized font, so the number "1" looks exactly like the letter "l" here to see http://grab.by/kMFW


Why would you do that?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: