object oriented console

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
earlz

object oriented console

Post by earlz »

so what about it
haven't put much thought into it yet but anyway

some sample commands might be something like
(replacuing -> with some other character for faster typing)
"run->hello world.exe"
logic: run, run what? hello world.exe
"run"
logic run, run what? show a list of programs

and then just have short things you could type like
"halo" and it run halo for faster typing than C:\program....



anyone see any immediant problems from the programmer or user point of view?
User avatar
Solar
Member
Member
Posts: 7635
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:object oriented console

Post by Solar »

OO, in my experience, is something only programmers - and by far not all of them - feel comfortable with. I don't see any intuitivity advantages in a OO console syntax.

Your examples aren't OO IMHO. You'd rather type "HelloWorld->run" or something like that. Consider:

HelloWorld->run
HelloWorld->copy
HelloWorld->rename

That would mean that either HelloWorld implements all those functions (no way!), or that it delegates to a "run handler", a "copy handler" and a "rename handler" respectively. You're back to the "usual" way of things: A program "run" gets HelloWorld as parameter. I.e., what you type on the console (OO) is not what happens in the system (procedural) - A Bad Thing (tm), IMHO.

My opinion only, YMMV.
Every good solution is obvious once you've found it.
JoeKayzA

Re:object oriented console

Post by JoeKayzA »

The example "run->helloworld.exe" looks indeed a bit strange from the OO point of view...

I could imagine a good use of OO in a shell however, just consider edit->open "document.txt", or /dev/cdrom->eject. (The latter is written "eject /dev/cdrom" in linux, which is pretty counter-intuitive IMO). To implement this cleanly and seamlessly though, the system will need to be prepared for this under the hood, otherwise you'll run exactly into the problem Solar mentioned above.

cheers Joe
User avatar
Solar
Member
Member
Posts: 7635
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:object oriented console

Post by Solar »

JoeKayzA wrote: I could imagine a good use of OO in a shell however, just consider edit->open "document.txt"...
That is an improved from [tt]edit "document.txt"[/tt]?
...or /dev/cdrom->eject. (The latter is written "eject /dev/cdrom" in linux, which is pretty counter-intuitive IMO).
They don't differ much in intuitivity, either, IMHO... I have yet to see an example that really makes sense for the user. (Remember, the person who has probably never touched any OO programming languages in his life and probably never will...)
Every good solution is obvious once you've found it.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:object oriented console

Post by Colonel Kernel »

IMO the point of an OO shell is not the command syntax, but rather the format of the underlying data that shell commands manipulate. There are a lot of advantages to having that data be structured instead of raw streams of bytes.

Windows Vista is going to include a new OO shell called Monad.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
earlz

Re:object oriented console

Post by earlz »

wells its not really OO I guess then but well don't know what else tp call it so..

wow I'm tired and can't figure how to write this so...

just that
play->blah.wav
or even play->music->blah.wav
seems a lot better than
media player.exe blah.wav

bad point is it would all work out of defaults


maybe have some filtering so that
for play->music->blah.blah
since the default media player don't support it ask for a different one or maybe have a default opener for an extension like windows

well tired now so cya
User avatar
Solar
Member
Member
Posts: 7635
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:object oriented console

Post by Solar »

Get a nap. You're starting to confuse shell syntax with file type recognition / default applications / plugin management. ;)

Ah, the good times of "Multiview"... you just typed "multiview {filename}" and it displayed BMP / PNG / GIF / JPEG, played WAV / 8SVX / AIFF, rendered HTML / TXT / PDF... which had nothing to do with OO, but everything with datatype plugins...
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:object oriented console

Post by Pype.Clicker »

i've been toying with a "document database system" (ph34r, winfs!) that applies some OO paradigms on your system ... that is, each document is indeed an object with methods (basically, you have .meta-class.xml everywhere instructing the system which perl script or native tool implement which operation).

That means Solar's multiview is achieved by
"meta-do view <list of documents>" ... The 'meta-do' is of course here because it's not yet integrated in a shell or whatsoever. "gv" will then be used for PS/PDF documents, konqueror for html, "display" for png, bmp, jpg and the like. You may even have some documents that are not "view"able per se but are first translated in another format (e.g. .dia -> .png or .fig -> .eps) and then shown.

Yet it remains "command <targets>" style, not "<target>.command", and imho, it'd make no sense to have a command line in the "<target>.command" approach... just thing of "copy *.bak ~/trash" or just "cat hello.c world.c > helloworld.c": that's where a command line is superior to click-click-file-explorer imvho.

Code: Select all

foreach *.bak (copy % ~/trash)
no thanks, i already have to do this when a command unfortunately doesn't support multiple targets...

Code: Select all

new helloworld.c
helloworld.c:append hello.c
helloworld.c:append world.c
AAaarhhghg.
JoeKayzA

Re:object oriented console

Post by JoeKayzA »

Solar wrote:
JoeKayzA wrote: I could imagine a good use of OO in a shell however, just consider edit->open "document.txt"...
That is an improved from [tt]edit "document.txt"[/tt]?
...or /dev/cdrom->eject. (The latter is written "eject /dev/cdrom" in linux, which is pretty counter-intuitive IMO).
They don't differ much in intuitivity, either, IMHO... I have yet to see an example that really makes sense for the user. (Remember, the person who has probably never touched any OO programming languages in his life and probably never will...)
Ok, you got me. :P I simply fail to design for joe user, most of the time I'm designing for joe kayzer instead. :) Besides this, my examples weren't the best. You'd do method calls on documents rather than applications.

