Thonny: A hassle-free Python micro-IDE
thonny.org
thonny.org
The debugger and variable pane really help beginners figure out what's going as their program runs.
Not really. You don't have to use all its features, they are neither necessary nor intrusive. E.g. I hardly know, let alone use more than 10% of its functionality. The only reasons I use it are very smart code completion, refactoring (rename variable/class/function/whatever, jump to definition, find all usages), breakpoint debugger, auto imports suggestions, and type hints derivation. I barely even use menu items besides "reformat code". But the smart code completion IntelliJ IDEs offer is by far the best on the market so its worth that. Extremely useful for lazy/occasional/novice coders who don't remember APIs by heart and don't want to sopend much time browsing the docs every time.
Not right now, but I did.
> But as a teacher, you have a completely different problem: You need a really simple, easy to explain environment - no fuss, no unnecessary complexity.
Just tell them to ignore that complexity and only press this and this.
When I was a kid we were taught to code (simple games in C/WinAPI and C++/MFC) in Visual Studio 6 Enterprise Edition on Windows NT. Visual Studio (especially its enterprise editions) traditionally has tons of features which still seem extraterrestrial to me but you are safe to ignore them.
Just don't click those weird menu/toolbar items. Just create a project, write the code (with help of super-smart auto-completion) and press Run, use some conveniences (like refactoring and debugging) once you are told or read about those particular. Easy-peasy.
Vs.
“This does exactly what you want”
Of course, there are advantages to learning with the same tool you could also go on to use professionally.
VS projects in the IDE are one of the most convoluted development ways I've ever seen.
Students won't learn anything except developing Stockholm Syndrom for a bloated proprietary environment.
If it must be Windows, I'd rather teach cl.exe and Makefiles or adapted .vsproj files with msbuild.
Just go to the "File" menu, Click "New project" there, choose the type (a console app or a GUI app), enter the name and press Ok. The teacher shown us when I was a kid and nobody found this difficult. Of course, we never cared (until grown up and started to care about versioning) about the auxiliary files the IDE created to accompany the code in the project - understanding those never happened to be a necessity.
You have used 3 "just do this" kind of statements in this comment. I would not like to be in your class. Students should be encouraged to explore, and its a teacher's responsibility to create an environment where its fun and valuable and not frustrating. This is why newtonian mechanics is taught before quantum and quantum mechanics before quantum field theory. Once a person is familiar with one abstraction you drill down. I know all this is hard, but if it was easy everyone will just teach themselves. The whole point of having a teacher is someone who can setup a protective bubble around you when learning.
- type vi <filename> to start editing
- there are two modes: 'i' to start insert mode, <esc> to leave it for normal mode
- in insert mode, what you type is entered as you type
- in normal mode, use the cursor keys to move around
- in normal mode, type 'x' to delete the character under the cursor
- type :wq to save and quit
What are the odds a vim-virgin could complete a programming assignment without getting tripped up, despite the explicit directions to use just the features above?
I can hardly imagine that. They would hate me for wasting their time they could use to learn something practical. To me Vim seems a crazy alien technology of particularly questionable usefulness (even for a keyboard-centric user), only suitable for fun and for looking cool. Unlike PyCharm or Visual Studio, Vim doesn't just have unintuitive features available to whoever chooses to invoke those, it is and can only be operated in a completely unintuitive way, impossible to learn without instruction. And I never needed any instruction on how to use, let alone exit PyCharm.
I know tons of developers and system administrators that use vim on a daily basis (that includes me). While I agree that I would not necessarily recommend it for a beginning student, it is entirely unfair to describe it as having "particularly questionable usefulness", and "only suitable for fun and for looking cool". I and many others use vim for real work, not for "looking cool".
Yes, the learning curve is high, and it requires investing some time to learn. My experience is that the time I spent learning it was well worth the investment. It's not for everyone, but that doesn't mean that it not for anyone.
That's why I wrote "To me Vim seems...". Beyond the fact it's impossible to start using it right away without instruction, everything else is subjective and context-dependent.
> My experience is that the time I spent learning it was well worth the investment.
How? I tried. But I still can't see how its key shortctus are better than the common ones (i.e. how Esc,Shift+G (yes, I just googled it) is better than Ctrl+End) and how its power in applying bulk edits to many places at once can make me more productive (it would mean I write redundant code if it could). What other things does Vim have which other editors/ides don't? I also find coding without JetBrains-level smart code completion a waste of time.
How is this better than Ctrl+End for bottom, Ctrl+Home for the top, End for end of line? I believe these keys have actually been put on the keyboards right for this and that's why their names are self-descriptive.
> 5j to jump 5 lines
I can't imagine a case when this would be of serious value.
> w to jump word, b backwards etc.
Ctrl+arrows.
So, I still don't get it although I sincerely want to.
You can press 'dw' to delete the word right of the cursor. 'd/]' to delete everything from the cursor to the next closing bracket("delete and search next ]"). 'dip' to delete the whole paragraph around the cursor("delete in paragraph"). 'di{' to delete everything between the closest pair of curly brackets.
And this doesn't just apply to deletion but most other operations. Vim lets you just combine delete/copy/replace/... commands with inputs that move your cursor, whether it's just the current line or a whole 100-line table column. And of course you can tell it to repeat those operations by entering a number beforehand, or just repeat the last operation by pressing '.'.
Vim doesn't make you a 10x developer but it will make you think "oh man, was it really that cumbersome?" whenever you go back to a normal editor. Do you like always moving your hand to the mouse and back when you want to select text? Probably not. Vim makes that step completely unnecessary, among other things.
Don't get me wrong, it's not for everyone and that's fine. But if it fits your way of doing things it's a super efficient and flexible tool that is only limited by the user. I've been using it for over 5 years and still learn new, clever ways of doing things quicker.
And I can press Ctrl+Del to achieve the same. Right here in this commend edit form.
> delete everything from the cursor to the next closing bracket
This seems slightly interesting but not really. Many good text editors would highlight the matching bracket and it usually is just a tiny bit more slow to delete everything to that point.
> 'dip' to delete the whole paragraph around the cursor("delete in paragraph")
Hardly ever needed this in my entire life.
> And of course you can tell it to repeat those operations by entering a number beforehand, or just repeat the last operation by pressing '.'.
I know but can't imagine a use case for this.
I actually want to master Vim, let me be sincere, just to look more cool and professional, impress the boss and feel more of a hacker but that's not enough of motivation for me and I'm desperate to find anything in it which would actually feel handy.
That's fair. I was left with the impression that you did not think it could be useful to anyone.
>Beyond the fact it's impossible to start using it right away without instruction, everything else is subjective and context-dependent.
It is a very different interface. It does not work like other editors. Some people don't like mode-based editing, and thus they will definitely not like it.
> How? I tried.
This is a common experience for people attempting to learn Vim. Like I said, the learning curve is high. It takes a long time to become proficient. As to how it is worth the investment to me, I think most of the gains come from the fact that it is a keyboard-oriented editor. I can find the piece(s) of a file that I want to edit, and make changes quickly. As 'blackcats' pointed out elsewhere in this thread, vim lets you move around the file quickly.
> I also find coding without JetBrains-level smart code completion a waste of time.
I use the IdeaVim extension for vim-like keybindings in JetBrains IDEs. It's not perfect, but it implements a fair bit of the keybindings in vim. I understand the desire for code completion, it can be very handy.
I don't use much mouse when I code in Sublime or PyCharm.
> As 'blackcats' pointed out elsewhere in this thread, vim lets you move around the file quickly.
All the commands he/she mentioned have classic counterparts with Home/End/etc keys, available pretty much everywhere. I use them a lot even now, writing this comment.
Many of those keys require you to move your hands far from the home row (in ways that make it slower for me to type them). I find that the vim equivalents are easier to touch type. Plus many of the gains are not just in the motion, but in editing commands (as well as combinations of the two).
To each his own.
Meanwhile as a Vim user I am glad it doesn't try to be smart and "help" me by obstructing my view on the code with automatic popups listing suggestions I never asked for, formatting "corrections" while I type that make my sequence of inputs incorrect, and tab management that feels like a struggle without using the mouse. Meanwhile I once spent minutes trying to find a syntax error in intelliJ because while it did indicate with a red box that it found an error there was no indicator for its location...but I sure was glad it marked all warnings and apparently incorrect spelling in comments right beside the taskbar.
Vim respects my time and attention and has virtually no limitation when it comes to defining keyboard shortcuts. No, it doesn't have a bulk replace that's actually semantically aware, but it took me not more than a day to write a "close enough" replacement in Vimscript.
Or, to quote Jonathan Blow's excitement while using VS: "Is there a setting to fire the people who designed this UI?"
No, really! Sorry, but I've run hundreds of students through this course and that's my actual experience. I love PyCharm. It's a great tool. It's not what beginner programmers need to learn the fundamentals of programming.
IME Thonny is a great sketchpad for Micropython ideas, and makes work on that platform nearly as easy as locally-run Python code.
I'm a psychology major and working as a "student tutor", which in my case means helping lower year students work with R for statistical analysis. A lot of them are struggling, but for the ones that aren't and show further interest beyond R, I might recommend this IDE after looking into it more!
You can use the help function to see some information about things.
For example:
help(list)
Of course all of the help that you get that way is only useful if you already know the concepts you need and the names of things. It’s not like a tutorial or a guide or anything. But still, if you find yourself forgetting some detail about something it can be a way of finding the information you need.The main window on the first shot from the site is about 620px wide and I feel I could write some code not even resizing it. I easily imagine 2 buttons, dropdown and 2 textboxes filling this whole window instead.
Thonny just seems to do few things, but do them rather well.
Also, it depends what you mean by bloated, but VS Code can be stripped down to work just like the two I listed above. Language servers aren't required by any means. If you're looking for sub 50MB ram usage, then stick to the two above and search for "Sublime Text alternative" and I'm sure you'll find more equivalents than you ever wanted.
I prefer Atom.io over VSCode for simplicity. It's much closer to working the way I want out-of-the-box. There's so much junk I have to disable in VSCode to get it where I like.
Why is more tools a problem?
each individual program is its own module, fs to link them (files or pipe)
I'm serious, give it a spin, it's underrated.
I see it more as an good modular editor that they dressed up as an IDE cause that is what the people say they want.
It is so simple, approachable, and un-intimidating. There is really no learning curve. Just type something and click run.
The GUI is based on tkinter. It looks surprisingly good.
Of note, it is the default installed Python IDE on Raspberry Pi OS.
Thonny has everything included to start quickly no external plugins, installs needed.
The debugger and the shell work quite nicely.
Key bindings are a bit different (instead of Ctrl+/ you have to use Ctrl+3)
After a few weeks I migrate them to VS Code or PyCharm and later Jupyter .
Every semester a few students stay with Thonny and it does not hold them back from making great projects.
You can install packages with Thonny but it tends to conflict with Anaconda installation leading to https://xkcd.com/1987/ situation.
I suspect (but I'm not sure) that the rest of their desktop products are built on top of that.
But there are no open source plugins for Go or Rust in top of intellij. So for all intents and purposes the editor is not open source for those languages. As far as I know no one in the community has tried implementing an open source plugin to compete with the proprietary ones.
(And for anyone who wonders, no, I'm not paid and I don't use it - because of ergonomics - for me it is almost as painful to use as Macs are for me. I see inconsistencies and weird defaults everywhere since I'm a NetBeans / VSCode / Sublime Text kind of person. I just love Jetbrains business model.)
They're currently using Mu (https://codewith.mu/) which has similar goals (very streamlined IDE aimed at kids and beginners).
bpython is the friendly alternative to ipython.