The debugger and variable pane really help beginners figure out what's going as their program runs.
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.
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.
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.
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.
- 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.
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?"
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.
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.