Results 1 to 15 of 15

Thread: OO programming

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: OO programming

    Quote Originally Posted by wysota View Post
    Jacek already gave you two good hints.

    I'd like to note one thing, Mickey. I have noticed some time ago that you desperately try to use existing STL calls or "STL-ize" your code when there is no need of doing it or when the STL call does something similar (as opposed to "the same") to what you want. Placing STL calls everywhere can easily make your code unreadable or can even break it if you happen to use a faulty STL implementation (remember that only the API is the standard, not the internal implementation of the library). Simple solutions are usually the best and there is no benefit from spending hours trying to wrap the functionality you want to obtain into an STL (or place another of ones favourite library name here, Qt included) call.
    It's not clear;
    Are you saying to don't use std:max_element? (and write it by myself)
    I can simply put into a namespace a function double computeMax() { }, but for my application the datas are in vector<Value> and I think that I'll have to pass this vector to computeMax()
    so I'll have computeMax(vector<Value>& vec) { }, BUT in this way I have a function that is coupled with that vector.......
    Probabibly I don't understand....
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: OO programming

    I say not to try to find a matching STL call where a single line of simple hand written code would be sufficient. This was a general remark, not a remark to this particular situation, at least not only.

Similar Threads

  1. Windows programming in Qt (serial communication)
    By bnilsson in forum General Programming
    Replies: 17
    Last Post: 9th February 2010, 18:17
  2. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  3. QT COM Programming
    By sarav in forum Newbie
    Replies: 5
    Last Post: 24th February 2007, 13:41
  4. Using QGraphicsView with model/view programming
    By JLP in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 11:04
  5. MODEL/VIEW programming
    By mira in forum Newbie
    Replies: 3
    Last Post: 21st April 2006, 11:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.