News for hackers. Stuff that matters.
Re:Things I've learned building a modern TUI framework by zasdffaa on Wednesday August 03, 2022 @01:07PM (#32334320)
Powerful? you mean it can do more than is actually possible to do with a mouse?
Re:Things I've learned building a modern TUI framework by agentwiggles on Wednesday August 03, 2022 @01:13PM (#32334384)
Power is the amount of work done over a period of time, so even if you can do the same exact set of things with a mouse and keyboard, if the keyboard is faster at doing them, it's more powerful.

You can do all your text entry by clicking keys on an on-screen keyboard if you like, but saying that a physical keyboard is a more "powerful" way to enter text seems reasonable to me.

(sorry in advance, I know this is needlessly "well ackchually" lol)

Re:Things I've learned building a modern TUI framework by zasdffaa on Wednesday August 03, 2022 @01:21PM (#32334486)
> but saying that a physical keyboard is a more "powerful" way to enter text seems reasonable to me

No. It's faster and that's all. So call it by that word which is very precise.

If you say 'power' = 'speed' then you've destroyed the meaning of one of those words, just for the modern habit of co-opting a fancier word for a simpler one. I'd prefer people didn't do that, and differentiated 'speed' from a thing you call power which indicates "I can't do that at all, at any speed".

If you don't like bullshit marketing and PR, don't follow it.

Re:Things I've learned building a modern TUI framework by Sparkle-san on Wednesday August 03, 2022 @02:50PM (#32335421)
If we go by the physics definition power is work over time, so the same work over a shorter time is by definition more powerful. I don't think applying that term to software is inherently wrong.
Re:Things I've learned building a modern TUI framework by bob29 on Thursday August 04, 2022 @12:00AM (#32339214)
by the physics definition work is kilograms * meter^2 / sec^2 what computer users do on a computer is not work in the physics sense, maybe in the economic sense
Re:Things I've learned building a modern TUI framework by agentwiggles on Wednesday August 03, 2022 @07:05PM (#32337514)
I didn't say "power = speed", I said power is work over time, which is the actual definition and supports the rest of my post. You're the one redefining "power".

Again, I fully acknowledge this is nitpicky to the point of absurdity and we're arguing semantics. But if we're gonna argue semantics, then the definitional meaning of power is on my side.

