7 ms·
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 numb
by msluyter 14y ago
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.)
- hanula 14y agoyup, 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.
- s-phi-nl 14y agoYeah, please use a slightly longer variable name.
- cas 14y agoIt'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 http://www.python.org/dev/peps/pep-0008/#names-to-avoid
- frankwiles 14y agoYup, we'll change that. All of this content is dummy preview content at this point.
- jacobian 14y agoYeah, that example is a placeholder; we plan on replacing it with something awesome. Thanks!
- reustle 14y agoReplace it with a try-python style interactive shell!
- StavrosK 14y agoThat would be fantastic, and pretty doable, I would think.
- daGrevis 14y agoThis.
- caioariede 14y ago+1 for an interactive shell. Something like http://repl.it/languages/Python http://repl.it/languages/Python :)
- brownbat 14y agoCool! 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?
- thebigkick 14y ago+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.)
- Symmetry 14y agoI'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.
- jacobian 14y agoBrilliant.
- mercurial 14y agoI'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?
- Mahn 14y agoAh, that explains it, I was about to post "wow, this code snippet does a pretty poor job at convincing me to learn Python" :-)
- jcampbell1 14y agoThe problem is using Courier, not the example. Try 'Monaco, Consolas, mono'
- shellehs 14y agoI use customized font, so the number "1" looks exactly like the letter "l" here to see http://grab.by/kMFW http://grab.by/kMFW
- jodrellblank 14y agoWhy would you do that?
- wrboyce 14y agoI 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 https://news.ycombinator.com/item?id=4842906
- abc_lisper 14y agoYep, 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.