
ONIXLabs
102 posts

ONIXLabs
@onix_labs
Where open-source meets enterprise-grade engineering. Building future-proof tools for .NET, Kotlin, and Corda.
London, UK Katılım Ocak 2020
75 Takip Edilen19 Takipçiler

🚨 Announcing ONIXPlayer 🎶📹
We (including @claudeai) built a cross-platform media player for Windows, Linux and macOS.
Check it out and let us know what you think!
github.com/onix-labs/onix…
English

@talb_bluecurve @jcouv I’d prefer they just made readonly available in more places. Longer and more verbose yes, but we all know what it means by now. IMO `in` was a bad choice for parameters—again, `readonly ref` would have been the obvious choice.
But that’s all just C# showing its age.
English

@jcouv Nice but we need an extension of the let keyword so we can define readonly variables, so we will have var and let. It will allow for most robust code.
English

We merged a C# 15 feature into .NET 11 preview 2: collection expression arguments.
Allows specifying creation arguments for a collection expression: `List<string> names = [with(capacity: 10), ... elements ...];`
Spec: github.com/dotnet/csharpl…
English

Whilst implementing a new feature in the ONIXLabs .NET library, we came across an interesting suggestion regarding C# 14's new extension blocks.
This is one of those rare occasions where we needed @StackOverflow.
stackoverflow.com/questions/7984…
@MadsTorgersen @dotnet
English

@DevLeaderCa We’ve written a numerics library for .NET that includes BigDecimal, NumberInfo, and some other maths utilities. We’re also adding a unit conversion library at the moment.
So, we’ve done a lot of maths.
onixlabs.io/Products/DotNe…
English

@Dave_DotNet In theory, you could do it with something like secure enclaves (i.e. Intel SGX), or perhaps homomorphic encryption, but in practice, it just sounds like bad design, and a security nightmare.
English


@DevLeaderCa The last time I wrote abstract classes, it was probably Result, with Success and Failure sub-types, and Optional, with Some and None sub-types.
They have their uses, but they should be respected when used.
English

@DevLeaderCa When abstract classes devolve into dumping grounds, it’s usually for one of two reasons: either the abstraction was poorly conceived from the start, or subsequent developers were ignorant to its intended purpose.
English

You won't catch me using an abstract class in CSharp.
I never use them.
Well, almost never.
99% of the time I use them it's because I'm using something else that made extending it REQUIRE an abstract class. I use them when I'm forced to.
Wait -- What about that other small fraction of time?
Only rare cases where it's speeding up some boilerplate code -- which could probably be replaced by code generation. But I'm not there yet.
I try to use composition over inheritance whenever I can. If I need shared logic, it's going into a class that can be reused when I compose different things.
I've seen too many times development teams push more and more code into abstract base classes. Inevitably, many of them become a dumping ground. And once they're in place, it becomes a hell of a refactoring effort to unwind.
I'm not saying there's *no* use for abstract classes. However, in my own development, I can almost always solve related challenges by composition and ditching the abstract class.
When do you find abstract classes add value in your development?
#CSharp #DotNet #OOP
English

@davepl1968 The “old desktop stuff” is a folder most people have. It’s the file-system equivalent of that drawer in every kitchen that contains old coins, batteries, takeout menus, phones, chargers, etc.
Stuff you either haven’t got round to organising, or don’t know where to put or delete.
English

It's amazing to think of the amount of work we put in at Microsoft to build a fast, responsive, and robust hierarchical file system explorer just so that everyone could put everything on their desktop.
And no, having an "Old Desktop Stuff" subfolder does not count as organization.
Mᜋtt@MMatt14
what the fuck
English

@edandersen For example, I have assemblies called:
NewCo .Foo .Bar .Abstractions
NewCo .Foo .Bar
The first assembly drops the .Abstractions from the root namespace.
I believe this is also done in the Microsoft.*.Abstractions assemblies.
English

@edandersen Whilst their delivery was clearly agitated, they’re not wrong.
“Should” != “Must”.
I have a project where multiple assembles share the same namespace through RootNamespace modification.
English

@haydendevs Implement the tree command.
Given a directory it should draw a tree of sub-directories; for example:
/root
/sub1
/sub2
/sub3
/sub4
If you can do that, you’ll understand recursion.
English

@rick01 My approach is somewhat similar, and one of the reasons I built Aero.
Fed up of repeating the same pieces of core architecture over and over again for every project, I decided to abstract them all, stick them in a library, and publish them to nuget (private server for now).
English


@ntay_dev @Star_Knight12 Yeah, I like TypeScript, until I don’t—ultimately JavaScript with bells and whistles.
The type system can be super weird at times; for example, try to define a type that specifies you must pass the type itself, rather than an instance of the type; equivalent to Class<T> in Java.
English

@onix_labs @Star_Knight12 yeah sure there are some basic types
to be more specific js has types but no compile time type safety, erros at runtime, implcit typecast per default aaaaaand no guaranteed structures
typescript adds static type safety which is not perfect but solves like 90%
English

@ntay_dev @Star_Knight12 JavaScript has lots of types. Function, Number, String, Boolean, BigInt, to name a few, and anything you define with “class”.
It’s just not statically typed.
English

@CFDevelop @onehappyfellow Wait…does that mean you’ve ceased work on Osprey?
English

@onehappyfellow I blocked ocaml on Twitter cos it was starting to sound like influencers.
Then I built my own language with algebraic effects.
Then I realised ocaml is already the language I was looking for and I didn’t need to make a compiler
English

@edandersen Having worked with (designed even, albeit corporate) digital ID, I’m fascinated by the technology and its potential.
However, I share concerns that state-mandated digital ID could be used to impose civilian-level sanctions or restrictions, ultimately threatening civil liberties.
English

ID cards are not a bad thing if they can replace the kafkaesque shadow ID system in the UK made up of utility bills, drivers licenses, bus basses, tenancy agreements and whatever else.
Its making it Digital only and calling it "Digital ID" thats the problem. Many countries have cryptographically secure physical cards that prevent illegal working and visa overstaying and prevents the need for the "hostile environment" of landlords, employers, banks etc being unpaid border control workers.
The real reason the UK backtracked on the original Labour plan for physical ID cards was that the Tories realized their rich mates living in London with cash on tourist visas would not be able to any more. You simply cannot have high levels of immigration (no matter your stance on this) without an ID card and resident registration system that covers everyone.
Imagine being able to accurately know how many people live where, you'd be able to provision the correct amount of schools, doctors, hospitals, roads, housing etc! Actual governance!
James Melville 🚜@JamesMelville
“It’s for your safety, convenience and efficiency.” - the manipulative mantra of every authoritarian who has ever existed.
English

@kristijan_kralj Unless within your application, there is a semantic difference between “there is no list” and “the list is empty”, in which case, I would encourage the Optional<T> (aka Maybe<T>) instead of null.
English

The best C# lesson you'll receive today:
(to cut down your bugs by 50%)
Don't return null collections from your methods.
Return empty ones.
STOP:
- Making the caller check for null
- Cluttering your code with unnecessary conditionals
- Risking runtime exceptions that are hard to trace
START:
- Returning new List()
- Returning Enumerable.Empty()
- Returning [ ] (C# 12 feature: collection expression)
This is how you build safe, clean, and readable code.
Let everyone else drown in null checks.

English

@malighieri @Dave_DotNet There’s a rebuttal on code completion in the attached blog post.
English

@onix_labs @Dave_DotNet I don't like it either and I would probably have to configure naming conventions to stop prompting about it, but it helps code completion find them quickly once you star typing _ to access the injected ones
English






