28,264 reputation
247110
bio website coderscentral.blogspot.com
location Colorado Springs, CO
age 50
visits member for 4 years, 1 month
seen yesterday

Started programming on a Control Data mainframe in FORTRAN IV, back when that was still a new thing. Was apparently quite masochistic, because I kept programming anyway. For that matter, I still do...

Gold C++ badge #20
Gold C badge #12
Legendary badge #35


Sep
30
awarded  Explainer
Sep
19
awarded  Nice Answer
Sep
16
comment What is the history of why bytes are eight bits?
@Pacerier: Feel free. I'm not going to sign up for a site I don't care about just to correct them on a subject that doesn't matter much anyway.
Sep
15
comment What is the history of why bytes are eight bits?
@Pacerier: Unfortunate, some of the information there is just plain wrong (e.g., it says the PDP-10 was a 32-bit machine, but it was actually a 36-bit machine).
Sep
10
revised How to avoid redundant code in designing inheritance in C++
added 905 characters in body
Sep
10
answered How to avoid redundant code in designing inheritance in C++
Sep
10
comment How to abide the “allocate in caller” rule when the size is computed in the callee?
This looks to me like it applies almost exclusively to C, not C++. In C++, instead of handle_init, handle_do and handle_free, you almost certainly want an object with init handled in the ctor, free handled in the dtor, and do handled in a member function--possibly but not necessarily an operator(). Allocation probably should be internal to the object, likely via a std::unique_ptr or some other smart pointer type.
Sep
10
comment How to do a clean refactoring of an If Else Code without leaving any free blocks?
@ADTC: I think you're reading more into his wording than was really intended. If you read through the comments, you'll see that his concern isn't really with the order in which the conditions are evaluated, but with ensuring that statement2 is evaluated only if condition1 is false. My last sentence does cover the other possibility, but his comments made it sound as if that wasn't really the intent.
Sep
9
awarded  Yearling
Sep
5
comment What imperative programming languages do not support recursion?
@Panzercrisis: I'm not sure whether IBM was involved in the x86, but their current mainframes trace directly back to the IBM 360, which came on the market in 1964, so the basic design predates the x86 by a couple decades or so.
Aug
31
answered Is this a good design in C++?
Jul
2
comment How bad is it calling println() often than concatenating strings together and calling it once?
I see you don't know what ad hominem means either. An ad hominem argument is one of the form: "this argument should not be believed because the person making the argument is evil.". I simply pointed to the fact that your argument made no sense: the subject of discussion is levels of abstraction, yet you proclaim that abstractions are irrelevant. That's a solid indication that you don't understand the subject.
Jul
2
comment How bad is it calling println() often than concatenating strings together and calling it once?
@Phoshi: Ignoring abstractions indicates that you don't understand the subject matter, since abstraction is exactly what's under discussion.
Jul
2
comment How bad is it calling println() often than concatenating strings together and calling it once?
@Phoshi: Try with resources isn't even vaguely similar to RAII. RAII allows the class to manage the resources, but try with resources requires the client code to manage the resources. The features (abstractions, more accurately) that one has and the other lacks are entirely relevant--in fact, they're exactly what makes one language higher level than another.
Jul
2
awarded  java
Jul
1
comment How bad is it calling println() often than concatenating strings together and calling it once?
@200_success: Java doing the string concatenation at compile time seems to come down to §15.18.1: "The String object is newly created (§12.5) unless the expression is a compile-time constant expression (§15.28)." This seems to allow but not require that the concatenation be done at compile time. I.e., the result must be newly created if the inputs are not compile-time constants, but no requirement is made in either direction if they are compile time constants. To require compile-time concatenation, you'd have to read its (implied) "if" as really meaning "if and only if".
Jul
1
comment How bad is it calling println() often than concatenating strings together and calling it once?
Actually, it's Java that requires explicit memory management. In C++ I write something like: MyClass c; and it allocates an instance of MyClass. In Java I have to use MyClass c = new MyClass(); to allcoate it. Better still, RAII let's me automate management of other resources as well, where Java forces me to use a try/catch/finally in a lame imitation of what C++ destructors provide much more cleanly. Your own argument leaves us with only one reasonable conclusion: Java is a lower level language handicapped by lower-level I/O facilities.
Jul
1
comment How bad is it calling println() often than concatenating strings together and calling it once?
Throughout I point to the objective basis for Java being the lower level language. Not sure what line terminators you're talking about.
Jul
1
answered How bad is it calling println() often than concatenating strings together and calling it once?
Jun
13
comment Memory read/write access efficiency
If it's small enough to allocate directly on the stack, that's almost always preferred.