HNHacker News
TopNewBestAskShowJobs

zastrowm

1,048 karma · joined October 30, 2013

submissionscomments
zastrowm··on A concrete example of what goes wrong with Apple's docs
The charitable view would be that they come from language/platform that does include the base-class's methods/apis.

Your example of dotnet/C# doesn't seem to be the best - DotNet/C# repeats the base documentation - for example the SaveFileDialog class [1] lists all of the methods but indicates when the methods come from the base class.

Flutter also seems to list inherited methods - for example the TextButton [2].

[1]: https://learn.microsoft.com/en-us/dotnet/api/system.windows....

[2]: https://api.flutter.dev/flutter/material/TextButton-class.ht...

zastrowm··on Microsoft now demands to know why you won't use Edge when you download Chrome
I liked Edge originally too - it seemed cleaner than chrome and had some cool features like vertical tabs and the Dev tools that were better than Chrome's. I made it my daily driver.

Then they adding a shopping helper; then more ads to the new start-page; then a notification about Microsoft rewards; then popups about how "Bing is better" or that "Bing AI" was there to help - don't forget the "Open links in Edge on Mobile" popup; then they added a side toolbar with a giant B[ing] button that wasn't removable unless you toggled a group policy (now there's an option for it). The damn button was the last straw for me because of the amount of work I needed to do to just disable it.

> I just want to get on my computer - do a few things and get some stuff done

Yeah, so do I and Edge kept getting in the way to keep telling me about all the new things that Microsoft things I should use.

Chrome isn't great - the privacy sandbox/built-in interests stuff is disgusting - but Chrome wasn't as "in your face" so I could just start it and go. Brave avoided the the privacy sandbox and now Firefox works for me everywhere.

zastrowm··on TypeScript team released an explorer for performance tuning
I find the best middle ground is setting up the IDE to have TSC watch running while making changes, but using other tools for doing the actual compiling (vite for example). This allows me to refactor quickly - choosing when to ignore type errors - but also be notified of all the other call sites that I need to update, including in all of the files not currently open in the editor.
zastrowm··on Tesla devs at Twitter misunderstand Slack privacy; leak fire lists based on LOC
It may not be the correct way or a smart way, but it is objective - the metric being used cannot be interpreted one way or another, it's just LOC.
zastrowm··on Not using useCallback is premature optimization
For this specific example the problem is that the handleClick callback is using a stale/cached onImageDeleted callback (which indirectly has old state). If you add onImageDeleted to the handleClick dependency array, it beings to work as you expect.
zastrowm··on The Deno Company
I think the point was that it's not different from Node.js - and thus not much of a benefit.

If it was more along the lines of "I want to use this array helper library, but it shouldn't have any permissions" then it would be a lot more useful, but right now if your Deno app needs any file or network access, then all of your dependencies get access too.

zastrowm··on How generics were added to .NET
Yeah, but I wonder if .NET wouldn't have succeeded until .NET Core without generics as a distinguishing feature. I feel like generics + some of the features built on them (LINQ+TPL+etc.) is what let .NET/C# stand apart from Java.

I'm not necessarily saying it would have failed, but I do wonder :: )

zastrowm··on How generics were added to .NET
This surprised me:

> It was only through the total dedication of Microsoft Research, Cambridge during 1998-2004, to doing a complete, high quality implementation in both the CLR (including NGEN, debugging, JIT, AppDomains, concurrent loading and many other aspects), and the C# compiler, that the project proceeded.

I didn't realize that it was less a "must-have" and more of a "research and if-possible" task. I wonder how the .NET framework/languages would have changed if they went with type erasure. Would we even still talking about .NET today?

zastrowm··on Mono and WebAssembly – Updates on Static Compilation
I crave this for C#/.NET; I was hoping the article was going to mention something about faster edit cycle w.r.t. normal apps. It came pretty close:

> ... uses the new Mono IL interpreter to run managed code at runtime... to be used for quickly reloading C# code and prototyping

So maybe it will/can provide the foundation for faster edit cycles with native apps and not just WASM.

zastrowm··on Mono and WebAssembly – Updates on Static Compilation
The CSharpLang github[1] repository would be where to look for this. I didn't find anything that mentioned adding language support for it, and IIRC, in the past they rejected the idea of inline XML or JSON support.

Going the other way of C# inside HTML, you have Razor[2] and Blazor[3], the latter of which is a prototype of Razor running in the browser via web assembly.

[1]: https://github.com/dotnet/csharplang [2]: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor [3]: http://blog.stevensanderson.com/2017/11/05/blazor-on-mono/

zastrowm··on Takeaways from KotlinConf 2017
I'm curious if this will change now that webapps/electron-apps have become so popular. It may be that users have begun non-native apps as the new norm.
zastrowm··on Mitigations landing for new class of timing attack
Has there ever been discussion about a permission for "running as an app" that would make a distinction between web pages and apps? I like that the web gets more features that allow apps to run cross-platform, but I don't fully understand why we make no distinction between pages and apps.
zastrowm··on Thoughts on Microsoft's Time-Travel Debugger
Yep, it's annoying to have those limitations, but I sort of understand why. They could make their message a lot clearer though.

> I personally would have the hardest time with the 250 user limit

From the document, the text is "more than 250 PCs or users", so my understanding is that a company is limited if it has >= 250 computer users, not 250 customers. E.g. you could have a million free app users and it would be fine.

That fact that I had to preface that with "my understanding is that" means that the document is fuzzy, which is annoying, but at least further documents[2] can clarify a bit:

> - Any individual developer can use Visual Studio Community, to create their own free or paid apps. > - In non-enterprise organizations up to 5 users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or > $1M in annual revenue) no use is permitted for employees as well as contractors beyond... [the exceptions as noted].

