Reputation
59,286
Next tag badge:
187/100 score
18/20 answers
Badges
12 176 258
Newest
 Enlightened
Impact
~2.0m people reached

Sep
23
comment A secondary “type system” for references?
Here's a good rule of thumb for you. It's a good idea in general, and an extra-good idea when dealing with C++: good ideas get copied around. When considering a language feature, look around at other languages. If no one else is doing it, there's probably a good reason why you shouldn't either, even if you don't know what it is yet. (See also: C++ templates, inheritable objects as value types, RAII...)
Sep
22
comment Should I also mock header files?
Ha ha! Look how ugly that header file is! ...oh, wait. That's not what you meant?
Sep
22
comment Why do build tools use a scripting language different than underlying programming language?
@SteveJessop: I would agree with your original position, actually. The problem with XML isn't that it's verbose per se, but that it's filled with required syntactical elements that add no useful information, and thus detracts from human-readability rather than enhancing it. A lot of times a verbose programming language says stuff that a smart compiler can infer and isn't strictly necessary, but having that information around still makes the code it easier for a human to read. But XML's close tag names just turn it into messy tag soup, and a pretty-printer makes them redundant.
Sep
21
comment Why do build tools use a scripting language different than underlying programming language?
Fair enough. I've always figured C is one of those "if X is the answer you're asking the wrong question" technologies, to be perfectly honest; it's just that working with XML "scripts" has been a nightmare every time I've had to dive into one. I agree that a higher-level imperative language with DSL capabilities would be ideal.
Sep
21
comment Why do build tools use a scripting language different than underlying programming language?
Imagine the pain and boilerplate of writing a makefile (or build.xml, or whatever) in C. Imagine the pain and mess of trying to express non-trivial conditional logic (you know, standard imperative stuff) in a declarative XML script. Oh, wait, you don't have to imagine; you've probably had to deal with it, and it was probably a mess and a half, wasn't it? Builds are one of the worst possible choices for a declarative scripting language, because serious problems quickly end up butting up against the limits of declarative-ness, and the ones that don't are simple enough to not need a build tool.
Sep
21
comment Why do build tools use a scripting language different than underlying programming language?
@MichaelT: Have you considered the joy of trying to writing a build tool/script in C? or Java? Have you considered the horrendous mess that you have to twist XML into when a non-trivial build contains requirements best expressed with imperative logic constructs?
Sep
19
comment Why not expose activation records as data types?
@Potatoswatter: I just poked at it a little. If you have a reference to a closure in .NET, you should be able to cast it to System.Delegate, which has a Target property containing a reference to an instance of the closure object. You can reflect on that without having to reverse-engineer the JIT.
Sep
19
comment Why not expose activation records as data types?
@Potatoswatter It's very much a hack, but it can be done.
Sep
17
comment Why do DVCSes seem to all have an irrational phobia of uncommitted changes?
@Telastyn: No, you can't, because a checkin--even to your local branch--requires a commit reason and creates a record in the history. So if you check in something that wasn't ready to be committed yet, eventually when you're ready to push changes to the remote repository, that history is going to be there unless you go through additional operations to rewrite history. That doesn't fit any definition of "trivial" that I recognize, and it seems to me like a lot of extra complexity without any articulable benefit.
Sep
16
comment Licensing for artistic work used inside GPLv3 licensed software
Be careful. With the way the APK model works, I don't think it's possible to comply with the GPL on an Android app. (I know it's not on an iOS app.) It might be better to pick another open source license.
Sep
4
comment Swift: Creating an empty array
I'm not a Swift developer, but if I had to guess, I'd say it's probably "constructor notation": the [String] denotes a type: array of strings, but you're not trying to assign a type to emptyArray; you're trying to assign an instance of that type, which is where the parens come in. (Note: if any actual Swift devs see this and I'm way off, bear in mind the above: I've never used Swift. Just making an educated guess here.)
Sep
4
comment Swift: Creating an empty array
Just a quick terminology note: "Brackets" are the rectangular things you put around the word String. The round things afterward are parentheses, or just "parens" if you're being informal.
Sep
4
comment Why does presence of value evaluate as “Truthy” in Python? [e.i. Types evaluate True in conditionals]
@EricRenouf What it means is that if your Python program is complex enough that it can run for an hour before it hits the line of code in question, you won't know anything's wrong until you've been running it for an hour and then suddenly it throws a TypeError in your face. If it had a compiler checking for things like that, you'd know before the program ever even starts up, minimizing aggravation and the chance of lost work.
Sep
3
comment Why does presence of value evaluate as “Truthy” in Python? [e.i. Types evaluate True in conditionals]
@RubenBaden: That's one advantageous way of doing it. It kind of depends on your philosophy. It's important to be consistent, though, so your users know what to expect, or you can end up with a huge, ugly mess of inconsistency that breaks in horrible ways if you so much as look at it funny. That's one of the things that Python gets right: it's good at consistently adhering to the basic design principles laid out in the Zen of Python.
Sep
2
comment Add GPL to an existing application
@Rat2000: Edited.
Sep
2
comment Add GPL to an existing application
One thing to be aware of: the GPL is often seen as the "default" open source license, but it carries a lot of political baggage with it. It's been deliberately designed for a very specific purpose: to proclaim that all proprietary software is inherently evil and to attempt to use the force of law to make the development of proprietary software more difficult. If you agree with this philosophy, go ahead and use the GPL. If you just want to publish your code as open-source so others can use (and help contribute to) it, I'd suggest looking at other options as well.
Sep
1
comment Strategy to avoid running out of memory in memory intensive application
@John: Define "installation". There are a handful of RDBMSs that work just fine as "embedded databases", where it's just another project DLL and the database is just another data file your project accesses, with no installation or configuration needed and no server to set up. My personal favorite is Firebird, but there are several that can work this way. Would your boss be more amenable to that?
Aug
21
comment Is macros support in a programming language considered harmful?
What is the difference you are trying to draw here between "the language" and "the compiler"? C's macro system is defined in the language standard, Lisp's macros are, in fact, expanded by the Lisp compiler, and any language implementation is defined, when all is said and done, by the compiler and the standard libraries. Therefore, the phrase "separate from the language and built into the compiler" is nonsensical. Perhaps the distinction you're searching for is that C macros are implemented in the compiler front-end, and Lisp macros on the back-end?
Aug
21
comment In what situations would it be technically 'impossible' to release a system as open source?
@cmaster: Sure, I was just pointing out that punch cards had been around for a long time before either Hollerith or electrical machinery.
Aug
21
comment In what situations would it be technically 'impossible' to release a system as open source?
@DavidThornley Punch cards were invented in 1725 for the control of textile looms, as an improvement on existing, similar technology. They were first used for numerical processing in 1832, and Charles Babbage, in 1837, proposed using them in a hypothetical computing device that never actually got built. Hollerith, who used them for the 1890 US census, was more than a century and a half late to the party.