But honestly, how many non-developers or non-power-users really use a textual shell nowadays? So straight forward intuitivity is probably not the number 1 goal (I simply don't think it would change much in the user base - there are too many people who are simply scrared to death by a text console)

cheers Joe
User avatar
Solar
Member
Member
Posts: 7635
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:object oriented console

Post by Solar »

JoeKayzA wrote: But honestly, how many non-developers or non-power-users really use a textual shell nowadays?
Is that because textual shells are a thing of the past, or because the Windows shell sucks so heavily?

8)

Linux and AmigaOS have a strong shell that sees frequent use. And the two MacOS users I know personally... the first thing they did on their new Macs was enabling access to bash. ;)
Every good solution is obvious once you've found it.
AxelDominatoR

Re:object oriented console

Post by AxelDominatoR »

Solar wrote: Linux and AmigaOS have a strong shell that sees frequent use. And the two MacOS users I know personally... the first thing they did on their new Macs was enabling access to bash. ;)
IMHO ... mainly because with your Amiga you had a really well-written copy of Amiga Workbench manual that explained clearly many commands ;)

Another thing I have to say is that most linux shell users I personally know were used to another shell-based OS first ( be it DOS, AmigaDOS or others ) and then they felt like at home writing in bash ( typing commands in a shell, by a decently quick writer, is by far faster than clicking on a GUI by a fast "clicker", and a shell uses far less resources ). For example, I started using AmigaOS, then DOS, then Linux. Linux users directly coming from Windows, instead, tends to use only X gui. Just my general opinion, however, so take it with a grain of salt.
Back to the topic, I think that a shell should behave like a normal dialog between two people. You say:

Play my mp3 ( play file.mp3 )
and not
MP3, play yourself ( file.mp3 -> play )

My two cents,
Axel
Kemp

Re:object oriented console

Post by Kemp »

Ignoring the GUI/console debate for now (my eventual goal is a hybrid approach that captures them both and more :P), I'll give my input on "OO" consoles. In a single word : no. How could

play->music->blah.wav

possibly be easier to type or more intuitive than a simple

play music/blah.wav

? It has more keystrokes, more shift transitions (on an english/american qwerty keyboard) and IMO looks horrible. On a similar note:

/dev/cdrom/0->eject

is not better than

eject /dev/cdrom/0

because in normal language that is how you would say it. Also, if you have any identifier for the drive that you show the user, rather than one that the system uses, then let them use that, such as in this example where you have assigned letters to drives:

eject D:

is another few orders of magnitude easier to use.

My point here is you can code the console using whatever techniques you wish, but don't force the user to do unnecessary typing just for the sake of having a console that is different. If you really want the longer, harder to type commands then simply convert what the user typed behind the scenes and then use that.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:object oriented console

Post by Pype.Clicker »

heh. anyone used with the linux console would not have suggested a "madonna.mp3 :play" against "play madonna.mp3". The fact you tell the system what you're going to do first allow to fine-tune the completion. that means once you've typed "play", you can for instance hit TAB twice to see the list of items that can be "play"ed (e.g. filtering what you have)

(my future shell-of-the-future, for those who haven't seen it yet :P)

Now what i'd really love to have is a console that can remember what has been replied lately and allow me to act on that.

e.g.

Code: Select all

pype:> pidof acroread
42
pype:> kill it
[42] acroread done
Or indeed, the ability to "probe" what can be done on a given document (ever faced the "argh! what's the name of the tool that convert .xyz into .zyx format !?)
JoeKayzA

Re:object oriented console

Post by JoeKayzA »

AxelDominatoR wrote: Play my mp3 ( play file.mp3 )
and not
MP3, play yourself ( file.mp3 -> play )
In common GUIs however, you *do* say mp3: play yourself. You browse through directories (or issue a search) until you see an icon representing your mp3-file. Now you open the context menu, and you get a list of operations this file supports (depending on the file type, these are likely to be different), one of these probably being 'play'. The file browser or GUI-shell typically translates these operations in opening an application, passing the desired operation and file as arguments or something else, but that's almost invisible to the user.

I'm not yet sure whether this is a pro or a con for OO textual shells, but I find it interesting that this behaviour for GUIs is common and claimed to be intuitive - so....

cheers Joe
Kemp

Re:object oriented console

Post by Kemp »

You can't compare those, they are like apples and oranges. The GUI behaviour is only considered intuitive *because* of the fact that it's a GUI which attempts to use real-world metaphors, you see the file (object) in front of you and then you do something with it, such as play it. In a text based interface what is intuitive is anything that looks almost like real language, so "eject cd" or "play mp3".

Off-topic slightly, your FutureShell looks very similar to what I was envisioning for mine ;D It's a GUI where you can basically just start typing and if nothing's selected it will automatically create a little "shell" area to contain the text. So useful for typing commands, creating reminder notes, pretty much anything where you just want to type without hassle. Yours has had a lot more thought than mine and seems much more useful currently though ;)
Post Reply