HN user

denisw

1,091 karma
Posts66
Comments65
View on HN
motherduck.com 1y ago

MotherDuck: Serverless Data Warehouse

denisw
3pts0
sqlitecloud.io 2y ago

SQLite Cloud

denisw
2pts0
github.com 2y ago

Vanilla-todo: A case study on viable techniques for vanilla web development

denisw
3pts1
reactos.org 2y ago

ReactOS Newsletter 102 – 2022/2023 News

denisw
4pts0
mainmatter.com 2y ago

The Case for Rust in the Web

denisw
2pts0
mainmatter.com 2y ago

The Case for Rust on the Web

denisw
5pts0
techcommunity.microsoft.com 3y ago

The new Microsoft Teams, now in preview

denisw
21pts39
arstechnica.com 3y ago

Twitter source code was leaked on GitHub shortly after Musk’s layoff spree

denisw
24pts5
www.open-std.org 3y ago

DG Opinion on Safety for ISO C++ [pdf]

denisw
3pts0
posit.co 3y ago

RStudio is now Posit

denisw
179pts64
openjdk.org 3y ago

Paving the on-ramp to Java

denisw
159pts152
buffereditor.com 4y ago

Buffereditor – Code and Text Editor for iPhone, iPad and iPad Pro

denisw
135pts116
aeon.co 4y ago

Utopia now: Why the utopian vision of William Morris is now within reach

denisw
2pts3
fishshell.com 4y ago

Fish 3.4.0

denisw
194pts90
en.wikipedia.org 4y ago

Cottingley Fairies

denisw
3pts2
www.juxt.pro 4y ago

JUXT Clojure Radar 2021

denisw
83pts11
www.infoq.com 5y ago

JavaFX: One Codebase for Web, PC, and Mobile

denisw
2pts1
hookproductivity.com 5y ago

Hook – Find Without Searching

denisw
2pts0
openjdk.java.net 5y ago

JEP Draft: Primitive Objects (Preview)

denisw
1pts0
github.com 5y ago

Pattern Matching in the Java Object Model

denisw
2pts0
github.com 5y ago

Pattern Matching in the Java Object Model

denisw
1pts0
reactnative.dev 6y ago

React Native Team Principles

denisw
3pts0
willcrichton.net 6y ago

Rust: The New LLVM

denisw
1pts2
www.infoq.com 6y ago

Esbuild JavaScript Bundler Claims 10-100x Faster Bundling Time

denisw
2pts0
www.denisw.de 6y ago

Answering Your App's Questions with Redux Selectors

denisw
2pts0
www.denisw.de 6y ago

Answering Your App's Questions with Redux Selectors

denisw
1pts0
futurice.com 6y ago

Answering Your React App's Questions with Redux Selectors

denisw
2pts0
www.denisw.de 6y ago

Answering Your App's Questions with Redux Selectors

denisw
1pts0
blog.isquaredsoftware.com 6y ago

Redux Starter Kit 1.0

denisw
2pts0
github.com 7y ago

Show HN: Redux Preboiled – TypeScript-friendly Redux helpers, served à la carte

denisw
5pts2

Pretty sure that they wanted to write "this", typed something different by accident, and auto-correct struck.

This point was recognized quite early. there is an influential article by Jack W. Reeves from 1992 [1] that looks at the manufacturing analogy and argues that "the code is the design" whereas the "manufacturing" is just the compilation and packaging (that is, super cheap and automated). I believe it‘s this line of thinking that inspired Agile practices, where software developers are seen as engineers rather than code monkeys.

[1] https://www.developerdotstar.com/mag/articles/reeves_design....

To be clear, the difference is that an URI generally only allows you to refer to a resource ("Identifier"), whereas an URL also tells you where to find and access it ("Locator").

For instance, `https://example.com/foo` tells you that the resource can be accessed via the HTTPS protocol, at the server with the hostname example.com (on port 443), by asking it for the path `/foo`. It is hence an URL. On the other hand, `isbn:123456789012` precisely identifies a specific book, but gives you no information about how to locate it. Thus, it is just an URI, not an URL. (Every URL is also an URI, though.)

I recommend „Capital in the 21st Century“ by Thomas Pikkety, an economist who has deeply studied wealth and income equality using historical data spanning three centuries. This book has all the evidence you need.