[2]: https://www.visualstudio.com/wp-content/uploads/2017/03/Visu...

So you (as an individual not as part of a company) could create a paid or mobile app and have as many users as you want and make as much as you can. If you're a company, then you need to be under 250 PCs, <= $1M, and <= 5 Visual Studio users and you're still good. Exceed those numbers and you have to pay up.

zastrowm··on Thoughts on Microsoft's Time-Travel Debugger
> even the drug-pusher-like "Community" (first hit is free, unless/until you're making money) edition.

I mean, yeah it's not free-for-all, but "first hit is free" is kind of unfair. A company is not allowed to use it if they have more than "(a) more than 250 PCs or users or (b) one million U.S. dollars... in annual revenues" [1], and if it doesn't meet that criteria, it's usage is limited to 5 concurrent instances. More accurate would be "first hits are free, and you won't start getting charged until you're big enough where you can afford it".

Just making the distinction because I still have friends who think they can't use Community at home if they want to have a side project that makes money.

[1]: https://www.visualstudio.com/license-terms/mlt553321/

zastrowm··on .NET Standard 2.0 is final
I believe that .NET Core is not a subset of the .NET Framework; e.g. .NET Core might have things that are not yet in .NET framework.

I believe that the things that go into .NET core eventually go into .NET Standard (and thus the framework), but at a slower pace.

Thus it would be:

  .NET ECMA Spec ⊆ .NET Standard ⊆ (.NET Core ∩ Mono ∩ Xamarin ∩ Unity ∩ .NET Framework)
zastrowm··on Change.org Raises $30M Led by Reid Hoffman; Sam Altman and Bill Gates Invest Too
I wondered the same, so I looked it up: https://petition.parliament.uk/petitions/171928
zastrowm··on Chrome Won
My understanding was that vivaldi wasn't completely open source either.

[0]: https://www.reddit.com/r/vivaldibrowser/comments/54kzpc/psa_...

zastrowm··on Pattern Matching for Java
Ah, faster than the `ConcurrentDictionary`. That makes sense!
zastrowm··on Pattern Matching for Java
> I am talking about what value you could pass into the multiple dispatch code in the article I linked to

Ah, I misunderstood the question. Yes, in that case it's fairly type-safe.

> The actual reflection going on in the code I posted for multiple dispatch would surely be nothing more than an int comparison

Is this based on gut reaction or are you talking about optimizations that `dynamic` performs? I ask because my understanding is that `dynamic` is like a really efficient reflection-emitter, that attempts to do at runtime the same thing that the compiler would do at compile time, but slower because it has to look stuff up via reflection.

From Eric Lippert [2]:

> The magic is: the compiler emits code that starts the C# compiler again at runtime. The runtime version of the compiler analyzes the call as though the compile-time types of all the objects had been their actual runtime types, generates an expression tree representing that call, compiles the expression tree, caches the delegate for next time, and runs the delegate.

[2]: http://stackoverflow.com/questions/10330805/c-sharp-multiple...

So maybe `dynamic` at runtime figures out that it can do a "a struct with an int tag to represent the type, and a void pointer for its value", but I wouldn't assume it does and from what I've read on it, I wouldn't think that it does.

zastrowm··on Pattern Matching for Java
> I've found the DLR is just as fast... with a much lower overhead

Can you expand on this? I would not have expected that it would be faster than compiled expressions.

zastrowm··on Pattern Matching for Java
> A dynamic type is probably just implemented as a tagged bit of data, surely

A dynamic "type" is really just `object` whose methods are looked up at run time. It's not tagged data at all. See [1] for more info, specifically the example(s) at the bottom, as the reflection code is what gets executed at run (albeit with caching so that methods aren't looked up all the time).

