Which Text-Based UI Do You Code With?
JHWH asks: "I've been asked to design and implement a management software system with text based user interface as the replacement of an older one running on AS/400. Despite my attempts towards a web UI, the customer is actually willing to have a text based UI. The main reasons are the need for a very low bandwidth and the ability to run on serial terminals. All this in the 21st century! Host systems will be Linux, the language will be C or C++. I already thought about the use of text based browsers like lynx or links. So now I have to wipe the dust away from my ncurses manual, or can Slashdot suggest something more effective?"
IMO, unless you can give a good reason why you shouldn't use ncurses, use it.
Despite my attempts towards a web UI, the customer is actually willing to have a text based UI. The main reasons are the need for a very low bandwidth and the ability to run on serial terminals.
It sounds like the client's needs are thought out and perfectly reasonable. The problem seems to be with the person they've asked to do the job.
Web interfaces suck in so many novel and unique ways. There's the session timeouts. There's the non-interactivity. There's the random bugs on every browser, and the huge mass of compatibility code required to support all of them. Then there's the web app that requires Sun Java and the web app that requires MS Java, both of which run only in IE, and both of which are supposed to run ON THE SAME MACHINE! (I have to deal with that situation once. Royal pain in the rear-end. I don't remember how I solved it, actually...)
If you want a decent UI, don't bother with web-based stuff. Use a product like RealBasic, do it quick and make a CLI to do all the heavy lifting on the back-end.
Comment of the year
Just for shits and giggles make it web based and force them to use lynx to interface with it.
Beer! It's what's for breakfast!
This should get me modded down and/or knocked unconscious from repeated canings to the face or something.
Conio!
Isn't there a linux port of that?
Seems like the bulk of the UI logic would be easier to develop and more error-free if done in python. python could then tie into the C/C++ backend code where necessary. From my casual search of google, python and (n)curses work very well together.
Compared to web, it has advantages that the original poster enumerated, as well as:
- support for hotkeys and shortcuts (especially big for manual data entry/call centre users)
- ability to easily rescale + resize to fit into available screen real estate.
It's simple for a terminal emulator to scale down fonts when the window is resized. Try that with your average GUI or web page.. not to mention component layout issues when dealing with GUIs. This may sound dumb, but it can be a big issue for call centres having to juggle multiple apps but with only one physical screen.
- simplified deployment (yes, even simpler than web) - no issues with browser versions, plugin conflicts, etc etc.
- SPEED! Compared with the latency of your average web front-end.
Issues like this really add up to a big difference for apps that are used intensively.
somebody in ##slackware on freenode
once recommended me to try using the slang API
instead of (n)curses based on the fact that he bought a ncurses book
and it sucked monkeyballs and programming ncurses is not really intuitive
some of the other fine folk who regularly sit idle in that channel
also said that if it could be done in a Shell script
you could try using shell and dialog which is a ncurses based program btw
this could obviously be a biased opinion from slackers since the pkgtools in slackware http://www.slackware.com/ are written this way
and they have served us fine for many years
and will continue to serve us happily for many more years to come.
anyway good luck
Charva is an curses-based, Java text UI toolkit that is modeled after Swing. If you know Java and Swing, using Charva is quite straightforward, and won't require you to muck around writing your own text widgets.
Borland's Turbo Vision UI was rather nice, considering it was all Text. It's even been ported for GNU toolsets: http://tvision.sourceforge.net/
p g
Screenshot from the link of it on QNX: http://tvision.sourceforge.net/tv2-QNX-tvscreen.j
The nice thing about it is that it's OO... one of the very first OO TUI's, if I remember correctly.
I have absolutely no idea how it'll work over a terminal. XTerms an option?
The article title has nothing to do with the article contents.
... the title is "Which Text-Based UI Do Yo Code With" - not "Which Text-Based UI Library Do You Write To/Compile Against".
S-lang, possibly with libnewt:
slang1 - The S-Lang programming library - runtime version.
Description: The S-Lang programming library - runtime version
S-Lang is a C programmer's library that includes routines for the rapid
development of sophisticated, user friendly, multi-platform applications.
libslang1 - The S-Lang programming library - runtime version
libslang1-dev - The S-Lang programming library, development version
libslang1-pic - The S-Lang programming library, shared library subset kit
libslang1-utf8 - The S-Lang programming library with utf8 support
libslang1-utf8-dev - The S-Lang programming library, development version with utf8 support
libslang1-utf8-pic - The S-Lang programming library, shared library subset with utf8 support
libslang2 - The S-Lang programming library - runtime version
libslang2-dev - The S-Lang programming library, development version
libslang2-pic - The S-Lang programming library, shared library subset kit
libterm-slang-perl - perl interface to the S-Lang terminal library
slang-cfitsio - read and write FITS files from S-Lang
slang-curl - transfer files using HTTP and FTP from S-Lang
slang-gdbm - access to GDBM databases from S-Lang
slang-gsl - GNU Scientific Library binding for S-Lang
slang-gtk - binds the GIMP Toolkit (GTK) to the S-Lang scripting language
slang-histogram - create and manipulate histograms from S-Lang
slang-pvm - PVM (Parallel Virtual Machine) interface for S-Lang
slang-slirp - C code generator for the S-Lang scripting language
slang-tess - regression testing system for the S-Lang scripting language
libnewt0 - Not Erik's Windowing Toolkit - text mode windowing with slang
Description: Not Erik's Windowing Toolkit - text mode windowing with slang
Newt is a windowing toolkit for text mode built from the slang library.
It allows color text mode applications to easily use stackable windows,
push buttons, check boxes, radio buttons, lists, entry fields, labels,
and displayable text. Scrollbars are supported, and forms may be nested
to provide extra functionality. This package contains the shared library
for programs that have been built with newt.
libnewt-dev - Developer's toolkit for newt windowing library
libnewt-perl - Perl bindings for Erik Troan's newt text-mode windowing toolkit
libnewt-pic - Not Erik's Windowing Toolkit, shared library subset kit
libnewt0.52 - Not Erik's Windowing Toolkit - text mode windowing with slang
newt-tcl - A newt module for Tcl
pike7.6-pexts-newt - Pike Newt module
python-newt - A NEWT module for Python
whiptail - Displays user-friendly dialog boxes from shell scripts
Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
...a management software system with text based user interface as the replacement of an older one running on AS/400. Despite my attempts towards a web UI, the customer is actually willing to have a text based UI. The main reasons are the need for a very low bandwidth and the ability to run on serial terminals. All this in the 21st century! Host systems will be Linux, the language will be C or C++.
:) hooking Wyse serial terminals to a PC and controlling multiple terminals from a PC with a multi-serial port board.
:)
I'm an AS/400 guy, used to be a PC programmer. I'm trying to understand this, any comments appreciated. What's clear to me is the company is converting from an AS/400 to Linux (yes, Linux runs concurrently in partitions on the AS/400, now called system i after several name changes, but I'm also assuming they want a cheap Linux server).
I remember in some early programming (I was original programmer for Melita Electronics, later International, they did well
The AS/400 of course has not had serial terminals, they have 5250 terminals or PC terminal emulators over TCP/IP now, IBM networking before that. So I take it this serial port thing is a throwback to what I used to do because this company says, we have a Linux PC server, let's hook up cheap serial port terminals? With serial communications limitations and dirt cheap PC's able to run any kind of terminal emulation cheaply, something very strange about that to me.
The best I can tell from this is the purpose of NCURSES would be to emulate 5250 PC emulation with a serial port terminal emulator. But like I say, any clarifying comments welcome.
The replacing a "management software system" equivalent to what they had on the AS/400 in C++ on Linux would seem to be quite a job in itself. All of the work that NCURSES does is taken care of by our 5250 I/O subsystem. That's quite a lot of I/O detail that he will have to insert into the replacement.
By the way, NCURSES doc says it runs on any POSIX platform, and the AS/400 (which is usually called iseries now) has a C++ compiler and is POSIX compliant. The C++ modules can be bound together with modules from any other language on the iseries into an i5/OS program.
It could communicate with anything over TCP/IP, but I would have to check if we can rig up serial ports for terminals.
rd
Except that it sounds like the client (probably a bank or a lotto agency) already has a considerable investment in serial terminals, so no DOS for you: The main reasons are the need for a very low bandwidth and the ability to run on serial terminals.
I agree: Ruby + ncurses for the UI, calling C/C++ modules to do whatever heavy lifting you need (if any).
There's no reason in this day and age to write a non-performance-sensitive UI in C or C++! Especially a text based one. Why would you go through such hell for a task that doesn't require optimal performance? Seriously: you can learn Ruby and code the UI in less time than it will take you to code it in C or C++. I guarantee it. Plus it will be a lot more fun. And you can link in C and C++ modules to execute any performance-sensitive tasks.
Unless there's some reason your text-based UI needs optimal performance, but I can't think of one offhand... I've sworn off all C/C++ development unless there's an overwhelming reason to use them. Heck, I don't even use Java much any more -- it's mostly all Python and Ruby, with an occasional module in C/C++ for performance.
You should be able to whip out a text-based interface using these tools in no time, even if you've never used Ruby. Like tonight. Or maybe over the weekend.
And no, I'm not some Ruby fanboy. I've got over 20 years professional programming experience, plus another 8 years non-professional. I've used many languages over that time. It's all about the right tool for the job. Python would be another great choice (perhaps even better because of its more extensive libraries). But C and C++ are definitely not the best tools for the job. (Unless there's something you haven't shared with us.)
1997 can have its rant back when someone tells me how to run java apps inside firefox on a 64bit machine. Installing 32bit firefox on 64bit FC5 is more grief than I ever thought would be possible, and Sun don't have a mozilla plugin for 64bit Linux.
A web application that depends on Java in the browser probably uses applets. That is not the best way to solve any problem since there are dependencies out of the programmers control (versions of Java on the client, browser problems,...), it is similar to a (windows only) ActiveX dependency.
Java Webstart is very different, it handles deploying Java Applications (typically Swing UI based impementations, nothing to do with Applets or JApplets), resolves Java version dependencies etc. Webstart uses any Java version since 1.3 and any browser to download the initial jnlp file (the launch file, an xml file containing download, security and configuration data) and start the javaws process. The application runs outside the browser context, stand alone.
If you still use 1997 technology (applets) then you're probably encountering the 1997's problems. Knowledge has evolved since those days.
--
Evan
"$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
Steve Yegge moved it here: http://steve.yegge.googlepages.com/tour-de-babel