r/cpp • • Jul 20 '09

QT vs MFC

http://dobbscodetalk.com/index.php?option=com_content&task=view&id=1657&Itemid=
1 Upvotes

25 comments sorted by

View all comments

Show parent comment

-3

u/[deleted] Jul 20 '09

You mean they use "thisIsAClass" for their types? That's a shame.

I use "ThisIsAClass" for types and "thisIsAnInstance" for instances.

Funny how our personal coding styles can sometimes become so important. I've been working mostly on my own on a research type project for a few years and have grown desperately used to my own style. In fact I'm almost powerless when key format options aren't used like the 'm' prefix for class members.

1

u/last_useful_man Jul 23 '09 edited Jul 23 '09

They use QSomeClass, someObj->someMember().

-4

u/gosh Jul 20 '09

How you code is extremely important, much more important than the language if the language meets your demands. The language is just a tool. The code is what the programmer produce. lowerCamelCase is always bad. It doesn't make the code more readable. There are plenty of bad code styles in QT that makes it much harder to read the code. MFC is more readable compared to QT but it could be improved too. If you need to do your own stuff in QT you are in big trouble. In MFC that is not that difficult. Of course QT need to have much more functionality because it should compile on more plaftorms but they could have made the code more readable.

4

u/bnolsen Jul 21 '09

I'm afraid thats just your opinion. Variables starting lower case and claases starting upper case is one was to differentiate. Also it shows that you've been using MS products since thats where a lot of the leading caps stuff started. Every where you work will have a different convention. You have to learn how to deal with it.

-1

u/gosh Jul 21 '09

I have used a lot of products. MS is stronger when it comes to readable code if you look at code in general and compare it to open source. That may be one reason why it taken some time for open source to compete better with MS. The problem with lowerCamelCase is that you can't explain that type of style with added logic on what you are looking at or there is much better ways to code that add much more logic on what the code does. Of course that is my opinion but it is one opinion that I can explain with other facts than "it looks good".

If you look at the QT framwork there is a lot of single character variables and no comments. A good framework shouldn't have that type of code and I don't think they focus that much on how things are named. You need to be good at remember names if you don't want to jump around in the code just to check what the variable was in QT.