Reputation
8,674
Next privilege 10,000 Rep.
Access moderator tools
Badges
2 25 39
Newest
 Enlightened
Impact
~321k people reached

  • 0 posts edited
  • 5 helpful flags
  • 2,987 votes cast
1h
comment C++ - how is it with real numbers?
The example given does not produce the results given on any compiler I have. A better example that reproduces the behavior would help, too.
Jul
23
comment How should I structure my web app for browser compatibility?
If each page's JavaScript file contains only the small amount of specific code relevant to the page, then there's no reason to have it outside the page itself (or, it could even be included inline in the common JavaScript files), and so the file need not exist at all. The same for browser-specific code and page-specific CSS. Each additional file you send imposes additional bandwidth overhead for the HTTP request/response and TCP packet overhead, and it's yet more stuff that clogs caches. My point stands.
Jun
3
comment Why don't Windows/Linux use relational Databases (RDBMS)?
@PeterCordes: BeFS did that. Because all the metadata was B+tree-indexed, it supported range queries, wildcards, joins, and other fun stuff. I remember hearing that Microsoft was doing the same thing in WinFS.
Jun
3
comment Why don't Windows/Linux use relational Databases (RDBMS)?
It's also worth pointing out that some filesystems actually have a number of RDBMS features. For example, file metadata (particularly extended metadata) in BeFS is indexed with B+trees, and the BeOS file manager had a SQL-like lookup engine that searched indexed metadata to find files.
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.