Re:Things I've learned building a modern TUI framework by clucas on Wednesday August 03, 2022 @01:38PM (#32334686)
Interesting, so do you avoid describing one programming language as being "more powerful" than another? They're all Turing complete, after all... it's just a question of how fast you can develop in one, right?
Re:Things I've learned building a modern TUI framework by zasdffaa on Wednesday August 03, 2022 @01:56PM (#32334910)
Good question, 'power' I reserve for turing completeness (some aren't, such as SQL before recursive CTEs were added, and... well, here's a list https://iq.opengenus.org/non-turing-complete-programming-lan...)

For "how much crap do I have to write to get it to do something", I call that expressivity. Scala is more expressive than fractran (I guess...).

Re:Things I've learned building a modern TUI framework by clucas on Wednesday August 03, 2022 @02:11PM (#32335072)
Sounds like you are consistent with your usage of terms, and I understand the logic and the motivation.

I would just caution that it's fairly idiosyncratic - plenty of people out there don't use the word "power" the way you do. For example, here is how Paul Graham talks about the "power" of programming languages: http://www.paulgraham.com/avg.html

Just saying, as consistent as your definitions are internally, being too rigid about it may hinder your ability to communicate with others in the field. Good luck buddy <3

Re:Things I've learned building a modern TUI framework by zasdffaa on Wednesday August 03, 2022 @02:25PM (#32335202)
Thoughtful reply and it is much appreciated dude, take care!
Re:Things I've learned building a modern TUI framework by robertlagrant on Wednesday August 03, 2022 @02:56PM (#32335492)
What's the case for power equals Turing completeness over power equals speed of development?
Re:Things I've learned building a modern TUI framework by jjav on Wednesday August 03, 2022 @10:05PM (#32338543)
> No. It's faster and that's all. So call it by that word which is very precise.

Definition of "power" is work done over some unit of time, so OP was using it precisely.

Re:Things I've learned building a modern TUI framework by samatman on Wednesday August 03, 2022 @09:05PM (#32338241)
Yes.

With a mouse I can select text between brackets and delete it, with vim I can tell the editor to do that.

Well, what's the difference?

The difference is the editor won't accidentally delete one of the brackets ever. That's not possible with the mouse. That's possible with the keyboard.

Re:Things I've learned building a modern TUI framework by zasdffaa on Thursday August 04, 2022 @02:19AM (#32339765)
You've never hit the wrong key on a keyboard and made a mess, ever? I have.
Re:Things I've learned building a modern TUI framework by samatman on Thursday August 04, 2022 @04:46AM (#32340659)
If I mess up I literally hit u before consciously realizing it. I'm not ready to swear I've never mistyped `dib` but it doesn't happen often. Let's say `d8b` for the sake of argument: okay, `d8budib` is a longer way of saying it.

Mouse doesn't have an undo button.

I use the mouse a lot actually, no rodent allergy here. It's not as powerful a tool, it's just not, but it's versatile and literal, the multitool of the UX: I can always click my way to the state I need if all else fails.

Re:Things I've learned building a modern TUI framework by badsectoracula on Thursday August 04, 2022 @05:26AM (#32340877)
> Mouse doesn't have an undo button.

Your keyboard does though, as probably does the GUI of your editor in a toolbar or menu item. It isn't like you have to use only the mouse. The mouse was meant to be used together with the keyboard, not as a replacement.

Re:Things I've learned building a modern TUI framework by samatman on Thursday August 04, 2022 @11:09AM (#32343927)
Yes, yet in a thread specifically about what keyboards can do which mouses can't, "you can use the keyboard for that" is the point.

There's a menu item for Undo in most GUI applictions. But who has time? If you can undo from TUI vim without a keystroke, I don't happen to know how.

Re:Things I've learned building a modern TUI framework by badsectoracula on Thursday August 04, 2022 @02:17PM (#32346414)
The point was the original question "you mean it can do more than is actually possible to do with a mouse?" was wrong because it isn't a question of mouse vs keyboard since mice are not meant to be used by themselves but instead they augment what you can already do with the keyboard.
Re:Things I've learned building a modern TUI framework by dmitriid on Thursday August 04, 2022 @07:02AM (#32341424)
> the editor won't accidentally delete one of the brackets ever

There's too much faith in your editor. Also. A mouse is a precision pointing device with some tools built in. By the time you've counted how many lines and characters you need to jump in a specific direction, I've already placed my cursor there with a mouse and proceeded with the task I needed to perform.

Because there's no dichotomy between a mouse and a keyboard as vim users would have us believe. These are two tools that people use, effectively, and together.

Re:Things I've learned building a modern TUI framework by zasdffaa on Thursday August 04, 2022 @09:38AM (#32342731)
It actually depends. I'm an emacs user and C-h will select the current 'paragraph', repeated C-h will select the next one down, repeatedly. Moving by paragraphs can be very quick. If you want that, it's almost instant.

Also C-u allows multiples of whatever you want. I can move say, 19 lines up with C-u C-u C-p C-u C-p C-n (move up 16 lines, move up 4 lines, move down one line) and it can be quicker than you'd think - there is a cost of moving your hand to and from the mouse/trackball.

If you know it's 19 lines exactly, C-u 1 9 C-p.

It can be quicker, depending. For precise selection down to the character where gross markers aren't present, yeah, I deffo go with the mouse.

I'm agreeing with you here, just adding a perspective.

Re:Things I've learned building a modern TUI framework by dmitriid on Thursday August 04, 2022 @11:02AM (#32343828)
> Also C-u allows multiples of whatever you want. I can move say, 19 lines up with C-u C-u C-p C-u C-p C-n (move up 16 lines, move up 4 lines, move down one line)

Or, you know, one click with the mouse. Because sane people don't count lines and characters.

Re:Things I've learned building a modern TUI framework by zasdffaa on Thursday August 04, 2022 @11:27AM (#32344184)
Dick comment. I'm talking from experience that keyboard is sometimes faster, and I actually say (clearly you didn't read to the 4th para) that a mouse is better in other cases. Try reading an entire post before responding.
Re:Things I've learned building a modern TUI framework by dmitriid on Thursday August 04, 2022 @12:00PM (#32344624)
I was responding to a specific example you chose. You could've chosen a different one. And yet here we are, counting lines and doing math and pretending it "can be faster than a mouse".

