8,642 reputation
22539
bio website
location Bellingham, WA
age 33
visits member for 4 years, 8 months
seen 16 hours ago

May
10
comment Whether to use -pedantic flag in g++ or not?
@JaredBurrows: Actually I've stopped using -pedantic with C++ since GCC's manual implies it's only meant for C, and I've moved up to using -std=c++14 in new projects.
Apr
24
comment Can someone else copyright my wordpress plugin if I don't own any copyright for it?
@YazadKhambata: You can't "not Copyright" something in a country where it's automatic. The closest you can do (in countries with no Public Domain) is to release all your rights on the work, which is what the Creative Commons Zero license does. It's not even legally clear if Public Domain dedication is even possible in countries that have it.
Apr
24
comment Can someone else copyright my wordpress plugin if I don't own any copyright for it?
This is not exactly correct. Copyright is automatic when the work is put in a "fixed form," and this is the case in all countries that are signatories of the Berne Convention. Assertion of Copyright only clarifies the ownership. Registration is not required in any of these countries. However, registration makes prosecution of Copyright infringement a great deal easier, since it short-circuits the process of establishing ownership. Assertion is also a good place to specify which rights are offered to recipients. ("All rights reserved" means, I believe, "none are offered.")
Mar
22
comment Open source License that doesn't require credit
@StephenC: If you object to my list, do you have better examples? These are the best examples of extremely permissive licenses I know of.
Mar
11
comment Is every language written in C?
@JonathonWisnoski: Yes, and I tried to make that clear: Until you have a working compiler, it's not possible to write a compiler for a language in that language. It's the chicken-and-egg problem. Others have pointed out that you can "compile" a language by hand, but that's still writing a compiler in another language, just with the extra step of translation. But the goal of most languages is to ultimately self-compile the compiler in the language, as nearly all C compilers do today.
Feb
28
comment raw, weak_ptr, unique_ptr, shared_ptr etc… how to choose them wisely
@Deduplicator: I've made a relevant edit. Please correct it if it's still wrong.
Feb
28
comment raw, weak_ptr, unique_ptr, shared_ptr etc… how to choose them wisely
@Deduplicator: My wording must have been unclear: The shared_ptr is a separate object - a separate allocation - from the newed object. They exist in different locations. make_shared has the ability to put them together at the same location, which improves cache locality, among other things.
Feb
28
comment raw, weak_ptr, unique_ptr, shared_ptr etc… how to choose them wisely
@Zilators: Please note my added comment about Qt. The answer to your question about whether all three pointers should be managed depends on whether Qt objects will behave well.
Feb
27
comment Should a bin directory be full of shell scripts?
If this isn't on-topic for programmers.se, maybe this is appropriate for the Unix stackexchange?
Feb
21
comment How is a dictionary better than a big switch, when mapping data to action?
@AvivCohn: It's better in that you can add a given Action associated with a given string at runtime instead of statically hard-coding every possible choice. This gives you the option of loading a configuration or dynamically determining the state machine as the program runs. You'd do this, for example, in a game where you want to remap actions to inputs so that the player can change what kind of input layout they want to use.
Feb
18
comment Is a makefile really needed
(As to files like utilities.cc: These are cases where functions don't have functional relationship, so it only makes sense to put them in a generically-named file.)
Feb
18
comment Is a makefile really needed
It may be subjective, but maintaining order is important as programs grow in size. My rule of thumb is that each translation unit should be eligible for unit-testing, independent of (most of) the rest of the whole program. Choosing an arbitrary size or limit leads to segmenting functionality in ways that disguise poor code architecture. You're right that it's not a rule - I'm just saying that your suggested guideline is generally ill-advised without lots of caveats.
Feb
18
comment Is a makefile really needed
Rather than being so vague as to say "translation units with x lines," you should consider saying "translation units should represent a logical unit of functionality - related functions and classes that encompass a feature." Translation units should be as big as they need to be and no larger. Putting a number on it is misleading.
Feb
8
comment Is it not direct usage of primitive pointer types form of Primitive Obsession?
There is no pattern or anti-pattern that is an absolute, including this one. Just because using primitive types can be an anti-pattern will never mean that that is always the case. Case in point, C++ pointers are a form of responsibility management, which is why we have things like shared_ptr, weak_ptr, and unique_ptr.
Feb
1
comment When are you violating a license like the GPL?
There are licenses that are, of course, GPL-incompatible. If a GPL work is combined with a work that is under a license more strict than the GPL, it violates the GPL. You can't combine it with the CDDL, for example. Basically, if it's not on the FSF's approved licenses list, it's incompatible.
Jan
28
comment are multithreading, multiprocessing, multitasking implemented at instruction set or OS?
@Jules: Interesting. Good to know. I think I made reference to a related idea, however: see GreenArrays.
Jan
28
comment are multithreading, multiprocessing, multitasking implemented at instruction set or OS?
@whatsisname: True, but at a conceptual level, there's little difference between software multithreading and hardware multithreading beyond implementation.
Jan
28
comment are multithreading, multiprocessing, multitasking implemented at instruction set or OS?
@Tim: Yes. How would you expect them to be implemented in the OS, when the terms "pipelining" and "superscalar architectures" relate specifically to how the CPU executes instructions, and vector computation is a term reserved for single-instruction-multiple-data CPU architectures?
Jan
7
comment Needs (in principle) C++ parenthesis around if statement condition?
The standard could be changed, yes, but he'll have to take that up with the committee. I don't see any reason they'd accept it, though.
Dec
29
comment Is every language written in C?
@BasileStarynkevitch: If something can not be done in portable C, then it can not be done in non-portable assembly language. By your assertion, Haskell can't exist. No, continuations, closures, etc., can all be simulated straight-forwardly using well-known and common techniques. Realize that all of those things you named can be done just by clever manipulation of stack allocations (with the exception of closures, which can be done trivially on the heap; remember that C++ recently got closures and is getting continuations in a future standard, both of which already exist in libraries.)