Hot answers tagged

71

There are literally half a dozen of toolkits that could be considered “native” on some system. Some of these have rather unique concepts or capabilities, and replicating them in a cross-platform toolkit is tedious. The look & feel of an application is not only determined by a “skin”, but also on the layout and how it behaves. Some considerations: In a ...


57

Isn't it only a matter of designing buttons that look like 'native' buttons? Well - sort of, for buttons. But this might be harder than you imagine. These days the graphics used to represent GUI components aren't as simple as random bitmaps that are stretched (since these don't scale very well at all) - they're often vector based graphics with a lot of ...


46

Quoting the same passage from the book (emphasis mine): One of the benefits of detecting problems as soon as you can is that you can crash earlier, and crashing is often the best thing you can do. The alternative may be to continue, writing corrupted data to some vital database or commanding the washing machine into its twentieth consecutive spin cycle. ......


25

I don't think it's at all crazy. It all depends on who your target audience is. If you write an app and expect an average user to use it, you are probably better off with a GUI. If your app is a for developers, especially those that are used to CLI. Or if your app is targeting a sys admin who sits at his workstation and SSH's into 30+ other machines on a ...


25

Why use a class? Because it makes the job easier, assuming you know how to do object oriented programming, and assuming you're writing a non-trivial GUI. Using objects allows you to easily divide your code into modular units that are self contained, and modularizing your code is generally considered to be a best practice. GUI programming readily lends ...


23

I think you are asking the wrong question. IMHO it is pretty obvious that the principle applies especially in the context of GUI (and other UI) applications, and one should better ask if it applies also in the context of non-UI applications. Why? Simply because for a UI program, there is usually a user sitting in front of the system who can react accordingly....


22

There are several methodologies that have evolved over the years to deal with these issues you've mentioned, which are, I agree, the two main issues that UI frameworks have had to address in recent years. Coming from a WPF background, these are approached as follows: Declarative design, rather than imperative When you describe painstakingly writing code to ...


15

In my company, there are a few people specialized in this job. They are designers. And they know HTML. They can be a bridge between the designers and the front-end engineers; which they usually are. This way, we just have to integrate their HTML. This is a hard job. There's a reason sites like "PSD to HTML in 24h" work well. The solution in our company is ...


12

I could give you some rough guidelines as to how to create the equivalent GUI for a CLI app, design-wise. How you would actually make the calls is out of the scope of this answer. switches like -p -v etc are checkboxes mutually exclusive options are a group of radio buttons parameters that are a filename are a textbox with a "choose" button that shows a ...


12

Yes, it does go deeper. Building a button which looks like a Windows or OS X button is easy, when you are building only this button. But the button must "behave" like the original ones, which might not be easy: maybe there is more space in one version available, but not in the other, maybe the color is more fitting for your design in the Windows version, ...


11

Those are different non-competing concepts and they can easily work together to produce a great result. In layman terms: MVVM is useful to get away from the codebehind (GUI/model coupling) clutter. Reactive approach is useful to reduce the event/callback clutter. I would recommend learning a bit about XAML/WPF since Microsoft is the original inventor of ...


10

Greedy Algorithm When a slider moves up (down), all others need to move down (up). Each one has some space it can move (for down - their position, for up: 100-position). So when one slider moves, take the other sliders, sort them by the space they can move, and simply iterate through them. On each iteration, move the slider in the needed direction by (...


10

In short Yes, early crash is an advisable approach also for GUI, but at the same time, the robustness expectations being higher, one shall seek to minimize as much as psosible the risk of reaching an inconsistent state. Some more arguments Early crash in a GUI A GUI has the goal to make user’s life easy and the system understandable. When crashing, a GUI is ...


9

There are different tools and different patterns. Tools ADO.NET ADO.NET is much more than DataSet and DataTable. I would not use those classes in any project but instead use the IDataReader to populate pocos as I describe here: http://blog.gauffin.org/2013/01/ado-net-the-right-way/ Data mappers The next step is to use a data mapper. What they do is to ...


8

It's not hard to make a button that looks like an OSX button, or a Windows button, or that of any other toolkit. But the UI guidelines for most environments are not as simple as the basics of "this is what a button looks like." There are many subtler differences, from the spacing between UI elements to the order in which certain well-known actions should ...


7

There is a trade-off between expecting your application to look as natural as possible on every system and expecting your application to work in the same way on each system. There is no "right" choice. Moreover, even if you choose the "natural looking" side, you might want to protect the users of your graphic toolkit against "improvements" in the underlying ...


7

I've worked with UI for many years, and my experience says that you should always abstract as much program functionality away from the UI as you possibly can. UI's are complicated enough to reason about on their own. Embedding any sort of logic in them that is not directly UI related eventually leads to an unmaintainable application that doesn't allow ...


6

I'm not sure there is a "right way", but a reasonably effective way of cooperating with a designer is to first build an unstyled system that uses templates and allows for the easy interchange of all templates. Then, once you have a functional-but-unstyled (or minimally styled) interface, you hand the results over to the designer for styling. A decent ...


6

Usually, this can be solved by writing a GUI front-end that builds a command line. At that point you simply call the old CLI "main()" function with the arguments in the appropriate order. What you need to do then, depends on the output. You might do well by wrapping all printf()'s in a generic output variadic function, that in the CLI version will just pass ...


6

Some of the reasons you might want a GUI are: Some, or all, of the users are not comfortable with the command line interface It may be easier to use a GUI, due to the complexity of the application. Think about Adobe Illustrator, the GUI is much simpler than writing postscript files or similar There are visualizations, graphs and similar things that are ...


6

Saving the whole window as a single object into GPU (it would be bunch of rectangles saved as VBO) and then rendering it in a single OpenGL draw call would be fast, but it has several disadvantages: The whole geometry would have to be rendered using single shader. Having separate shaders (for opaque copy, transparent copy, gradient, ...) is more useful. The ...


6

What's most favorably looked upon I think is to actually write SweetApp and libsweetapp together, with the SweetApp commandline application a full-featured but minimalist CLI wrapper around the library. Then, the graphical GSweetApp or KSweetApp uses that lib to build out the GUI application. Beyond that, there is no authoritative standard and ultimately ...


6

Use of a software internally is not considered a conveyance by the GPL, so you wouldn't have to give source code to anyone. The moment you decide to distribute your software to any third party, then you'll have to follow the terms of the (L)GPL or pony up for a commercial QT license. As for static vs dynamic linking, you can static link with an (L)GPL ...


6

In the case of StackExchange, the technology which allows the server to push notifications to the client is WebSocket. You can check it yourself: open the developers tools and refresh the page; you'll see a call to wss://qa.sockets.stackexchange.com/ and you can even look at the frames, i.e. the messages which were sent by the server to the user or the other ...


6

From a real-life business standpoint, tools come in the back of the to-do list. I agree with your suggested list, though I'd move some things around a bit: Functional requirements. I'm not talking about the amount of RAM the software is going to require but the stuff it is expected to perform. Getting requirements wrong can single-handedly throw your hard ...


6

It depends. In theory, everything is possible and terminating the whole process is the only safe course of action. In practice, we (= my company) do the following: When an unexpected error occurs in the business logic layer or below, we catch the exception in the UI layer, rollback all transactions, log the error, show an error message to the user, and then ...


5

As you pointed out, the child itself seldomly if at all needs to access the parent, as long as the parent does all the work and keeps track of its children. However, the classic getParent is most useful when you use the framework from outside. Scenario A simple operation that may cause problems is the following: given two concrete widgets that are ...


5

Here are more observations from a programmer who has lived in both worlds. I won't repeat points already made in other answers: CLI-based development tends to use a variety of programs, each of which performs 1 function. GUI-based development tends to use 1 big program (the IDE), which performs dozens of different functions. This one difference has several ...


Only top voted, non community-wiki answers of a minimum length are eligible