FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++ Blog
C++
void main(void)

Calls, Returns and In-Between.

by Kevin Carlson
July 24, 2007

A Little Ada with Your C++


Rich Herrick liked his ranged types in Ada, and missed them when developing in C++. So he rolled his own, and now he has some protection from out-of-range and overflow conditions in his code. Sure, there's some overhead, as there always is when trading execution or compile time for safety, but Rich's implementation does a pretty good job of limiting the cost, and maximizing the benefit. Check out Ada-style Ranged Types in C++.

Posted by Kevin Carlson at 02:46 PM  Permalink |


July 10, 2007

What Concurrency Language Do You Speak?


Herb Sutter kicks off a new column in DDJ this month talking about concurrency—but not in the way you might expect. Before you can even begin any work on concurrency, he argues, you need to figure out which mental space you occupy: which "pillar" of concurrency is defined by your requirements and techniques. Concurrency is one of those areas of programming about which two knowledgeable developers can have a conversation, and not understand a word the other person is saying. Part of the problem is vocabulary; but vocabulary is just surface layer of what can be deeper divisions between philosophies. Knowing the distinctions between the various approaches is a critical first step into concurrency. Check out Herb's "The Pillars of Concurrency."

Posted by Kevin Carlson at 02:35 PM  Permalink |


June 22, 2007

Keeping Track of Objects


If you're tired of tracking down null pointer dereferences and invalid pointer dereferences, then you might be ready to try out the Object Registration and Validation (ORV) pattern. With it, you can perform consistent sanity checks to guarantee you don't use an object that no longer exists. Eric Gufford shows you how.

Posted by Kevin Carlson at 10:10 AM  Permalink |


June 11, 2007

Know Your Attributes


C++/CLI provides a way to describe your code to the runtime, or to specify certain behaviors at run time: They're called attributes. Rex Jaeschke describes some of these attributes provided by the .NET Framework in his latest article, "C++/CLI: Attributes."

Posted by Kevin Carlson at 01:49 PM  Permalink |


May 29, 2007

Follow the Rules


The flexibility of a rule-based system is one reason it has been such a popular choice in the AI field for so long. You don't need to perfectly understand the system you are modeling ahead of time. You can write your program, but later change the knowledge on which the rules operate without redesigning the whole system. There are some very specialized expert systems designed for writing just these kinds of programs, but sometimes, you just want some good 'ol, plain-vanilla C-style capabilities built in to your rule-based program. In this case, an approach like that presented by Lynwood Wilson in "Rule-Based Programming in C" might be just the ticket.

Posted by Kevin Carlson at 02:08 PM  Permalink |


May 22, 2007

CLI Cleanup Complexities


Object cleanup is one place where C++/CLI requires considering a bit more than is necessary with standard C++. Standard C++ achieves object cleanup with a destructor, but CLI uses a finalizer. In the C++/CLI world, it pays to know how both of these facilites work, and when to use them. Rex Jaeschke continues a long-running series of articles on C++/CLI with his latest, this time on Destructors and Finalizers.

Posted by Kevin Carlson at 02:21 PM  Permalink |


May 08, 2007

Thread-safe Singletons


Vladimir Kliatchko found recently that there wasn't a universal solution for the thread-safe initialization and destruction of Singletons. A C++ file-scope variable for initialization wouldn't work, and the pattern he turned to, the Meyers Singleton (in which the Singleton is intialized upon first use) didn't really solve the thread safety issue. Here's what Vladimir came up with as a solution.

Posted by Kevin Carlson at 01:26 PM  Permalink |


April 24, 2007

Learn About Vista, Win a Squeezebox


How can you get the most out of your C++ experience when programming for Vista? One way is to attend "Bringing C++ to Vista: Leveraging Your C++ Code-Base to Create Native Windows Vista Applications," a one-hour Netseminar presented June 20 by Dr. Dobb's Journal and MSDN Magazine. You'll learn how to incorporate multithreading into your Vista apps, as well as how to leverage one codebase to target additional operating systems. Attendees who fill out a feedback form will be automatically entered in a drawing to win a free Slim Devices Squeezebox.

Posted by Kevin Carlson at 01:39 PM  Permalink |


April 17, 2007

Nearest Neighbor on All Lines


Sometimes even well-understood problems can grow significantly thornier when the variables involved scale up dramatically. Take the problem of joining up the ends of line segments—the algorithm for finding the nearest point on a set of lines to a given point is a common one in modern graphical computing. But when the data sets you're working with become huge, that simple algorithm can take days to execute. Stefan Wörthmüller presents an optimized approach in "Accelerated Search For the Nearest Line."

Posted by Kevin Carlson at 10:22 AM  Permalink |


April 09, 2007

Hash Containers: Under the Hood


Choosing the right data structure up front can buy you dramatic performance gains, saving you long hours of optimization later on. But nothing is a silver bullet. Thomas Johnson examines STL hash containers like hash_map, hash_set, hash_multimap, and hash_multiset, which are to be included in TR1 in the form of unordered_map, unordered_multimap, unordered_set, and unordered_multiset, in his article "C++ STL Hash Containers and Performance."

Posted by Kevin Carlson at 12:56 PM  Permalink |



February 2008
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29  


BLOGROLL
 
INFO-LINK


Techweb
Informationweek Business Technology Network
InformationweekInformationweek 500Informationweek 500 ConferenceInformationweek AnalyticsInformationweek Events
Informationweek MagazineGlobal CIOIWK Government ITbMightyByte and SwitchDark Reading
Digital LibraryIntelligent EnterpriseInternet EvolutionNetwork ComputingPlug Into The CloudDr. DobbsContentinople
space
TechWeb Events Network
InteropVoiceConWeb 2.0 ExpoWeb 2.0 SummitEnterprise 2.0Mobile Business ExpoNoJitter
Black HatGTECEnergy CampCloud ConnectGov 2.0 ExpoGov 2.0 Summit
space
Light Reading Communications Network
Light ReadingLight Reading AsiaUnstrungCable Digital NewsInternet EvolutionPyramid Research
Heavy ReadingLight Reading LiveLight Reading InsiderEthrnet ExpoTelco TVTower Technology Summit
space
Financial Technology Network
Advanced TradingBank Systems and TechnologyInsurance and TechnologyWall Street and TechnologyAccelerating WallstreetBST SummitBuyside Trading SummitIT Summit
space
Microsoft Technology Network
MSDNTechNetTotal IT ProTotal Dev ProNET Total Dev Pro CommunitySQL Total Dev Pro Community
space