Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re:No --- really --- it isn't (Score 2) 38

Just to add to QRDeNameland answer... GCompris switched from GTK to Qt. Thousands (millions?) of users. AutoDesk's Maya is using Qt. Thousands of users (professionals and non-professionals). WorkNC is using Qt. Thousands of professional users. Seems pretty mainstream.

Comment Re:I don't like QT (Score 5, Interesting) 38

The same rants again and again...

It's not C++

Qt requires a C++ compiler, it uses classes, namespaces, templates... looks like C++.

they have their own little language that compiles to C++ using an external compiler

False. If you're refering about "moc", it just provides implementations for functions declared through various macros (Q_OBJECT, Q_PROPERTY...). If you use their meta-make (qmake) or some other Qt-aware tool (CMake, VisualStudio with Qt plugins, ...) this is mostly transparent. No "little language" here.

It has crappy alternatives for everything in STL that work just slightly different but not any better.

Qt supports a wide range of C++ compilers since 20 years, including some which were not quite standard conformant or were not providing a "good enough" STL. So Qt provided its own containers. But their use is required only when use some Qt APIs: you can freely and happily use STL containers everywhere else. In more recent versions, Qt's containers provide an API (alongside the Qt one) pretty similar to STL's one. Also they're often seen as easier to use by C++ beginners or non-expert.

It has copy-on-write.

Copy-on-write was very interesting at some point in time. As everything, it's not perfect, but in some cases it was very handy, for example allowing to return large objects by value, allowing great speedup for compilers not knowing about RVO (Return Value Optimisatin). Today it is probably superseded by the move semantic, but this is a rather recent improvement to C++ and maybe not yet supported by all compilers that Qt supports.

It doesn't use inheritance, but gives you endless lists of almost-identical function calls (all those functions to add controls, for example).

Look at the hierarchy of classes inheriting from QObject, look at all the virtual functions that can be overloaded by the user. Inheritance is actually used at large. And most of the "almost identical functions" are there for a purpose.

And that stupid Q everywhere you look is just painful.