For imprecise text scrolling a regular PageUp/PageDown will be faster than calculating the number of lines you need to go up/down. For precise random access nothing beats the mouse. Unless you're in a structured text your editor understands. But then, again, there's no mouse/keyboard dichotomy.

Re:Things I've learned building a modern TUI framework by zasdffaa on Thursday August 04, 2022 @12:15PM (#32344836)
> and pretending it "can be faster than a mouse".

Jesus. I use mouse and keyboard as what's best for the task of that moment. In some cases it's a faster to do some complex things using a keyboard, at others, I pick the mouse. Depends on what I'm doing, how well the emacs commands fit that task, how tired I am etc. I'm talking from many years experience. Get a couple of years solid emacs under your belt then we can talk because evidently you have little to none.

https://www.reddit.com/r/programming/comments/6h1geu/is_the_...

linked to

https://danluu.com/keyboard-v-mouse/

Re:Things I've learned building a modern TUI framework by dmitriid on Thursday August 04, 2022 @12:39PM (#32345177)
> Jesus. I use mouse and keyboard as what's best for the task of that moment. In some cases it's a faster to do some complex things using a keyboard

Yes. In some cases. Not in the bizarre "let's do arithmetic to figure out how to jump to a line", which is exactly what I was responding to. No idea what got you so worked up.

> Get a couple of years solid emacs under your belt then we can talk because evidently you have little to none.

Ah. The person accusing me of dickish comments goes for the jugular and devolves into personal attacks.

I had two years with emacs. In the end I was very unimpressed, and switched to, drum roll, IDEA. That I use primarily from keyboard, by the way.

Re:Things I've learned building a modern TUI framework by samatman on Thursday August 04, 2022 @11:15AM (#32344020)
I regret to tell you, `dib` is a specific action you just can't beat with a mouse.

Type it for me. dib.

C'mon.

I'm not a member of the ratpoison squad, and use vim commands because they are eloquent. Sometimes that's fast, sometimes it isn't.

I use a mouse because it is versatile and I'm not competitive at vim golf or trying to be.

dib is great though, right up there with ddO.

Re:Things I've learned building a modern TUI framework by dmitriid on Thursday August 04, 2022 @01:03PM (#32345485)
> I regret to tell you, `dib` is a specific action you just can't beat with a mouse.

> Type it for me. dib.

Ok. I took the bait and typed it. Fro the looks of it found the next matching set of parentheses, deleted content between them, and placed the cursor between them.

I'm.... supposed to be impressed by this random action of destruction?

> dib is great though, right up there with ddO.

Delete a line and insert one empty line? (As far as I could deduce from typing it several times).

But at this point we're veering into the territory discussing weird Vim commands :)

--- offtopic ---

IDEA's versions for this are, on a Mac:

dib:

- Option + Arrow Up to semantically select groups of words. Where "semantically" means "depends on the language". Atrribute value -> attribute value with quotes -> attribute_name="attribute value" -> tag etc. if it's HTML. Value -> declaration -> block -> etc. if it's a programming language (in reality more complex than that)

- Backspace to delete

ddO:

- Cmd + Backspace to delete line - Option + Cmd + Enter (insert line above) to insert new line in place of the deleted one

Re:Things I've learned building a modern TUI framework by tcoff91 on Friday August 05, 2022 @02:33AM (#32352512)
The great thing about vim is every major IDE has a vim emulator. So even when I use JetBrains I still get to use vim plus all the other great things in their IDEs. IDEA Vim is great. I had a job where I had to use many tech stacks and different IDEs and they all had vim.
Re:Things I've learned building a modern TUI framework by samatman on Friday August 05, 2022 @04:23AM (#32353224)
> I'm.... supposed to be impressed by this random action of destruction?

