1,770 karma · joined March 26, 2015
[1] Meaning a computation using an arbitrarily-long tape, since by definition a computation is finite or its result is undefined.
The good/bad thing about electric cars is that they're sort of like computers right now (they're getting twice as good every 1-2 years), so I expect they'll depreciate more along the lines of used smartphones than (the existing market in) used cars.
Yes, and also the health of nearby drivers, bystanders and inanimate objects.
Huh? I'll admit I'm not that well-read about Byzantine history, but I had always been under the impression that from the reign of Heraclius (mid-7th-century) onwards[1] the court language was always or virtually always Greek.
[1] Which is also as good a dividing line as any between the "Roman" and "Byzantine" periods.
The reader would be able to infer this from context (as is the compiler, so it's still type-safe).
> `first` has type T except when T is bool. Gross. Better to write out the type T.
That's a preexisting problem with `vector<bool>` much more than it is with `auto`.
I would strongly favor honesty in both those situations once the child is mature enough to understand, except, in the latter case, when it's clearly in the child's best interest not to have a relationship with her biological father.
> We also find it ethically acceptable for a couple not to ask who fathered their own child.
That sounds to me like an extremely toxic relationship.
> We also generally find it ethically acceptable to form and especially continue relationships based on factors other than true love, including stability of a family environment and economic stability.
Those are at least real emotions and real decisions made honestly, not elaborate and unthinkably cruel deceptions.
Imagine you learned the person you thought was your parent, or sibling, or spouse, was really another person entirely. They never loved you, they never wanted to spend time with you, and all your memories with them were a lie. They were just a hired actor the real part of your family paid $50 an hour to deceive you.
It's hard to imagine anything that could be more painful. It's far worse than a death in the family. It'd be on par with learning your loved one were a murderer or rapist. It's like a particularly unsettling Twilight Zone or Black Mirror plot—I'm aghast that it's a real thing.
Yes. Sqlite is among the most stable and mature software in existence. I challenge you to name a single browser technology or API that has been anywhere remotely as stable as Sqlite, especially as implemented. As mentioned elsewhere ITT, Hwaci has contractual commitments to support backwards-compatible Sqlite3 for at least the next 35 years.
At that point, if I had to guess, "web browsers" won't be around any more, the web itself will be a dying or dead legacy technology, and companies yet to be founded will lead the tech sector, while Apple, Google, Microsoft and most likely of all Mozilla will be IBM-style dead letters or Digital[1]-style dead.
Sqlite was primarily written by one person and is maintained by three people.[2] If for some reason Mozilla had to fork or take over maintenance of Sqlite, it wouldn't even be worth noticing in their budget. It would, in fact, likely cost considerably less developer time than they spent designing, implementing and lobbying for IndexedDB.
More likely, if Sqlite3 were no longer being suitably maintained, all the browser vendors, plus the hundreds of other major tech companies that use it, would jointly endow a Sqlite Foundation to take over maintainence, which might cost Mozilla 5 grand or so a year, ye gods.
Even if Mozilla felt compelled for some reason (avoiding dependencies?) to rewrite Sqlite from scratch, Sqlite is 125k lines[3] of ANSI C compared to Firefox's 18 million lines[4] of C++, so Sqlite represents roughly one month of Firefox development time.
Firefox, Chrome, IE/Edge and Safari all make very extensive use of Sqlite internally, including to implement IndexedDB, so, obviously, Mozilla does not actually consider dependency on Sqlite and its API to present a meaningful risk.
Further, as things stand (and as they stood in 2010), Sqlite's massive footprint in the Firefox codebase means Mozilla already must rely on Sqlite remaining maintained, just the same as if WebSQL had been standardized.
> I also believe that it wasn't just Mozilla, but also Microsoft that scuttled this. Mozilla was the louder voice, but Microsoft never supported it either.
MS, especially at the time, ordinarily tried to slow or stall the standardization process for web technologies in general, so IE wouldn't fall too far behind. I expect better of Mozilla.
Mozilla was also by far the loudest (really the only) voice against WebSQL; MS barely participated in the conversation and was mostly noncommittal when it did. It's unlikely MS would've objected at all if Mozilla hadn't given them the opening.
[1] https://en.wikipedia.org/wiki/Digital_Equipment_Corporation
[2] https://sqlite.org/crew.html
[3] https://sqlite.org/testing.html
[4] https://www.openhub.net/p/firefox/analyses/latest/languages_...
[1] For pretty much complete nonsense NIH and standards-lawyering reasons.
[1] http://cdn.cultofmac.com/wp-content/uploads/2014/03/hockeypu...
I Am Not a Physicist, so I need a real one to explain why I'm wrong, but I've thought for a while the cleanest explanation for dark matter is
1. The universe is inside a black hole.
2. Dark matter is matter which is outside the black hole, which explains why it has mass but no other observable properties.
[1] By which I mean the languages themselves and minimally-conforming standard libraries rather than ecosystems or quasi-standard libraries like J2SE (Java), Cocoa (Swift) or the browser DOM (Javascript). C++ has a fairly slow-moving (but mature) ecosystem and its "quasi-standard" libraries (Boost, common compiler extensions, Windows and POSIX APIs) aren't as tightly-coupled to the language as the previous three examples.
[2] Both hindered by standards-body bureaucracy and the need to keep backwards compatibility with mistakes, but both popular enough that bigcorps are incentivized to keep things moving along; Javascript is more popular but that's offset by C++'s more efficient de facto process for standards-tracking library improvements (get them into Boost first).
Javascript actually probably moves a bit faster but Internet Explorer compatibility (still likely to be relevant for another 5 years or so) is an even bigger drag on adopting bleeding-edge features than waiting for (your company adopting) new Visual Studio/CentOS GCC/[Some embedded architecture] GCC versions is for C++.
As for outdated stuff in the standard library, that's something that affects every language as it ages. `map`/`set` aren't, IMO, the worst offenders; they were misleadingly-named (like `std::endl` and `std::move`), but RB-trees are a useful data structure, and while they are slower than hash tables (`unordered_map`/`unordered_set`) for the typical map/set use case, it's not like they're buggy.
The one that IMO most cries out for replacement is `[std::]rand` (inherited from the C standard library), whose RNG is abysmally low quality/predictable, very slow, and thread-unsafe. C++11 did introduce a new RNG API[1], but it's quite cumbersome and verbose to use, when they really need to introduce a simple API like BSD/Mac `arc4random_uniform`[2] so people will stop using `rand`.
Edit: I see that this is being addressed, although it didn't make it into C++17.[3]
While not buggy, iostreams are also getting a bit long in the tooth and could stand to be replaced with a more modern API, the iterator APIs (in the <algorithm> and <numeric> headers, etc) should also be methods on STL types, and `std::string` isn't quite deprecation-worthy, but it would be nice if the STL were augmented with a state-of-the-art encoding-aware string implementation like Swift's. And it would be nice if the STL acknowledged the existence of the internet (with high-level libcurl-like functionality in addition to the very low-level Networking TS).
[1] http://en.cppreference.com/w/cpp/numeric/random
[2] https://www.unix.com/man-page/freebsd/3/arc4random_uniform
Also, `new`/`delete` aren't unidiomatic when strictly adhering to RAII and
- Writing exception-safe code (with the `new (std::nothrow) T` form).
- Writing custom smart pointers or data structures, or high-performance containers (especially with C++17 aligned `new`/`delete` and C++14 sized `delete`).
- Using memory pools (with placement `new`/`delete`).
`[std::]malloc`/`[std::]free` aren't necessarily unidiomatic either, such as
- When using a C API (or one in pre-standard C++ or a third language) which is incompatible with `new`/`delete`.
- When you need `[std::]realloc`, and for whatever reason a `std::vector` isn't an acceptable substitute.
- In embedded or other environments that don't provide a STL.
[1]: > Around the three-minute mark someone asks how many automakers have taken Tesla up on the offer to use its patents, and Musk notes:
>>> Musk: We actually don't require any formal discussions. So they can just go ahead and use them.
>>> Reporter: Is there a licensing process?
>>> Musk: No. You just use them. Which I think is better because then we don't need to get into any kind of discussions or whatever. So we don't know. I think you'll see it in the cars that come out, should they choose to use them.
Sounds nice, but no legal department on Earth is ever going to approve of deliberately using another company's patents without an explicit licensing agreement, no matter what non-legally-binding statements that company's CEO has made. As a sophisticated businessman, Musk is well aware of this fact.
[1] https://www.techdirt.com/articles/20150217/06182930052/elon-...
I've recently been reading Ogilvy on Advertising[1] by David Ogilvy, one of the most successful 20th-century figures in the industry, and while it's a bit dated (it was written 30 years ago) and, obviously, the subject matter is advertising, it's filled with excellent advice that's just as useful in all professional and personal contexts.
One aside that jumped out at me was "While we are on the subject of taste, I deplore the current fashion of using clergymen, monks and angels as comic figures in advertising. It may amuse you, but it shocks a lot of people."
I had honestly never really thought of it that way, but it's true. Religious people (that is, most people) find it hurtful and disturbing when you mock their religious faith. That might not be your intent, but it's kind of like 10 or 20 years ago when people used to explain that "by f-- I don't mean gay, just stupid." Just because you don't think or don't know what you're saying is hurtful does not mean that others aren't hurt by it.[2]
If Mozilla had used terminology in their software that was offensive to women, or gay people, or non-Western religions, I'm sure they would alter it, and rightly so. If they called a copy-on-write library HolyCOW, and Hindus said they were offended by this name because it mocks their religion, I'm sure Mozilla would, rightly, change it. And they probably know enough not to use such a name in the first place.
Of course, "holy" is not a specifically-Christian term, but a concept shared by all religions, Western and non-Western alike. A devout Catholic, Muslim, Buddhist or Jew is equally likely to feel hurt and excluded when they see you comparing their beliefs to shit.[3]
As for the other half of the name, the profanity ship has sailed in the broader culture and especially hacker culture, but it's also true that many people don't feel the same way, and nearly all of these people are deeply religious. I think it's reasonable to expect that religious people in the open-source community ought to accept that you or I will sometimes say "shit" for humor or emphasis, but it's also reasonable for them to expect we'll meet them halfway by not making them the butt of our jokes.
There are plenty of equally-funny "JIT" puns that don't come at anyone's expense; "GoodJIT," "JITHappens," "JIT'sTheBomb," and so on. I recommend using one of those.
I'm not a prude. I wouldn't scold you for saying "holy shit" (or "holy cow") in a conversation with me. I haven't scrubbed those phrases from my own casual vocabulary either. But, if someone told me I'd offended them, I would apologize and probably feel bad the rest of the day, just as I imagine almost any of us would. When you're participating in the open-source community, your audience is mainly strangers, with many different beliefs and backgrounds, whose first impression of you[4] is formed by what you've written on the internet. So it doesn't hurt to be a little more careful.
[1] https://smile.amazon.com/gp/product/039472903X/
[2] Hearing that speech a few hundred times, and maybe even giving it a couple, certainly didn't make high school easy for closeted me.
[3] Not that we shouldn't try our best to avoid needlessly causing offense whether it's to one group or many.
[4] And not only you, but the organizations, projects and communities you are involved with.
Ruby is multi-paradigm; in particular it's easily the most "functional"-feeling of the major scripting languages.
> and moreover OOP of the old way (a method must be tied to only one object. This is what prevents me from going to Smalltalk, btw.)
I'm unsure what you mean by this. Ruby has one of the most flexible OOP systems in existence, a good deal more flexible than Python's, and lets you create more or less any conceivable relationship between methods and objects. (Which is why Ruby is slow).
> Additionally, the MRI is perhaps the slowest implementation of a dynamic language out there (besides "R"). I know there are alternative implementations; is there any implementation that is significantly faster (at least as fast as Google V8 for ECMAScript) and that supports the full Ruby language without compatibility issues?
Ruby's not fast, but it's improved quite a bit from the 1.8 days. It's comparable to Python.
As for high-performance alternative implementations, there's TruffleRuby,[1] but it still has compatibility issues and isn't ready for production use. There's also Crystal,[2] which is a very similar (but incompatible) compiled language with performance on par with Go/Java/Swift. It's also still in beta but they plan to have a 1.0 release by the end of the year.
{-# LANGUAGE OverloadedStrings #-}
plus lots of other ceremony.(There's only one form of string literal in C++ too; the "s" and "sv" suffixes shown above are operators, not part of the literal).
This is a rather odd complaint; I can't think of any programming language which has first-class support for nullable types, and where they aren't truthy/falsy, at least in conditional contexts. It's a pretty straightforward boilerplate-reducing idiom.
Did you mean to say builtin arrays coercing to pointers? (I'd agree that's probably the biggest problem with C and, by extension, C++).
Or did you mean `NULL` being an `intptr_t` in C++? That's the very rare C++ misfeature that doesn't come from C (where it's a `void*`), but at least C++11 `nullptr` fixes that.
Haskell? Python 2?
(Also, C/C++ string literals are perfectly safe to use — they're guaranteed-null-terminated immutable arrays that implicitly convert to `string` and `string_view`; it's more that its safer in modern C++ for function parameters to be `string_view`/`string`/`const char(&)[N]` instead of `const char*`).