Tag Archives: C++

Why I Prefer Initialization Through Constructors

I always prefer initializing my class through the use of a constructor like this: class Apple { Color color; Taste taste; List<string> countries; public Apple(Color color, Taste taste, List<string> countries) { this.color = color; this.taste = taste; this.countries = countries; … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Will the destructor be called?

Here’s a C++ quiz for all of you: somefunc() will be called from a thread. Do you think this destructor will be called?

Posted in Programming | Tagged , , , , | 2 Comments

Idioms

What if Was Would the world be a better place?

Posted in Programming | Tagged , , , | Leave a comment

Putting a separator between your elements

Often when I’m programming, I’ll need to list a bunch of stuff and put commas between them. Like this: 1,2,3,4,5 Usually, this is what I, and most of my colleagues do: List nums = new List(); for (int i = … Continue reading

Posted in Programming | Tagged , , , | 1 Comment