object oriented console
Re:object oriented console
The method you're describing is the common console with the appropriate applications installed. Consider:
windows: "start halo" will execute halo.exe in a new win32 task (which start.exe creates)
linux: "eject cdrom" (while in /dev) or "eject /dev/cdrom" in any case, which "ejects the cdrom". Can't get much more verbose than that.
Actually making it object-oriented would mean making all files into objects (which is trivial) and defining a number of operations per file, or per file category. That would be the windows UI concept, where double-clicking performs the default operation and any operation can be done with a right-mouse-button click. When all has been set up, it's more practical (halo.exe->newgame->level3, civ2.exe->load->ma1620bc.sav). It does take a lot more to get right, and imo it's not a good idea for the console. A console is not oriented around objects, it's oriented around commands and their input/output/parameters. You could make one oriented around objects, but I wouldn't like to work with it.
I can't judge the idea properly since I've used a traditional console for 18 years.
windows: "start halo" will execute halo.exe in a new win32 task (which start.exe creates)
linux: "eject cdrom" (while in /dev) or "eject /dev/cdrom" in any case, which "ejects the cdrom". Can't get much more verbose than that.
Actually making it object-oriented would mean making all files into objects (which is trivial) and defining a number of operations per file, or per file category. That would be the windows UI concept, where double-clicking performs the default operation and any operation can be done with a right-mouse-button click. When all has been set up, it's more practical (halo.exe->newgame->level3, civ2.exe->load->ma1620bc.sav). It does take a lot more to get right, and imo it's not a good idea for the console. A console is not oriented around objects, it's oriented around commands and their input/output/parameters. You could make one oriented around objects, but I wouldn't like to work with it.
I can't judge the idea properly since I've used a traditional console for 18 years.
-
earlz
Re:object oriented console
no edit is not a file it is an entry in a resolution tableI could imagine a good use of OO in a shell however, just consider edit->open "document.txt"...
That is an improved from edit "document.txt"?
edit->doc.txt will not open edit.exe it will look at the entry in the resolution table and then load the file thats in the entry
such as if your default .txt editior is notepad.exe then it will open notepad
to me it looks like the start menu kindof like
run->macromedia->flash player
even though neither run or macromedia exist and actually if you hacked it a bit then you could have flash player point to notepad.exe instead of flash.exe or whatever
and then maybe if you need to run a program but its not installed to an object then you could do
run;C:\blah blah blah and the ; means an argument follows, like you could do(btw in my plan you can use space freely)
run;notepad.exe;doc.txt
as an alternative way to edit doc.txt
and you could do something like run? and it would display a list of the members of run and these would not be files but installed members
I know its not consistent between run and edit but hey I'm typing what comes to mind
-
Ryu
Re:object oriented console
Usually asian languages are backwards to english, something like "go home" the correct word by word translation in my native tongue would end up "home go". So for something like the command "/dev/cdrom->eject" and in the programming sense I could very easily get use too.
A nice thing about the command "/dev/cdrom->eject" rather then "eject /dev/cdrom", when you have a command line history, you could go back erase "eject" and do something like "play" easily. This would possibly save time, ofcourse ejecting then playing doesn't make sense just a poor example that I find a benifit.
In the whole general OO idea for consoles I'm not very fond of because it seems to nonsense in my opinion, like "play->music->blah.wav". I rather keep this in the general command-line scope, maybe "/music/blah.wav->play <switches>", keeping play to be the command just a differnt way to write the command line, which would be more my intuation.
A nice thing about the command "/dev/cdrom->eject" rather then "eject /dev/cdrom", when you have a command line history, you could go back erase "eject" and do something like "play" easily. This would possibly save time, ofcourse ejecting then playing doesn't make sense just a poor example that I find a benifit.
In the whole general OO idea for consoles I'm not very fond of because it seems to nonsense in my opinion, like "play->music->blah.wav". I rather keep this in the general command-line scope, maybe "/music/blah.wav->play <switches>", keeping play to be the command just a differnt way to write the command line, which would be more my intuation.
-
earlz
Re:object oriented console
@ryu
nah I don't like that; and as far as dev/cdrom->eject I wouldn't like that I'd use eject->dev/cdrom/ cause of the logic: eject, eject what? dev/cdrom/
nah I don't like that; and as far as dev/cdrom->eject I wouldn't like that I'd use eject->dev/cdrom/ cause of the logic: eject, eject what? dev/cdrom/
-
Kemp
Re:object oriented console
Ok, step back and stop thinking about this from the perspective of "how do I hack OO into a purely textual system?" and think more "what will the user want to do?"
To take the last example, which is easier to type?
eject->dev/cdrom/
or
eject cdrom
?
Bear in mind the whole point of console syntax is to make something as easy to type as possible. The whole use of '->' is just an impediment to that goal as it requires more skipping around the keyboard, the use of the shift key, and only makes sense to someone who programs in a language that uses that syntax for accessing members of classes (and in C that only applies if it's via a pointer). For me personally it is orders of magnitude quicker to hit space than type '->', multiply that by possibly several times if some of the suggestions here were used and using the console becomes one of the slowest things possible to do.
To take the last example, which is easier to type?
eject->dev/cdrom/
or
eject cdrom
?
Bear in mind the whole point of console syntax is to make something as easy to type as possible. The whole use of '->' is just an impediment to that goal as it requires more skipping around the keyboard, the use of the shift key, and only makes sense to someone who programs in a language that uses that syntax for accessing members of classes (and in C that only applies if it's via a pointer). For me personally it is orders of magnitude quicker to hit space than type '->', multiply that by possibly several times if some of the suggestions here were used and using the console becomes one of the slowest things possible to do.
-
earlz
Re:object oriented console
*takes huge sigh*
ok now like I said -> will be replaced I'm just not for sure by what
and the dev/cdrom thing is not how it will be, if you had read anything then you would've seen that its going on from other posts
ok now like I said -> will be replaced I'm just not for sure by what
and the dev/cdrom thing is not how it will be, if you had read anything then you would've seen that its going on from other posts
-
kill-9
Re:object oriented console
I would argue that whether the shell provides a "doc.txt edit" or "edit doc.txt" command structure is irrelevent. As long as the syntax and semantics of the shell are well defined and consistent either is usable. At this point though, I'm not sure I see any real benefit to the OO style shell. Maybe that is the best reason for Jordan3 to continue with this project. Maybe we need some experience with such a shell for the pros/cons to become evident. So go for it. Bash away (pun intended) and please share the fruits of your labor with us when you're done. I would be interested in seeing how it turns out.
Before I go, I do have one question. So far what you have presented here looks something like "run->edit->doc.txt". Correct me if I'm wrong, but this could be generalized to "run->command->subcommand->option->object". This looks more like a menu to me. It kinda reminds me of the standard VMS shell. That thing had some sort of database that helped it do completion not only for commands, but also any subcommands or options. Any program written for VMS could hook into that system. Is that what you are intending?
Before I go, I do have one question. So far what you have presented here looks something like "run->edit->doc.txt". Correct me if I'm wrong, but this could be generalized to "run->command->subcommand->option->object". This looks more like a menu to me. It kinda reminds me of the standard VMS shell. That thing had some sort of database that helped it do completion not only for commands, but also any subcommands or options. Any program written for VMS could hook into that system. Is that what you are intending?
-
Kemp
Re:object oriented console
Yeah, I know that the stuff floating around isn't any sort of final form, I was just using those examples to make my point as they're the only stuff I can draw reference from right now. My point is basically that the workings of the shell can be as OO as you want (and may be an immensely better shell for it), but I'm not convinced at all that making the user *type* in OO syntax is a useful thing.
I say make a mock-up and that will pretty much decide the matter one way or the other
I say make a mock-up and that will pretty much decide the matter one way or the other
-
earlz
Re:object oriented console
I think you missed the pointrun->command->subcommand->option->object
yes I do want it to be like a text based menu
ahhh well I've gotta get fdd and filesystem access in before I can start coding, might make a design doc though
-
JoeKayzA
Re:object oriented console
Agreed. Hmm, maybe a more hybrid approach could be more comfortable - for ex., allowing to 'import' methods (in the sense of the 'import'-keyword in java, although java itself doesn't allow to import methods) so you can call them directly like a shell command. Of course you don't want to require the user to do these imports everytime he opens a session, so this could be done on startup (like current unix shells set up the environment when you log in).Kemp wrote: My point is basically that the workings of the shell can be as OO as you want (and may be an immensely better shell for it), but I'm not convinced at all that making the user *type* in OO syntax is a useful thing.
This could allow for a much more structured organization of commands, and I think that's one of the points Jordan3 wanted to achieve, am I right? (menus and stuff)
cheers Joe
-
earlz
Re:object oriented console
yea thats my point but I didn't really understand that first paragraph(never used java either)This could allow for a much more structured organization of commands, and I think that's one of the points Jordan3 wanted to achieve, am I right? (menus and stuff)
lol instead of OOP, OOB(object oriented bashing)
