Re: Points vs Vectors / GUI Library Proposal for a Proposal)

Noah Stein wrote:
This makes them almost the same thing. You can treat vector as a point, and point as a vector. Besides, we are talking about R^2, which is a vector space.
Sure, there's an isomorphism between points and vectors; however, that doesn't make them the same. There's an isomorphism between the functions f(x)=x and f(x)=2x; however, that does not make those two equations the same.
This could be explained by analogy with C++, which more readers here might be familiar with: the difference between points and vectors is the same as the difference between C++ pointers and C++ ints. You can add a pointer to an int, or an int to a pointer, but you can't add two pointers. However, you can subtract two pointers to get an int. Likewise, it's not really meaningful to talk about the sum of two positions, but the difference between them is the vector from one to the other. Back on the subject of a GUI library: I understand the motivation - that's where wxWindows arose. And I realise that nowadays a GUI library could be done in a much more modern C++ style. But my question is: is C++ the right language? I don't want this to descend into a religious war - C++ is my favourite language, but it isn't the best language for every task. Would a higher-level, more dynamic language be more suitable for GUI work? In a perfect world, I'd do all my back-end stuff in C++ and all the front-end development in, say, Python. By doing all the GUI work in C++ instead of an interpreted language, you: a) spend a lot more time recompiling. b) can less easily tweak a running program to try out different ideas. c) have to spend a lot of effort to construct a domain-specific language (c.f Spirit; see (a)). d) probably end up with a bigger codebase. So what do you stand to gain, other than being able to write GUIs in your favourite language, as opposed to your second-favourite language? The only thing I can think of is that you don't have to worry about any bridge between languages. George

Back on the subject of a GUI library: I understand the motivation - that's where wxWindows arose. And I realise that nowadays a GUI library could be done in a much more modern C++ style. But my question is: is C++ the right language? I don't want this to descend into a religious war - C++ is my favourite language, but it isn't the best language for
I would say so ;) For instance, you can abstract away a lot of stuff (true binding of data to GUI controls): http://www.torjo.com/win32gui/save_dlg.html Also, I want to allow, in the future, to bind STL containers directly to GUI list controls. So, I would say a higher level language won't be of help here - because you would need to convert your data and send it back and forth. I remember the days when I used to do the UI in VB - it was quite a mixed feeling...
every task. Would a higher-level, more dynamic language be more suitable for GUI work? In a perfect world, I'd do all my back-end stuff in C++
sometimes, certainly
and all the front-end development in, say, Python. By doing all the GUI work in C++ instead of an interpreted language, you: a) spend a lot more time recompiling.
that is unfortunately true :(
b) can less easily tweak a running program to try out different ideas.
We're missing a good GUI designer... But we're slowly getting there ;)
c) have to spend a lot of effort to construct a domain-specific language (c.f Spirit; see (a)).
Not sure what you mean...
d) probably end up with a bigger codebase.
why so? Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.5 - tooltips at your fingertips (work for menus too!) + bitmap buttons (work for MessageBox too!) + tab dialogs, hyper links, lite html

At 07:38 PM 11/7/2004, George van den Driessche wrote:
Back on the subject of a GUI library: I understand the motivation - that's where wxWindows arose. And I realise that nowadays a GUI library could be done in a much more modern C++ style. But my question is: is C++ the right language? I don't want this to descend into a religious war - C++ is my favourite language, but it isn't the best language for every task. Would a higher-level, more dynamic language be more suitable for GUI work? In a perfect world, I'd do all my back-end stuff in C++ and all the front-end development in, say, Python. By doing all the GUI work in C++ instead of an interpreted language, you: a) spend a lot more time recompiling. b) can less easily tweak a running program to try out different ideas. c) have to spend a lot of effort to construct a domain-specific language (c.f Spirit; see (a)). d) probably end up with a bigger codebase. So what do you stand to gain, other than being able to write GUIs in your favourite language, as opposed to your second-favourite language? The only thing I can think of is that you don't have to worry about any bridge between languages.
What you say makes a lot of sense if just you is involved. Or perhaps a small enough group that they can all agree on the second-favorite language. But in larger organizations that approach results in a proliferation of languages. I know of a company that has let programmers write code in any language they like. The result is a nightmare. Over a dozen languages are in common use. The toolchains on some projects are so convoluted that the projects cannot be moved between the several operating systems in use at the company. Programmers cannot freely move to another project because they often don't know all the languages that are required. It is a serious mess. Thus the use of C++ as a GUI language may be sub-optimal as far as the small picture goes, but could be a really smart move in terms of the big picture. Because what we are talking about is a library, rather than something in the core language, non-users of the library don't pay for something they don't use. As long as a C++ GUI library is useful to a significant number of people it doesn't matter if lots of others choose a dual language approach. --Beman
participants (3)
-
Beman Dawes
-
George van den Driessche
-
John Torjo