What are the advantages and disadvantages of using templates in Word documents?


Answer: Many things can be possible without using templates but it does offer several clear advantages not offered by any other techniques:
Advantages:
Templates are easier to write than writing several versions of your similar code for different types. You create only one generic version of your class or function instead of manually creating specializations.
Templates are type-safe. This is because the types that templates act upon are known at compile time, so the compiler can perform type checking before errors occur.
Templates can be easier to understand, since they can provide a straightforward way of abstracting type information.
It helps in utilizing compiler optimizations to the extreme. Then of course there is room for misuse of the templates. On one hand they provide an excellent mechanism to create specific type-safe classes from a generic definition with little overhead.
Disadvantages:
On the other hand, if misused
Templates can make code difficult to read and follow depending upon coding style.
They can present seriously confusing syntactical problems esp. when the code is large and spread over several header and source files.
Then, there are times, when templates can "excellently" produce nearly meaningless compiler errors thus requiring extra care to enforce syntactical and other design constraints. A common mistake is the angle bracket problem.

Language Arts & World Languages

You might also like to view...

Read the passage, then mark the statements that follow true (T) or false (F).

??????????????????????????????????wénzh?ng, article?????????????????????????????????????????????????????????????????????????????????????????????????????????????????chá, to look up???????????????????“???????????????????”??“???????????????????????”????“?????????”???“??????????????????????????????????????????”????“???????????????”??“?????????????????????????????????????????????????”???“????????????” ??????????“????????????”??“????????????????????????????????????????????”????“??????????????”??“??????????????????????????????????”????“????????????????????????”???“?????????????” ___ 1. Li Ming has to write an essay based on his reading of an English novel. ___ 2. He was lucky enough to get the novel from the library, so he didn’t have to buy one in the bookstore. ___ 3. The novel is not hard for him to comprehend but it's very boring, so he is reading it quite slowly. ___ 4. His roommate admired his English, seeing him reading a novel in its original version. ___ 5. Li Ming plans to finish reading by Friday, so that he can go out with friends to celebrate his birthday. ___ 6. Li Ming is so busy and tired this week that he falls asleep every time he reads the novel. ___ 7. Li Ming hasn’t made much progress so far, so he’s worried he can’t finish his essay on time.

Language Arts & World Languages

There is a long rich background behind the beautiful, large, blue diamond which is in

the Smithsonian's collection. Its luster and hue is an enigma. It is referred to as the Hope Diamond, and has had many owners in the past. It had been owned at one time by Louis IVX and was stolen during the French revolution. It actually had been used to pay off a gambling debt and auctioned for a charity. Many have spoken of its curse. According to legend, the diamond had originally been one of two eyes of an Idol in India. The eye that was stolen is said to have the curse of death to all who own or touch it. Because of the misfortune that befell some of the previous owners of the diamond, it is a relief to many; that the Hope Diamond is displayed for all behind a protective glass case. a) The Hope Diamond is cursed. b) The Hope Diamond is a large and rich diamond with a large and rich history. c) The Hope Diamond was owned by Louis IVX and given to his queen. d) The Hope Diamond was stolen from an Idol in India.

Language Arts & World Languages

Minor details give more information about the main idea

Indicate whether the statement is true or false

Language Arts & World Languages

Because we are mortal, we will eventually

a. win a million dollars b. live forever c. die d. have a car accident

Language Arts & World Languages