Totally subjective and mostly irrelevent. What about those "stupid" gl/GL_ prefixes in OpenGL, vk/VK_ in Vulkan, the "G" in GTK, the "C" for all MFC classes (as if we didn't know already we were dealing with classes), and so on. Of course Qt is not perfect - no one is saying that. Using it daily in a millions-lines (commercial, expensive, closed-source) project, I have my share of gripes against it. But it's the same with any framework. After having used various frameworks in non-trivial projects (GTK+, wxWidget, MFC and a handful of others), for C++ I see Qt as "the best" framework - which in some cases means "the least bad", and never means it's perfect.

Comment Re:Sad, if true (Score 1) 376

"moc" provides introspection you would hardly get another way

Not true. You can get it with plenty of other ways, including normal usage of the embedded preprocessor.

I wrote "hardly", not "impossible". Now you may be of the elitist kind of people which assume everyone should be able to write and use something like Boost::MPL for breakfast, but in the real world easy tools are sometimes welcome.

That's still OOP and C++.

Associating C++ with OOP is a problem. It's a multi-paradigm language. OOP has very few valid use cases. If you want OOP abused everywhere, use Java.

Notice I said "OOP and C++": I did not say "OOP is C++" nor the other way around.

Qt does not duplicate the STL, it provides similar functionalities

It has its own set of containers, strings, iterators, all of which use are not conforming to the standard concepts. They might have better implementations in some cases (for example a custom hash map implementation optimized for a given usage pattern might be faster than the general-purpose one of your standard library implementation), but the design is not as well-crafted and is significantly less flexible.

Less flexible, quite true. But again, overall easier to use. Now their containers provide the usual "::iterator" and "::const_iterator", making them looking quite similar to STL containers. Even QString provides begin() and end().

Indeed it uses COW almost everywhere it might make sense.

COW never makes sense unless it's used to implement partial data sharing within a larger data collection. That's not the case in Qt. In Qt it's just used because the bad design forces the framework to copy many objects even though it's not needed.

The thing is, quite often data is shared in a heavyweight GUI app. It may be mostly useless in Qt itself, but it's quite usefull when you *use* Qt. Now we can talk about "good" or "bad" design: I tend to prefer a design which may not be academically perfect, but clean and easy to read and use. When you have to maintain several millions LOC, perfection may have different meanings.

Sometimes it's a real nice thing to be able to return a QString by value for (almost) free

I don't understand how that's related. Returning a local variable or temporary variable by value is always "free" (doesn't call copy constructors) regardless of COW. It's called NRVO, though that it is a silly name. It's not really an optimization. It's more a matter of ABI.

ABI which is not standardized, last time I checked. Here the optimization is provided by the framework, not relaying on the compiler. That said, if you don't like it, then don't use it... as simple as that.

don't forget all of this was created long before we had rvalues and move semantic in C++.

rvalue references allow to distinguish lvalues and rvalues at the language level. There was no problem implementing move semantics by handling rvalues explicitly. Before C++11, people used swap when they needed to move. Qt containers didn't even have swap before 4.7 (2010).

Don't take my poor example for more than it is... There's more in sharing data than just moving. Granted, it's pretty useless for a "Hello world" label.

"Good" language features are usually "modern" language features (sure, not always, I know). Because Qt tries to be available for older compilers, even awful proprietary ones (Visual C++ anyone?), it has to do tradeoffs here and there.

Current Qt only works with Visual C++ 9 (2008) and higher, Visual C++ 10 (2010) or higher is even highly recommended. Decent C++ support has been available since Visual C++ 7.1 (2003).

I wouldn't call "decent" the C++ support in Visual 7.1. Not even in Visual 2010. Visual 2012 is getting close to be "decent", although "decent" is pretty far from "good".

About typesafety, well... I won't really disagree on this one ;-) but it's a real minor concern really

Type safety, a minor concern!? The point of C++ is that it has a powerful type system that can catch errors. Type errors are ones of the worst type of errors you can have in a program.

It's a minor concern in the context of using Qt. Feel free to write typesafe code around it.

Comment Re:Sad, if true (Score 1) 376

"moc" provides introspection you would hardly get another way, at the cost of a single macro (Q_OBJECT) and automatically generated code. That's still OOP and C++.

Qt does not duplicate the STL, it provides similar functionalities, but arguably simpler to use. Indeed it uses COW almost everywhere it might make sense. Sometimes it's a real nice thing to be able to return a QString by value for (almost) free - don't forget all of this was created long before we had rvalues and move semantic in C++.

"Good" language features are usually "modern" language features (sure, not always, I know). Because Qt tries to be available for older compilers, even awful proprietary ones (Visual C++ anyone?), it has to do tradeoffs here and there.

About typesafety, well... I won't really disagree on this one ;-) but it's a real minor concern really, given the enormous benefits the whole framework provides.

By the way, I've been using Qt for... oh my, 16 years already??


Solar Car Speed Record Smashed 72

An anonymous reader writes with word from Australia that "There's a new world record for the fastest solar-powered land vehicle: 88 km/h average speed over one kilometre in a lightweight car that uses about the same power as a toaster." As the article goes on to explain, this solar racer, built last year by students from the University of New South Wales, managed to nab that speed record earlier this month on an Australian navy base airstrip.

Sex Drugs and Texting 287

statesman writes "The Associated Press reports that teens who text frequently are three and a half times more likely to have sex. A survey of 4,200 public high school students in the Cleveland area found that one in five students sent more than 120 text messages a day or spent more than 3 hours a day on Facebook. Students in this group were much more likely to have sex. Alcohol and drug use also correlate with frequent texting and heavy Facebook use."

NASA Parodies Reach New Level of Awkwardness 28

MMBK writes "NASA TV recently produced six movie-trailer parodies about current projects for a 'themed exhibit at an international conference.' But for the most part, the attempt remains pretty corny, far, far away from the imaginative, inspiring work of space artists like Bruce McCall."

Officials Sue Couple Who Removed Their Lawn 819

Hugh Pickens writes "The LA Times reports that Orange County officials are locked in a legal battle with a couple accused of violating city ordinances for replacing the grass on their lawn with wood chips and drought-tolerant plants, reducing their water usage from 299,221 gallons in 2007 to 58,348 gallons in 2009. The dispute began two years ago, when Quan and Angelina Ha tore out the grass in their front yard. In drought-plagued Southern California, the couple said, the lush grass had been soaking up tens of thousands of gallons of water — and hundreds of dollars — each year. 'We've got a newborn, so we want to start worrying about her future,' said Quan Ha, an information technology manager for Kelley Blue Book. But city officials told the Has they were violating several city laws that require that 40% of residential yards to be landscaped predominantly with live plants. Last summer, the couple tried to appease the city by building a fence around the yard and planting drought-tolerant greenery — lavender, rosemary, horsetail, and pittosporum, among others. But according to the city, their landscaping still did not comply with city standards. At the end of January, the Has received a letter saying they had been charged with a misdemeanor violation and must appear in court. The couple could face a maximum penalty of six months in jail and a $1,000 fine for their grass-free, eco-friendly landscaping scheme. 'It's just funny that we pay our taxes to the city and the city is now prosecuting us with our own money,' says Quan Ha."

Examining Virtual Crimes 85

GamePolitics has an article about a research paper issued by the AU government's Institute of Criminology titled "Crime Risks of Three-Dimensional Virtual Environments." The paper discusses the legal questions raised by game worlds and avatars, ranging from regulation of in-game currency to a report of virtual rape. "A person controlling an avatar that is unexpectedly raped or assaulted might experience the physical reaction of 'freezing,' or the associated shock, distrust and loss of confidence in using [3D virtual environments]. While civil redress for psychological harm is conceivable, the 'disembodied' character of such an incident would invariably bar liability for any crime against the person. However, Australian federal criminal law imposes a maximum penalty of three years imprisonment for using an internet carriage service to 'menace, harass or cause offence' to another user. Further, US and Australian laws ban simulated or actual depictions of child abuse and pornography. Therefore, any representations of child avatars involved in virtual sexual activity, torture or physical abuse are prohibited, regardless of whether the real-world user is an adult or child."

Man Uses Drake Equation To Explain Girlfriend Woes 538

artemis67 writes "A man studying in London has taken a mathematical equation that predicts the possibility of alien life in the universe to explain why he can't find a girlfriend. Peter Backus, a native of Seattle and PhD candidate and Teaching Fellow in the Department of Economics at the University of Warwick, near London, in his paper, 'Why I don't have a girlfriend: An application of the Drake Equation to love in the UK,' used math to estimate the number of potential girlfriends in the UK. In describing the paper on the university Web site he wrote 'the results are not encouraging. The probability of finding love in the UK is only about 100 times better than the probability of finding intelligent life in our galaxy.'"

Antarctic's First Plane, Found In Ice 110

Arvisp writes "In 1912 Australian explorer Douglas Mawson planned to fly over the southern pole. His lost plane has now been found. The plane – the first off the Vickers production line in Britain – was built in 1911, only eight years after the Wright brothers executed the first powered flight. For the past three years, a team of Australian explorers has been engaged in a fruitless search for the aircraft, last seen in 1975. Then on Friday, a carpenter with the team, Mark Farrell, struck gold: wandering along the icy shore near the team's camp, he noticed large fragments of metal sitting among the rocks, just a few inches beneath the water."

Game Design: A Practical Approach 85

Aeonite writes "As the title suggests, Game Design: A Practical Approach presents a practical approach to game design — one that is almost too practical in places. The book does a good job of covering many of the foundational elements of game design (called "atoms" by the author), but in places the level of practical detail — and the heavy focus on Lua code examples — is a bit hard to work through. Readers allergic to code may find themselves skipping over swaths of text instead of actually reading it." Read below for the rest of Michael's review.

Slashdot Top Deals

You know, Callahan's is a peaceable bar, but if you ask that dog what his favorite formatter is, and he says "roff! roff!", well, I'll just have to...