chamaeleon

joined 1 year ago
[–] [email protected] 2 points 1 year ago

The first thing that comes to mind for me is The Ray Tracer Challenge book.

http://raytracerchallenge.com/

[–] [email protected] 2 points 1 year ago

It was already mentioned by @RHOPKINS13 so I didn't bother.

As for Qt itself, I wasn't thrilled with their path regarding licensing back in the day, like only allowing GPL (not LGPL) on Unix like systems and attempting their own special licenses, and only offering a paid commercial license for Windows development. These days I can't say I find the $300+/month subscription option for commercial usage very appealing either. They can of course do whatever they want, just as I look at what is at my disposal and what's out there and choose according to my needs and preferences (which may be very different from other individuals). Essentially, their decisions early on soured my opinion of Qt (regardless of any technical merits), and since those days I have always had other options that have worked well enough for me. It may also have played a role in my relative lack of interest in KDE,

I'm just expressing my feelings, and it is not a statement whether anyone else should make any specific choices. :)

[–] [email protected] 6 points 1 year ago* (last edited 1 year ago) (3 children)

Since you said any language, you have Free Pascal and its gui editor Lazarus.

För wxWidgets and C++ you have wxFormBuilder.

The Glade editor for gtk3 programs (C, C++, or whatever language one might use). (edit: just a gui editor that is used separately from whatever IDE or editor you write your code in)

Eclipse and WindowBuilder for Java.

[–] [email protected] 1 points 1 year ago

For these kinds of expressions, I really like to use the ternary operator. I find that more readable. An if statement with a condition and two simple possible return values like your code can be written as

return (value == 1) ? "Yes" : "No";

The return keyword is not part of the ternary operator. The definition is "<condition> ? <value if true> : <value if false>".

As the operator is an expression, the result of it can be assigned to a variable of course. But in your code example there is no need for a local variable to hold the result so it can just be returned.

If the expressions for the condition, or true or false results get too complicated I'll switch to if/else for readability (the question mark or the colon might get harder to spot).

view more: ‹ prev next ›