(Disclaimer, I work with the guy behind it)
Personally these sorts of libraries just strengthen my opinion that golang really needs proper generics. However, if you're already gonna use Go they're pretty neat.
350 karma · joined January 9, 2011
Formerly I worked on Stack Overflow and Stack Exchange.
http://stackoverflow.com/users/80572/kevin-montrose
(Disclaimer, I work with the guy behind it)
Personally these sorts of libraries just strengthen my opinion that golang really needs proper generics. However, if you're already gonna use Go they're pretty neat.
The code is older than UTF-8.
Windows NT was first released in '93, UTF-8 didn't exist (much less have wide adoption) for most of it's development. Likewise, NeXTSTEP had an initial release in '89. Java and JavaScript (both '95) could have adopted UTF-8, but they're almost certainly running on an OS that expects UTF-16 soooo... yeah.
^UCS-2 was superceeded by UTF-16, so you'll find them used interchangeably a lot.
For .NET proper, new machine code is generated at runtime. I believe (but do not know for sure, offhand) that it basically takes the IL definition of the generic method, slots the now known type into it, and JITs it to get the machine code it needs. I do know that there are couple bits of IL that are meant to make it possible to write the same code to deal with both reference and value types, which is probably related.
Ngen (http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.110).a...) let's you transforms assemblies into machine code up front, while still being .NET proper. However, if it can't find a use of generics with concrete types found at runtime (ie. you generate a List<int> via reflection) you'll still load up and use the JIT (see some discussion here: http://stackoverflow.com/q/16647568/80572).
I don't use AOT or Ngen regularly, so the particulars may be a little off in my explanations. But that's the gist of it.
I suppose debugging could go sideways in theory, but it doesn't happen in practice on .NET and I doubt the go team couldn't figure out how to make it work.
It's worth noting that .NET never interprets bytecode, it always converts a method into machine code before execution. Go has already had dynamic code generation as part of it's implementation (I don't know if it's still around in 1.2), so it's hardly like it can't do the same thing .NET is.
At compile, there's one version of a generic method (say List<T>.Add). Compilation isn't slowed down like in C++.
At runtime, a generic method is compiled (on demand) into unique versions for each T encountered if T is a ValueType (int, double, etc. including user defined ValueTypes). This avoids boxing, like in Java.
Also at runtime, for all T's that are reference types a single common version is used with implicit casting as in Java.
C#'s draw back is that there is a small cost incurred on the first use of a generic method, and then an additional cost for each new ValueType used (if any). In practice this doesn't ever seem to be an issue, but it's there.
See http://stackoverflow.com/q/5342345/80572 and http://www.artima.com/intv/generics.html (which is linked from the former).
Just went to the playground and dropped a random jQuery sample in: http://www.typescriptlang.org/Playground/#src=%24(%20documen...
You get squiggles yes, but you also get valid javascript. So it looks like you can paste random javascript into TypeScript and get it to compile. I went and tried with the actual compiler (to make sure it's not some artifact of the playground website), and confirmed you get a proper .js file out (and 2 messages, about $ being undefined).
Quick google makes it sound like getting rid of the squiggles / messages is pretty easy: http://stackoverflow.com/a/12755602/80572
I'm not sold on TypeScript yet (or any of the transpiled javascript languages, honestly), but this:
> False. Typescript will choke on most JavaScript files from the web.
Seems to be the actual false statement in this thread.
There are also errors on our end like account merge bugs, moderation mistakes, dropped/flagged/whatever recovery emails, and so on. Keeping additional historical data can help us recover in those cases.
If you're smart about what you track it's not that much data; we record most changes to user records into a history table (likewise, and for the same reasons on post records). Keeping traffic logs around and queryable forever would be really, really expensive though. We keep some around, but only really recent stuff is easy to query (about 2 days) since that tends to be what's needed when reproducing bugs. I don't even think we have all traffic history, and old stuff would require digging a tape out (if we even move those to tape like we do with DB backups, I honestly don't know; it's never come up).
Moderation is a good reason to keep lots of data around, you're right, but it's not the only one.
Disclaimer: Stack Exchange, Inc. employee.
Stack Overflow does take a "full name" (in OpenID attribute exchange terms) as a user name if provided by an OpenID provider, though we explicitly don't demand it (it is not "required" in AX terms). Exactly how a provider deals with "optional" attribute requests is up to them, in practice I think most everyone ignores it unless it's also public information on their service (ie. full name == user name).
Offhand I want to say Facebook is the only login option used by > 5% of our users that provides a name. I did not actually confirm that by testing, just working from memory.
You are correct in that Stack Overflow never displays user emails during normal operation, excepting employees and moderators (who are bound to an agreement before accessing such information: http://stackoverflow.com/legal/moderator-agreement ).
Disclaimer: Stack Exchange Inc. employee
Depending on when exactly when he registered, there may have been (and now always is, when using a third party login iirc) another page on the Stack Overflow side that confirms new account creation and again displays the provided email.
Basically, he clicked through at least one "sending personally identifiable information, are you sure?" page. Maybe more than one.
Disclaimer: Stack Exchange Inc. employee, I've done some work on our user login stuff in the past.
While I suppose in theory Joel could have thrown a lot of money away just because it didn't happen that way. Stack Overflow was running on it's own income until the first round of funding ( http://blog.stackoverflow.com/2010/05/announcing-our-series-... ), excepting the pre-launch period (everyone might have just taken equity then, I don't know I wasn't around until just before the series A). I think it was mostly ad income, though Careers ( http://careers.stackoverflow.com/ ) was around fairly early too.
Disclaimer: Stack Exchange employee
We've configured route registration a little bit specially* to speed up some common cases and we don't necessarily use every feature in the framework; but we're far from a proper fork.
ASP.NET MVC performs well enough that we get more bang from focusing on our own code basically.
*This amounts to registering our highest traffic routes _first_, and checking left-hand matches before Regex'ing (since we have a ton of "/foo/\d+/bar"-ish routes).
http://blog.serverfault.com/2011/03/23/performance-tuning-in... is my go to "we couldn't do things like this in the cloud" example.
Not to say the cloud is never the right choice, it's just never made sense for us.
I'll dig into it, should have a fix in the next deploy (assuming it is a bug, but I don't see what else it'd be).
Would have been dealt with even earlier, but our experiments with it (http://meta.stackoverflow.com/a/69032/130213) lead us to believe Google was starting to treat us as a link farm.
What we were seeing in our earlier attempt wasn't pages appearing lower in results (which could reasonably be expected in some cases as a result of the change; and we wouldn't care, 2nd on a search under an equally good resource is fine by us), but pages being removed entirely; almost universally pages that had newly un-nofollow-ed links to stores, or ad-laden sites (mostly legitimate posts, but some spam that stuck around for a bit before the community deleted it). So, "classified as link farm" seemed like the most likely problem. Google naturally won't tell you why your ranking drops, so it was (and remains) just an educated guess as to what happened.
So we stopped, putting it on the "wish we could, but reality doesn't let us"-list until Google reached out to us (among thousands of others, I'm sure) to change our nofollow practices. Google didn't describe any changes in their algorithm, but it seems reasonable to me that there would have been some tweaks around nofollow to accompany a new policy; again just an educated guess.
Basically, this is an old post complaining about a long since addressed concern that we had tried to address even earlier but ran into practical problems with.
While the exact details of our algorithm are secret by necessity, I will say that we've had to consider posts individually to prevent spammers from kiting a single account up to post nofollow-less spam content. People still try, it's kind of astounding how much spammers try (I suspect SEO's opaqueness cuts both ways here), but it doesn't work (well, you can get one link in your profile; but there's less SEO juice to pass and you are hard-capped at one, no matter how long it takes someone to delete your account).
Disclaimer: Stack Exchange employee, I was on all the relevant calls but has been a couple years so grain of salt and all that.
Not aware of any blanket deadline on changing voting processes, do you know which law that's in?
I'd imagine (since I wasn't around at the time) it was more of a choice between "pay nothing" and this, Stack Overflow had no income until after launching (ads I think were the first thing) and no funding for years after that.
So far as I can see, this is just bitcoin fans trying to discredit a paper co-written by Adi "I helped invent RSA" Shamir which is somewhat unflattering to bitcoin.
In general though, I think the ease of development that comes from query strings trumps any supposed security gains of using headers for passing parameters.
Fundamentally, if you're worried about secrets being logged you're worried about MITM attacks (if either endpoint stores secrets insecurely, that's a whole other concern). If someone's actually managed to MITM a user, it's no harder to capture headers than query strings; so it's a mostly false sense of security. To prevent MITMs, you should just mandate HTTPS; that gives you some real improvement, not just one for the very narrow "traffic logs subsequently compromised" case (and even that assumes the log in question isn't capturing headers, which may be typical but is by no means universal).
Practically speaking browsers will accept : for everything, possibly forever.
It's mostly trivial things last I looked (comma delimited scopes instead of space delimited, `expires` instead of `expires_in`, and so on). Glancing over the final spec, seems headers are preferred now (which is almost always dumb IMO, but that's a whole separate rant) and Facebook only does query strings.
Looks as though the spec bloated a bit, though there's probably still a sane-ish kernel worth implementing in there compared to OAuth 1.0a.
And even more nitpicking-ly, our Facebook login is OAuth 2; not OpenID.
But yeah, there's no relation between user display names and their logins.
"In a perfect world, we'd be able to offer specific, targetted guidance for authors whose posts were likely to be shot down, before they ever showed up on the site, and without requiring as much up-front effort from our community."
Which is waaaaay before the classification line.
I don't even know how you could read that blog post and come to that conclusion...
But seriously, Stack Exchange thrives because of its focus (which is maintained in large part by its culture of moderation, though only a small part of that is done by actual "moderators"; the community self-polices pretty well).
This contest is aimed at catching posts that would be closed before they're posted. Ideally we'll get a classifier that lets us give guidance to the askers. Better education of new/confused/troublesome users, leading to better posts, and fewer closed questions overall.
(Disclaimer: SE Inc. employee, yadda yadda yadda)
That article starts from the assumption that any in browser VM will resemble the JVM; which is a faulty assumption. In fact, any in browser VM would have to be very different from the JVM since Rule 0 for any such VM would be "acceptable Javascript performance".
From that article:
> Meanwhile, JVMs don't do these optimizations. Since all types are statically
> known, the compiler knows exactly how much storage they need and what
> operations they support. It can then generate appropriate tight code for those
> types. This is fast if your language is statically typed, but if you're trying to
> compile a dynamically typed language to the JVM, it won't be able to run as fast as a
> VM that can assume dynamic typing all the way down and optimize specifically
> for that.
A whole wasted paragraph. Of course a browser VM wouldn't be statically typed, that'd make compiling/running Javascript a bear. One would hope there'd be some system of type-hinting, because eliminating dynamic dispatch is really low hanging fruit in terms of optimization, but JVM/CLR-style static typing? Madness.
Once you get over 200 rep anywhere in the network, you'll automatically get a +100 rep bonus on other sites you join so you don't have to "grind it out" for the basic privileges.
The low rep hurdles (anything < 100) are basically "know how everything works" bars (the number of people who mistake "answer" for "forum-style reply" and "community close votes" as "moderators" backs up the need for such hurdles), the high ones (down vote, edit, close, etc.) are the "strong community" ones.
Instance methods are bound before extension methods, if someone provides an implementation of Count() in a subclass it'll be invoked instead (provided your reference is typed appropriately). More narrow extension methods are bound before general ones, so you can even "override" within extension methods.
Scala has some neat stuff, but it's not Java 8 so I don't see how it's relevant.
> Btw, C# has some limited form of implicits, too, but I haven't seen any serious usage of them for a while.
C# has implicit conversion operators you can define, http://msdn.microsoft.com/en-us/library/z5z9kes2(v=vs.100).a... . You'd better have a really good reason for defining one though, silent conversions are generally frowned upon.
For example (disclaimer, it's been a bit since I've touched these classes; but you should get the idea), an extension of Iterator that adds a longSize() method would probably want to make use of ArrayList's size() rather than iterating over the whole thing too.
As an aside, if your code absolutely and utterly depends on a certain operation's runtime performance you had better be using a type that actually guarantees that performance. List<T> guarantees Count is O(1) ( http://msdn.microsoft.com/en-us/library/27b47ht3.aspx ) , IEnumerable<T> doesn't ( http://msdn.microsoft.com/en-us/library/bb338038 ); that's your bug.
They also don't require you have access to the source (anybody can write an extension method on System.Collections.IEnumerable, not just the BCL team). That they work on any type (not just interfaces) also makes them considerably more general than default implementations.
I also find the idea of an interface carrying implementation a little weird, the abstract class/interface line gets a lot blurrier.
That said, lambda support that only worked on new code would be pretty lackluster; so it's good some thought has gone into getting them into legacy code.