https://www.amazon.com/-/de/dp/0674979850

Spoiler alert: income from wealth is on its way of becoming close to being as concentrated as it was in the 19th century (especially in the US), and the share of income from work in total national income is decreasing almost anywhere. So yes, increasingly you can only accrue significant wealth by already having significant wealth.

I really enjoyed the comparison of dependency injection with dynamic scoping, and the explanation of how the latter can take over the uses cases of the former with less boilerplate.

But one benefit of dependency injection unacknowledged in this article is that dependency injection is the explicitness of dependencies: the need to pass them in forces the caller to be aware of which dependencies exist, and changes in dependencies cannot be ignored (they lead to compilation errors in statically typed languages, at least).

Managing dependencies with dynamic variables, on the other hand, is implicit. It's impossible to know which parts of the dynamic environment are used by a module without inspecting its source code. And changes to the module's dependencies are not noticed by callers, which may lead to cases where tests fail to stub out particular side effects without anyone noticing.

Given this drawback, dependency injection still seems like the better trade-off to me, despite of its higher amount of required boilerplate. Perhaps it is possible to bring some of the explicitness to the dynamic scoping approach, though.

The crazy high numbers are due to a fairly Microsoft-specific definition of "API" in this context. What they count here is class members; so they ported a class with 15 methods and 3 properties, they'd count this as "18 APIs" (or perhaps 19 - not sure if the class itself counts as an "API" as well).

That being said, I'm sure there was indeed an impressive amount of code that had to be ported.

Why should I build a model specifically for this one context of usage and have the properties tightly-coupled to their mutators, when I can completely decouple these things and have the models operate with any arbitrary state mutators?

Because otherwise, your domain model is not able to express which states are valid. A core idea behind encapsulation is that by controlling state mutations, it is possible to enforce invariants, thereby making invalid states impossible to construct. This idea is not unique to object orientation; for instance, in the static functional programming community, this is known as "making illegal state unrepresentable" [1].

By creating a "dumb" domain model and allowing business rule modules to do arbitrary mutations, each model is required to know about and enforce the domain model’s invariants itself, which dramatically increases the amount of code that potentially can break these invariants, and thus needs to be debugged if something goes wrong.

Taking this a step further, you can have a business model project (class library/Nuget) that is shared across multiple projects within an organization.

