It's easy to pick up Delphi today :)

Source: Internet
Author: User
Today, I wrote a Win32 service that listens on the socket port and regained Delphi. I felt that everything was so easy. Just a few words were completed. Previously, I used C ++ to encapsulate window service, it really hurts me. C ++ is really powerful, but it is too complicated. It takes a lot of effort to understand its syntax, let alone use it. For example:
  1. In Delphi, everything is Pointer. Java has no pointer at all, and C ++ has pointer and value transfer, which is very confusing.
  2. All functions in Java are virtual. To rewrite virtual functions in Delphi, you must specify the override keyword (otherwise, the compiler will warn ), in C ++, if the number of virtual function parameters to be rewritten is declared incorrectly or the function name is declared incorrectly, it will cause a lot of trouble (simply put, it does not require the override keyword, or the new keyword in C # to override the base class function ).
  3. In Delphi, reference counting is quite elegant. As long as it is an iunknown, the compiler will implement reference counting in the background, and no one will use it to automatically destroy it; while C ++ has to use a template class for its own encapsulation, then, change the pass pointer to pass the template class object with the pointer (pass by value)
  4. The try in the C ++ standard is not as good as that in Delphi (for example, there is no finally ).

......
......

Of course, using C ++ is still a lot of fun, for example, STL, for example, its template ............

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.