I use di" more often but it's the same thing really. fnCall("a| string"), `di"` lets me replace the string, `dib` to replace the argument (all of them ofc if there's more than one).

If ddO isn't available, granted, Cmd-right-backspace will clean up just as fast. Or Cmd-left-delete if you have both keys.

Re:Things I've learned building a modern TUI framework by dmitriid on Friday August 05, 2022 @12:20PM (#32358291)
I still have no idea what di or dib does. (There should be an explain vim a la https://explainshell.com :) )

> `dib` to replace the argument (all of them ofc if there's more than one).

I prefer editors that are aware of context :)

Re:Things I've learned building a modern TUI framework by dmitriid on Thursday August 04, 2022 @11:56AM (#32344570)
No idea what dib is, and you haven't explained what it is.

Are there specific actions that might be faster than mouse in vim? Yes.

Does it mean that vim is always faster? No.

Does it mean that there exists a dichotomy between keyboard and mouse? No.

Re:Things I've learned building a modern TUI framework by allarm on Friday August 05, 2022 @12:41PM (#32358558)
> Does it mean that vim is always faster? No.

Yes. You don’t have to move your hands away from the home row, you don’t have to do some random moves with your mouse to locate the pointer. Vim is pretty much always faster. The important thing here is not the speed though - who cares if you spend 2 vs 5 seconds to select a paragraph anyway. It’s just that vim has much more convenient and most importantly precise way to interact with text objects, that’s it. Precision is the key.

Re:Things I've learned building a modern TUI framework by dmitriid on Friday August 05, 2022 @05:27PM (#32362176)
Decide whether it's "vim is almost always faster" or "it's not the speed though who cares if you spend 2 vs 5 seconds".

> Precision is the key.

It's funny how you say this and dismiss an actual precision pointing device. It's also funny we are in a subthread that shows how to do arithmetic just to move up and down a certain number of lines and precisely position cursor where it's needed.

Also, a good article on keyboard vs. mouse someone linked in the thread: https://danluu.com/keyboard-v-mouse/

Re:Things I've learned building a modern TUI framework by themadsens on Thursday August 04, 2022 @04:30PM (#32347934)
> right up there with ddO

I believe S or even cc is more succinct

Re:Things I've learned building a modern TUI framework by samatman on Friday August 05, 2022 @04:14AM (#32353157)
See that's vim golfing! I kid, I kid.

I use ddO because I use dd and I use O, while I've never gotten 'conceptually fluent' with using the c range to do delete-then-edit. I know it's there but I don't use it.

Re:Things I've learned building a modern TUI framework by layer8 on Wednesday August 03, 2022 @05:50PM (#32337011)
One benefit is that you can operate “blindly”, without needing the hand-eye-coordination feedback loop. This tends to make frequent operations more automatic and decrease cognitive overhead.

Another benefit is that keyboard input is higher-bandwith than mouse operations. Imagine a mouse-only interface for everything you can do on the Linux command line, or all the operations you can do in Vim or Emacs (beyond actual text input).

It’s more powerful in the sense of “power user”.

Re:Things I've learned building a modern TUI framework by zasdffaa on Thursday August 04, 2022 @02:23AM (#32339790)
The keyboard may make things easier, I grant. Then the word is 'easier'. and 'faster'. I do use and like emacs BTW.

Then again I have RSI, do you reckon that's easier/faster for me?

> Another benefit is that keyboard input is higher-bandwith than mouse operations

Depends on the job - a mouse is far higher bandwidth for graphics editing, and I know cos I've done that when mice weren't a standard thing.

There's a simplicity of your argument here that misses an important point, use the right tool for the right job.

NB. I use a trackball and IMO that is better than a mouse in all situations I can think of. I recommend them.

Re:Things I've learned building a modern TUI framework by tcoff91 on Friday August 05, 2022 @02:36AM (#32352533)
One pointing tool I highly recommend for RSI is the contour rollermouse.