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

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.)
Dec
28
comment Is every language written in C?
@BasileStarynkevitch: Why?
Dec
28
comment Is every language written in C?
@BasileStarynkevitch: This is why C is called the lingua Franca of programming. It's so ubiquitous that it's the standard for all FFI, so it's nearly impossible to find a language that doesn't have a C interface of some kind. If there is a modern language that doesn't use C somewhere, I don't know of it, but ML dialects and languages like Fortran and Pascal have historically minimized the presence of C, either by predating it or because they're effective systems languages already.
Dec
26
comment Is every language written in C?
@mathguy54: There are more than one implementation of each, but: OCaml is bootstrapped with C and written in its own ML dialect. Glasgow Haskell is written in Haskell and compiles to C. There are hundreds of Scheme compilers, some written in C, some in Scheme, some in ML, several in JavaScript, and many others. The goal of most languages is to be self-hosting, so that they can compile their own source code. C is a common starting point, but it is by no means the only one.