|
Search
-
The big issue I have with this question is that Supportability and Compactness or whatever seem to be the same thing: well written code.
Code that is not maintainable does not look "elegant" to me.
Sometimes you need code that looks messy. However it should be hidden away in the background.
Separation of concerns is a big issue to me. ...
-
It works a bit like this:
We pro-create and then little people are born. We all get older and in 20-30 years time they are mating and bringing even younger people into the world.
Meanwhile we slowly decay until we cease to be any more and end up buried under the earth where we get eaten by the worms.
-
[quote user="pkmnfrk"]
BEDMAS:
Brackets
Exponents
Division, Multiplication
Addition, Subtraction
= 6 - 1 x 0 + 2 / 2
= 6 - (1 x 0) + (2 / 2)
= 6 - (0) + (1)
= 6 + 1
= 7
Where did 5 come from?
[/quote]
5 comes from inserting an invisible parentheses that don't belong, opening either before the 1 or the 0 and ending at ...
-
Just done a quick survey of the last 10 articles of each type (not including yesterday's) and the number of comments they have received.
There are the averages:
Tales From The Interview 191.8
Feature Articles 124.2
CodeSOD 106.5
Error'd 64.2
I don't know if it's because people are not around so much on Friday, less so Saturday ...
-
Thunderbird is not in the UK English dictionary? What would Lady Penelope have to say about that one?
Better get Brains on the case...
-
[quote user="PJH"][quote user="Tyler"]std::cout << "Good morning " << ((gender == Male) ? "Sir" : "Ma'am") << std::endl;[/quote] I do, however have issues with things like: syslog(LOG_NOTICE, "WebRelay %s:%d Relay: %s Input: %s Reboot: ...
-
The actual danger of memsetting a pointer to all zero bytes would be if:
1. You then compare the pointer to NULL and it returns false, or you perform a boolean check on it if( ptr ) { ... }
2. if you called free() (or delete) on it, which is guaranteed to be no-op on a NULL pointer but that didn't work on your pointer.
Dereferencing it or ...
-
[quote user="blakeyrat"]Jesus people. Wrong code is wrong code. What does it matter if there's some hypothetical platform in some hypothetical universe in which maybe the code kind of works a little bit even though it's wrong. That doesn't make the code any less wrong.[/quote]
Actually, more commonly in the C and C++ world ...
-
One may memset a pointer to zeros on a platform where this is a null pointer, and it is possible for platform-dependent isPOD() checks for pointers. Similarly with floats and doubles.
GNU actually implements something like this in vector. When you create a C++ vector and resize it (rather than reserve) it must set all its members to the default ...
-
The code is well-defined behaviour if the class is POD:
1. The class has no virtual methods and does not derive from anything with virtual methods
2. All its data members are POD.
If the class contains something like a std::string or a std::vector, your operation is invalid. (Nothing should happen on the call itself but subsequently you may ...
|
|
|