`dynamic` is a complex feature that enables multiple dispatch as a side-effect, but only because it allows a whole lot more.

[1]: https://visualstudiomagazine.com/Articles/2011/02/01/Underst...

> what arguments could you pass in to the statically typed function that would cause the use of dynamic to bite you in the ass

    public void Output(int value);
    public void Output(Person person);
    ...
    dynamic aValue = "Some String";
    Output(aValue);
Compiles, because the actual resolving of which overload to call is done at runtime, not at compile time. And at runtime, there is no overload that accepts a string.
zastrowm··on Pattern Matching for Java
> FYI, I recently found out that C# can actually do multiple dispatch

But also good to know, that it can be costly and unsafe. `dynamic` is basically using reflection at run-time, which for most cases is fine, but it's something to keep in mind. It also means that type checking is delayed until run-time instead of compile-time.

zastrowm··on Pattern Matching for Java
Reading this reminded me of all the discussions that took/are taking place for pattern matching in C#[0]; reading this I had the same reactions that I did for C#: cool stuff. It's also nice to see the languages reach parity in features; I only hope the two language committees pay attention to the research/feedback that the other receives.

[0]: https://github.com/dotnet/roslyn/issues/10153

zastrowm··on New Features in C# 7.0
From https://github.com/dotnet/roslyn/issues/347 (Details > Mutability):

  > Should tuples be mutable or immutable? The nice thing about them being 
  > structs is that the user can choose. If a reference to the tuple is 
  > readonly then the tuple is readonly. 
  
  > Now a local variable cannot be readonly, unless we adopt #115 (which is 
  > likely), but that isn't too big of a deal, because locals are only used 
  > locally, and so it is easier to stick to an immutable discipline if you 
  > so choose. 
  
  > If tuples are used as fields, then those fields can be readonly if 
  > desired.
zastrowm··on .NET on Linux – bye, Windows 10
To clarify, this is a cross-platform UI library in the style of WPF; it does not actually make WPF cross-platform.
zastrowm··on Span – An abstraction over all types of memory available to .NET programs
It seems that it will CLR-enforced so I would guess that it's not going to be available for any type:

  The fast representation makes the type automatically stack-only, i.e. the constraint 
  will be enforced by CLR type loader. This restriction should also be enforced by 
  managed language compilers and/or analyzers for better developer experience. For 
  the slow span, language compiler checks and/or analyzers is the only option (as 
  the runtimes won't enforce the stack-only restriction).
zastrowm··on Oct. 4
And for the official source: https://support.google.com/nexus/answer/4457705?hl=en#nexus_...
zastrowm··on .NET Framework 4.6.2
Are you sure you're not thinking that Xamarin uses XAML and not WPF? XAML is used by WPF, UWP, & Xamarin Forms, but I don't recall WPF being on anything other than Windows.
zastrowm··on Why Angular 2 Switched to TypeScript
Anders Hejlsberg is who you're thinking of.

> He was the original author of Turbo Pascal and the chief architect of Delphi... the lead architect of C# and core developer on TypeScript.

(from wikipedia)

zastrowm··on Google is making better apps for the iPhone than for Android
Hangouts isn't a good example to pick apart. The iOS app usually gets updates sooner than Android; it's not just a recent thing. Wifi calling, voice messages, redesigns all came first to iOS and then later (or never) came to Android.
Page 1 of 3Next →