9 ms·
Learn Python The Hard Way: Warnings For Beginners
- dllthomas 14y agoI strongly disagree, regarding the text editor. You'll make mistakes and want to fix them, want to copy things, etc, and this is much easier in a decent text editor. Learn to use vim or emacs or something of similar power before you get started programming - it's worthwhile. Running through vimtutor is not hard (I don't know of a similar thing for emacs, but it probably exists), and it can speed you up wherever else you're working with text, as well.
- anthonyb 14y agoYou're missing the point - if a new programmer has to learn vim or emacs first, chances are they just won't learn to program. What's next? Grow a neckbeard? It's all about reducing the number of hoops that they have to jump through to get results. Once you get up to speed, sure, learn a decent editor. But in the meantime, use gedit - it's reasonably good (eg. has auto indent and syntax highlighting), free and available for pretty much everything. Or sign up for something like pythonanywhere.com.
- saraid216 14y ago> Running through vimtutor is not hard But it is time you're doing something other than producing tangible output. That can cost you a student. Vimtutor can be done after you've learned to code a little.
- jiggy2011 14y agoVim is very keyboard centric though which will be extremely frustrating at first to people who are used to using the mouse to interact with the interface and the keyboard for just typing text. With a normal text editor , copying and pasting is not especially difficult, especially with the small codebases that beginners will be working on.
- dllthomas 14y agogvim handles mouse input just fine (though I had to actually open gvim to double check that - my mouse doesn't get touched very often...) With a featureless text editor, you can copy and paste for sure, but making edits to the pasted text is much more tedious.
- Tyr42 14y agoBut it's not when all you are doing is clicking, using arrow keys and backspace, which is what people starting out do. I like vim and all, but you want to learn python now, vim later. Don't mix the two, all it does is add complexity before you need too.
- jiggy2011 14y agoWith gvim for example though you still have to worry about being in insert mode, and normal shortcuts like Ctrl+S don't work. I'm sure you can configure around this, but it's not something a newbie should be worrying about.
- dllthomas 14y agoMy point is that knowing a decently powerful editor is a matter of basic computer literacy - it makes a host of things, especially but not only programming, faster and easier. Knowing vim or emacs or pick your editor that actually gives you some reasonable power is not something a newbie should be worrying about when they are learning programming, it's something they should be taught before they get programming. It's a matter of a few hours to train yourself on some tools that will make your life much easier.
- jiggy2011 14y agoI'm not sure that using an editor like vim is really "basic computer literacy". It may be simple enough to learn vi but you have to get your muscle memory used to doing a bunch of things that are different to the average MS software or whatever they were used to using. I actually know a number of competent programmers who've never touched vi at all.
- Fizzadar 14y agoI can't understand why learning vim/emacs is in any way useful for a programmer. Surly the best text editor is the easiest to use (ie one which makes use of a keyboard + mouse)? Vim is certainly powerful (and unnecessarily complicated), but when it comes to writing out code anything will do (Sublime in my case).
- anthonyb 14y agoVim is good once you get the hang of it, for the same reason that Ctrl-P is so good in Sublime.
- dllthomas 14y agoWhy is Ctrl-P so good in Sublime? (Asking this honestly, as someone who's not used Sublime...)
- anthonyb 14y agoIt's basically a "find any file really quickly" command, with fuzzy matching. Hit ctrl+P, type the filename (or part of the name) and it'll flash up the files that it's matching in real time, as well as display the most likely in the background. The good part is that it'll ignore capitalisation, underscores, etc. and you can start typing something in the middle - "foo" will pick up Foo, foo, test_foo, widgetFoo, foobar and FooBar.
- saraid216 14y agoI learned Vim because I didn't always have a mouse. At some point, I started to dislike using a mouse at all; a roommate in college joked that if he glued my mouse to a mousepad, I wouldn't even notice. (And this is true; a year later, my mouse died and I was able to do virtually everything I felt like without it.)
- dllthomas 14y agoYears back, my lab changed buildings, and I had to break down my computer and reassemble it on the other side. I went over a week of productive work before noticing I hadn't plugged the mouse in. There are some things the mouse is very good at - picking from a visual display, describing relative motion. The mouse is only useful in programming to the degree that these things can be made relevant. I have every expectation that this fits some people better than others, but I do think that people frequently overestimate ease of use with the mouse and underestimate ease of use without.
- pnathan 14y agoIn emacs, its M-x help-with-tutorial. But, realistically, there are low-barrier editors for learning programming; no sense in complicating the initial problem.
- dllthomas 14y agoI contend that they are two separate problems. It's worth knowing the a reasonable editor anyway, and then that makes the programming easier (particularly with syntax highlighting and such).
- Silhouette 14y agoIn emacs, its M-x help-with-tutorial. I realise that you weren't actually advocating showing this to a beginner programmer, but I can't help noticing the irony that the above would be meaningless to a newbie learning emacs for the first time. Indeed, exactly that kind of WTF moment can stop a fledgling programmer in their tracks, even though it has nothing to do with programming. As you say, there is no sense in complicating the problem. If someone wants to learn Python, and they're working through beginner exercises, a REPL or at most a simple plain text editor will do just fine.
- tikhonj 14y agoThis is why the first thing you see when opening Emacs (after the GNU/Emacs logo) is a list of links headed with the Tutorial. Coincidentally, I thought the tutorial was very well done. It certainly helped me get up to speed fairly quickly without being overbearing.
- DeepDuh 14y agoWhat I'd like to see are some hard scientific studies on whether vim, emacs or something like eclipse with pydev are more productive for python. I have a strong feeling that people who emphasize on the editor so much are missing the point: programming is not about the editor. It's about your inner design process.
- gbog 14y agoI always wonder why in python context the three enemy brother OS should be presented in Mac, Windows, Linux order. If based on usage it should be W M L, if based "close minded ness " it should be L W M, and no other criterion I can think of would result in M W L.
- lclarkmichalek 14y agoWhat do you mean by "close minded ness"? Anyway, I think ease of use for many people would be ranked M W L (cue pointless discussion based on anecdotal evidence on all sides). But I think really, you're missing the larger point; this does not matter in the slightest. The order in which operating systems are talked about is _not_ significant.
- gbog 14y agoWhat I have learnt reading good books is that every thing matters.
- heretohelp 14y agoI'm a dedicated and long-time Emacs user but he's right. Not everybody that learns Python is looking to become a professional programmer, just leave them the fuck alone and let them learn to code in their own way.
- artursapek 14y agoIt's not about learning "in their own way," it's just about baby steps. Programmers tend to get enthusiastic and start giving enthusiastic advice, like "use Emacs!" I learned Javascript in shitty Aptana Studio and (thanks to Zed) Python in gedit. Now I use Vim for everything.
- d0mine 14y agoI don't see how gedit is simpler than emacs for a complete beginner: open an editor, start typing (letters, arrows, delete produce the same result), press "save" button (I think emacs shows toolbar by default). emacs gives you the power to do much more but it doesn't force you to use it. To be fair making emacs a complete Python IDE that has the same features as Eclipse for Java has a steep learning curve and it is not trivial. But for the book you don't need it (some don't need it even for professional work with Python provided that there are other useful features in emacs).
- mvanveen 14y agoDid you even read the link? I'm sorry, but I can't imagine a worse time to invoke the editor wars. Shame on you. Look, I love my editor just as much as the next guy. I have tremendous respect for emacs, and you can take vim from my cold, dead hands (and no, I will not start those wars now, either). But a beginner has far too much trouble just getting shit fucking installed and working consistently. Case in point: the reason why a menagerie of tools and scripts for setting up programming environments make the front page of HN every week is because it's a total schlep to try and get your environment set up. And this is an audience of experts. That 30 second fabric deploy script is literally the most convenient that process will be for anyone, ever. A beginner might have a hard enough of a time touch typing. I think Zed's entire point is to dissuade beginners to listen to people who are proselytizing as you are now. Let the beginner find emacs when they're ready. Trying to move them into that habit up front might be beyond the opportunity cost of programming for that individual. And then a community which is attacked left and right by ignorant people in power trying to legislate it away will have have lost an ally do to pithy zealotry. Any amount of editor or environment advocacy on your part is really just injuring the signal to noise ratio.
- lmkg 14y agoIf someone wants to learn Python, teach them Python. Don't teach them 'nix, gnu, bash, vimacs, git, and oh yeah Python. The big draw of programming is that you can take a computer and make it do something. Shorten the path to doing something as much as possible; anything that lengthens it is premature optimization. They'll learn the value of those tools easily soon enough. Before someone has actually written code, all of those things are barriers, not tools, and the only reason to use them is cargo-cult-ism. Once they've written a few lines, they'll start to appreciate the value on their own.
- krisoft 14y agoAt my former workplace we hold regular programing workshops for absolute beginners, mostly for groups of art students, using Processing. Surprisingly the first and biggest pitfall what our students had to jump was always the question: How can I type { ? So after a few occasions, we get the habit of starting with an introduction to the whereabouts of funky characters. I can see how fast could things turn unmanageably hard when a novice try to tame the keyboard, an unfamiliar text editor, the command line, and a programing language at the same time. I think that should be the reason why all the programing systems, which are intended for non-professionals, and I know of have a tightly coupled ide. (Arduino, Logo, NodeBox, Fluxus, and the aforementioned Processing) Did I forget something out? Do anyone know any popular, or less known exception?
- davecap1 14y agoI started working through this book with my girlfriend who wants to learn Python... it turns out most people don't know/understand what a terminal or shell is. This should have been obvious to me, but it wasn't :) Any suggestions on how to explain what the terminal is and why it is necessary? I feel like there has to be a "pre-learn python" book that explains the basics of how computers work. This probably already exists though... anybody know?
- jiggy2011 14y agoJust explain it is a good way to use the computer with just text and a keyboard and it's useful because you don't have to write all the code that deals with graphics (also text is easier to test). Having said that , I think there is some merit in showing somebody how to make their programs output to either a local GUI or to the web relatively quickly since they are more likely to perceive that as a "proper" application.
- aidenn0 14y ago1) The terminal is a conversation; you tell the computer to do something and it answers you (a lot of the time telling you it doesn't understand you). 2) When you want to do something very specific the terminal can be much more efficient, as well as easy to explain. example "copy c:\foo.doc c:\bar.doc" versus (e.g.): 1) Navigate explorer to c:\ 2) Find the file named "foo" with the MS Word icon and click and drag it, staying in the same window 3) Click on "Copy of foo" 4) Press F2 5) Type in "bar" The shell way is both faster and easier to communicate to someone else (as long as they know how to open a terminal).
- deleted 14y ago[deleted]
- d3cay 14y agoI started learning python a little while ago-there are so many options-mostly been using trial and error to figure out the best approach-from experience what you said TOTALLY makes sense--thanks p.s talking to other people who are also at the moment trying to learn python seems it would help-but I haven't been able to find any good discussion group/sites/forums/etc like that. Doea anyone know any good ones to do that?