OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Jun 24, 2017 2:45 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: which do you think is better user experience?
PostPosted: Wed Mar 01, 2017 12:22 pm 
Offline
Member
Member
User avatar

Joined: Wed Jul 13, 2011 7:38 pm
Posts: 501
Location: Victoria, Canada
rdos wrote:
Let's face it, most of this hidden stuff is to hinder user control and to lock-down you to specific OSes.


Actually most of it is to try to stop people who think they know more than they actually do from bricking their system and then blaming Windows.

_________________
The good thing about Unix is when it screws up, it does so very quickly.


Top
 Profile  
 
 Post subject: Re: which do you think is better user experience?
PostPosted: Sat Mar 04, 2017 3:40 am 
Offline
Member
Member

Joined: Wed Aug 17, 2016 4:55 am
Posts: 150
Going baaaaaaaaaack to the original topic, just decided to come up with different ways for writing the syntax of some "beep" command that gives you some control over the generated sound. Let's see which one fares better.

Remember, I won't make room for syntax highlight since you'll need everything to follow that for it to be effective (e.g. text editors), not just the shell. I already said earlier why I think that's a bad idea (every executable needs to somehow communicate their syntax to absolutely everything that may need it in order for highlight to work, and that's going to be a lot of effort when it's possible there's an easier alternative that works as well).

Unix-like... yeah not very readable
Code:
beep -f 440 -v 100,0 -t 500 -w sawtooth

If we ditched single-letter arguments and used pronunceable ones. Even if some are shortands, they should still be easier to remember since when it comes to text we're better at remembering how to pronounce them than the exact spelling.
Code:
beep -freq 440hz -vol 10db,0db -time 500ms -wave sawtooth

Using the equals sign strictly, which was suggested earlier
Code:
beep frequency=440hz volume=10db,0db time=500ms waveform=sawtooth

The same but without the equals sign, which was suggested earlier too... this one was meant to rely on syntax highlighting, actually I find it harder to read because without the highlighting and without any sort of syntax that stands out (like the prefix or the equals sign) it becomes really hard to tell apart where does each argument start.
Code:
beep frequency 440hz volume 10db,0db time 500ms waveform sawtooth

Taken to the logical extreme, where each argument is interpreted directly from their format. May seem elegant at first, but while it works here (since every argument is its own kind and hence has its own format, note that they can come in any order), it probably won't do as well on other programs (e.g. if you can take both input and output filenames, it can be hard to tell them apart short of enforcing an order or some obtuse syntax). Consistency would end up being thrown out of the window long term.
Code:
beep sawtooth 440hz 10db~0db 500ms

Probably something to take into account is that the average user will never use the command line, so you can expect the actual users to be willing to put some more effort to learn than usual. If increasing the learning curve a bit can make things much easier in the long term, then it's likely worth the effort. Anyway, leaving these to discuss, maybe somebody can come up with another suggestion.

Also something I hope nobody takes seriously:
Code:
echo '{
   frequency: { start: 440; end: 440; unit: "Hz"; },
   volume: { start: 10; end: 0; unit: "dB"; },
   duration: { value: 500; unit: "ms"; },
   waveform: { shape: "sawtooth"; duty: 0.5; }
}' | beep

_________________
https://github.com/sikthehedgehog/indigo


Top
 Profile  
 
 Post subject: Re: which do you think is better user experience?
PostPosted: Sat Mar 04, 2017 9:26 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 870
Location: Athens, GA, USA
You missed some other possibilities, all of which work by basically replacing your shell with a programming language interpreter. The first is to use the conventional function call syntax, and treat arguments as functions themselves:

Code:
beep(frequency(440hz), volume(10db,0db), time(500ms), waveform(sawtooth))


This also has the advantage of making the beginning and ending of the program invocation itself clear, and regularizing the whole structure. However, aside form the extra typing, most non-programmers would probably find it no less confusing than any of the previous examples.

Then next possibility - which I am including mainly for completeness, and because it appeals to me personally - is to use the Lisp keyword conventions (with or without parens around the whole thing):

Code:
beep :frequency 440hz :volume (10db,0db) :time 500ms :waveform sawtooth


I expect that this would be pretty confusing to most people, but it does differentiate parameter names from arguments.

Next, something based on the Smalltalk messaging passing model, where the program is considered the object (which doesn't make sense from an OO viewpoint, but bear with me):

Code:
beep frequency: 440hz volume: [10db,0db] time: 500ms waveform: sawtooth


On the surface, this is basically the same as the previous one, but again, please bear with me.

Finally, here's the 'real' answer in my view: have the installation process include giving a description of the program's 'function signature' (that is, all its arguments and their expected values) in a format such as JSON which can be automagically passed to the command language's REPL. This also neatly allows you to replace the shell language with something like Python or Smalltalk by giving the automatic tools to read program signatures from a database.

Or you could, you know, spend more time on things that casual users - the ones most likely to get confused, but also least likely to use the shell - actually need to be better. Pareto principle, yo.

(Well, unless the 20% problem happens to be "using the shell", but you might want to find that out first.)

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
μή εἶναι βασιλικήν ἀτραπόν ἐπί γεωμετρίαν
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: which do you think is better user experience?
PostPosted: Sat Mar 04, 2017 1:32 pm 
Offline
Member
Member

Joined: Wed Aug 17, 2016 4:55 am
Posts: 150
Schol-R-LEA wrote:
You missed some other possibilities, all of which work by basically replacing your shell with a programming language interpreter.

I know some people just outright replace traditional shells with Python. In fact when I finally looked at PowerShell I was surprised (given how much praise it gets) that it didn't look more like a traditional scripting language, it still screamed shell all over the place. I'd have thought people hated old-school shell syntax.

I guess it maybe simply isn't very nice when you just want to run a bunch of programs.

_________________
https://github.com/sikthehedgehog/indigo


Top
 Profile  
 
 Post subject: Re: which do you think is better user experience?
PostPosted: Fri Mar 10, 2017 3:56 pm 
Offline
Member
Member

Joined: Mon Jul 05, 2010 4:15 pm
Posts: 478
Sik wrote:
Schol-R-LEA wrote:
You missed some other possibilities, all of which work by basically replacing your shell with a programming language interpreter.

I know some people just outright replace traditional shells with Python. In fact when I finally looked at PowerShell I was surprised (given how much praise it gets) that it didn't look more like a traditional scripting language, it still screamed shell all over the place. I'd have thought people hated old-school shell syntax.

I guess it maybe simply isn't very nice when you just want to run a bunch of programs.


While I like the idea of having Python as scripting Language in a shell, what I wonder how they do it so that it doesn't become too inconvenient. Do they augment the syntax at all?

For example in a shell always typing call["MyCommand", "-myoption"] at the command prompt can be tiresome. Can you actually change the syntax so that only writing "MyCommand -myoption" doesn't invade on the regular Python syntax. Or is it only script files Python kicks in?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 80 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group