This can work in some situations, but there are good reasons not to do this. Different teams may have differing and sometimes conflicting meanings for some of the terms of the domain (especially for generic concepts such as "user") as well as different data needs depending on the use case. This is why for instance Eric Evans’ "Domain-Driven Design" [2] argues for limiting domain model unification to "bounded contexts" [3] of which there may be multiple in the organization, and have explicit translation ("anti-corruption“) layers between the boundaries of these contexts.

[1] https://fsharpforfunandprofit.com/posts/designing-with-types...

[2] https://www.goodreads.com/book/show/179133.Domain_Driven_Des...

[3] https://www.martinfowler.com/bliki/BoundedContext.html

Atom 1.36 7 years ago

Looking only at the commit numbers of the `atom/atom` repo is a bit misleading as the Atom source code as the core plugin packages (e.g., the language modes, but also fundamental features like the tree and the fuzzer) are each in their own repo. For instance, the fuzzy-finder repo alone had 15+ commits in the last three weeks.

From what I learned from digging into Pika/Pack a bit, I think you misrepresented it a bit.

- The standard typescript builder can only generate ES2018

That's true, but only because the compilation to previous ES versions is meant to be handled by other plugins. For instance, the "web" plugin [1] uses babel-preset-env, which in turn will take your package.json's "browserslist" [2] into account.

- The web bundler can only generate ES modules

The Pika project seems to be all about promoting ES modules, so it's no wonder that put this option to the forefront. However, there is also an UMD plugin [3] and a "node" (presumably Common.js) one [4].

[1] https://github.com/pikapkg/builders/tree/master/packages/plu... [2]: https://github.com/browserslist/browserslist [3]: https://github.com/pikapkg/builders/tree/master/packages/plu... [4]: https://github.com/pikapkg/builders/tree/master/packages/plu...

One important thing to note here is that this goes much further than `private` in TypeScript. The latter is purely a compile-time illusion. If you write `private x`, your objects' x property is still publically accessible and modifiable as far as the JS runtime is concerned. any other. It‘s just the TypeScript compiler that gives you an error if you access x, and only if it happens to have the type information it needs to do so (if the object ends up in an `any` variable, all bets are off).

This means TypeScript's "private" properties also shows up in the return value of Object.keys() etc. So it‘s a pretty leaky abstraction.

This proposal, on the other hand, tries to solve the much harder problem of of bringing true private instance variables to JS. This means making it impossible to access these variables from outside the project. To do this, they had to introduce a complete new "private namespace" that is different from the `this.<name>` one, because the latter is already reserved for the visible-to-everyone properties (messing with that would have serious compatibility implications). Hence the `#foo` syntax.

Object-Oriented Programming (OOP) is a programming paradigm where different components of a computer program are modeled after real-world objects.

This is a common, but dangerous way to introduce the object-oriented paradigm. While it is true that many object-oriented systems end up having a few classes that represent entities of its problem domain (such as, perhaps, bus stations in a public transport app), most of them do not. These other classes are abstract entities like data repositories, factories, controllers etc. that are meant to split software into understandable pieces with clear responsibilities that work together to make things happen.

The point is that this collaboration happens solely by these pieces sending each other messages (calling methods) that describe their intent, without needing to know how exactly the message is being processed. This style of communication is the key characteristic of object orientation, and even an introduction should probably put their focus on this aspect rather than „modeling the real world“, which isn‘t really something that is done this way in practice.

All this being said, I do see the appeal of the real-world rhetoric in that it seems much more approachable than ralking about little communicating abstract things. I wonder how to balance this.

That entirely depends on how “popular” is defined. If you mean “preferred choice for greenfield consumer and B2B apps”, then yes, C/C++ would be ranked way lower. But as far as I understand this statistic is based in search results, so it takes into account the huge body of existing software that needs maintenance (after all, you need to stay up-to-date and also look things up again from time to time), as well as domains in which C and C++ are a good still dominating, such as programming embedded devices.

Active Expressions seem to essentially be a more seamless and implicit form of Reactive Streams, such as those from the ReactiveX family of libraries [1]. For instance, the first example given by the paper is:

    var a = 5, b = 6;
    signal c = a + b; // c = 11
    
    a = 10; // c = 16
We can express the same with reactive streams, although it's more clumsy because of the explicit stream objects and subscriptions. Here is an example using RxJava:
    var a = BehaviorSubject.createDefault(5);
    var b = BehaviorSubject.createDefault(6);
    var c = Observable.combineLatest(a, b, (x, y) -> x + y);

    // Read the last value emitted by stream `c`
    System.out.println(c.blockingFirst()); // 11
    
    // Save and emit 10 from stream `a`
    a.onNext(10);

    System.out.println(c.blockingFirst()); // 16
This is, of course, way more verbose than the signal concept displayed in the paper, so I welcome the approach to make this reactive power more accessible. However, note that reactive streams offer a lot of control over value propagation - such as delaying, throttling or filtering changes - that will probably be hard to replicate with a system like the one presented here.

Also, when combined with shared-state concurrency, it might be hard to define and reason about which active expression runs in which thread. Reactive stream implementations have already tackled this issue with concepts such as schedulers [2].

[1] http://reactivex.io [2]: http://reactivex.io/RxJava/2.x/javadoc/

Stimulus is not bound to Rails in any way. It‘s just an NPM package which can be used whereever you have a JavaScript bundler setup (e.g., Webpack). I‘m not sure whether there is a build that can be embedded directly with a <script> tag.

To summarize, Flutter provides no automated or easy means to save/restore state when Android auto-kills the app (e.g. because of low memory). The main problem here is that the `onSaveInstanceState` and `onRestoreInstanceState` lifecycle callbacks require a synchronous response (return value) but the IPC system between Dart and native code is inherently asynchronous.

React Native currently has the very same problem. This is the reason why some very useful native components that require synchronous delegate callbacks (such as UITableView and UICollectionView from iOS) are not available from RN. However, the core team at Facebook is working on a "large re-architecture" that will allow synchronous calls into JS, fixing these issues:

https://facebook.github.io/react-native/blog/2018/06/14/stat...

VS Code and Atom are based on Electron, which is a platform by GitHub using the Google Chrome browser engine, which was forked off Apple‘s WebKit engine, which was forked off KHTML from the KDE project.