6 ms·
Was Python your first language? After using other languages, I too found the significant whitespace to be frustrating at first, but I wonder if someone for whom
by tjr 16y ago
Was Python your first language? After using other languages, I too found the significant whitespace to be frustrating at first, but I wonder if someone for whom Python was their first programming language would be similarly frustrated or not?
- kenjackson 16y agoIt wasn't my first language. And I should note that I wrote my last real Python program before most here probably started (1998) -- so things may be sufficiently different now so its less of an issue. But I do find Javascript/HTML to be so pleasant and easy for beginners that I find it hard to suggest anything else. Your "hello world" program is just: "Hello world" In an html file. ;-)
- baddox 16y agoPython was my second language, after Java. I found the whitespace "rules" (I can only think of one) a non-issue, since I always properly indented by Java code anyway. Python just took the indentation that was already there and used it as information. I'm always surprised to see even seasoned programmers attack Python for its whitespace being confusing. The only confusion or problem I can imagine encountering with Python is the spaces vs. tabs debate, and even that is only an issue if you're working with developers who disagree with you on the debate. In a job environment, hopefully there will be a style guide that's accepted and enforced by the developers. Of course, PEP 8 technically settles it for the Python community.
- kenjackson 16y agoAs someone who was experienced I did find it frustrating -- I can recall almost wanting to write a new editor because doing things like I used to (cutting and pasting loads of buffers and refactoring code) just didn't work very well. Again this is pre-1998, so I'm sure now this works just fine, but then it was just frustration. Or at least that's how I recall it.
- joshes 16y agoPython was my first language and the white space rules simply "made sense" for me at the time. In fact, using Python for a while at such an early stage started to ingrain a oneness with Python's unique syntactic idiosyncrasies. It seems somewhat second nature at this point.
- tjr 16y agoThanks for sharing! It makes sense that significant white space would only seem odd if the habit of insignificant white space had already been acquired.
- hsmyers 16y agoHaving in the long ago gotten used to Fortran on punch cards, Python wasn't that much of a reach and as it solves a particularly annoying problem (code formatting) I didn't have that much of a problem of getting on board with it. On other projects in other environments I typically run all code through a formatter and accomplish a similar goal. Regards first language? I really don't think it matters just so long as there is a second language to come...