wallymathieu / assertfail Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://assertfail.gewalli.se
License: MIT License
Home Page: https://assertfail.gewalli.se
License: MIT License
C#
Service class :
Encapsulates business logic and uses
Command handler class:
https://ayende.com/blog/159873/design-patterns-in-the-test-of-time-command
https://ayende.com/blog/159969/design-patterns-in-the-test-of-time-command-redux
Dealing with local time, don't make silly mistakes just import nodatime:
https://github.com/nodatime/nodatime/
procedural style
literal style
https://github.com/wallymathieu/entity-framework-studies/blob/dotnetcore/Web/Commands/README.md
What are the alternatives?
Is there a current solution that is good enough?
Why should you use your favorite technology?
If the tools will improve productivity while piss off potential programmers: Are you doing average kind of programming with average time constraint?
http://www.paulgraham.com/avg.html
Depending on what you are trying to do, ML style languages, Lisps, Logic programming langs can be force multipliers.
https://github.com/NRules/NRules/wiki/Getting-Started
How does it compare to Sagas?
Some have started to use it https://github.com/cloudb0x/NRules.Integration.AspNetCore
https://github.com/giraffe-fsharp/Giraffe/blob/master/src/Giraffe/Giraffe.fsproj#L57-L59
<ItemGroup Condition="'$(IsWindows)' != 'true' AND '$(TargetFramework)' == 'net461'">
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
</ItemGroup>
So how do I get net461 et.c. to work on my non windows computer?
Throwing exceptions in the error handler?
In order to write beautiful F# you should first learn to follow the F# design guidelines.
Take it easy, let it sink in. Some of the guideline suggestions are in line with what you already know when it comes to programming. Once you have learned the guidelines, you can use your poetic license to bend the rules.
https://medium.com/@xaviablaza/building-a-kubernetes-cluster-on-a-budget-1bb84156cd07
It could be nice to try out Drone to see how it is.
The point around c# developers is not uniform, there is a percentage that don't mind f# but due to low demand choose bigger market. F# seems to be a seedbed for things that sometimes end up as c# libs/tools.
My own preference:
It would perhaps been better to have API gateway (hosted with identity server) for site code and used regular cookie auth?
Lambda architecture and derivatives?
Id+info in binary format that can expand using js code template / function
Change diff -> save variants
I'm wondering if it would make sense to have something like react for data?
i.e. you transmit something like "Title|40|20" that then get rendered to :
{
"DisplayName": "Title",
"Items":[
{ "DisplayName": "FactoryReset", "Value": "40"},
{ "DisplayName": "FactoryDefault", "Value": "20"}
]
}
while "OtherTitle|40" get rendered as
{
"DisplayName": "OtherTitle",
"Items":[
{ "DisplayName": "FactoryReset", "Value": "40"}
]
}
So for certain type of data that is very well defined you could transmit only the information necessary.
That would assume that you have
Many of the missing features are now part of Java11.
The style of stream and the usage of words are more in line with other languages: computer science terms? Map filter and reduce
The words in LINQ are more in line with SQL. This gives a slightly different flavor especially since JavaScript and other popular languages go for the CS terms.
Validation in Java is similar to validation in .net. Both ecosystems have attribute based validation.
There are popular MVC frameworks for both. There are some gotchas, but any .net developer or Java developer should be able to work in both. There might be a short term productivity loss.
@matthid mentioned that you can add reference assemblies by using a separate myget feed.
This could potentially be used in order to avoid implicit dependency on Mono assemblies (compared to the type provider setup): If there is behavior that differs from Mono and the reference assemblies.
This could be added as a separate post referencing Working-on-dotnet-core-on-Mac-OS-X-part-2
How does this connect to http://brandewinder.com/2018/07/23/give-me-monsters-part-1/ ?
I like writing code in F#. It's less ceremony compared to writing it in C#. As in C#, you need to find what kind of style suits you. I've seen a few styles:
<|
or ((=) (a,b))
.function
keyword and prefer modules over objects (from what I've understood).OCaml
style is more like ML
with modules while F#
is more like .NET
OCaml style for parametrized types:
type ('a,'b) foo = Bar of 'a * 'b
while for F# is would be:
type Foo<'a,'b> = Bar of 'a * 'b
Also the way modules are being written.
Like modules in OCaml would look like this:
module Array = struct
type t = ...
end
while in F# it's more repetitive:
module Array = begin
type Array = ...
end
I think it has to do with F# has to comply with .NET
https://gist.github.com/swlaschin/485f418fede6b6a36d89
https://gist.github.com/swlaschin/149deab2d457d8c1be37#file-jsonparser-fsx
Core - simple ml style
Modules, discriminated unions, let, functions
http://fsharp.org/specs/component-design-guidelines/#-do-add-xml-documentation-comments-to-your-code
A subset of this is:
Easier to declare classes
https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/operator-overloading
https://fsharpforfunandprofit.com/posts/recipe-part3/
https://github.com/pocketberserker/FsAttoparsec
https://github.com/fsprojects/FSharpx.Extras/blob/master/src/FSharpx.Extras/Monoid.fs#L117-L120
Monoid interface
type Monoid<'T> =
abstract member Mempty : 'T
abstract member Mappend : 'T * 'T -> 'T
module List =
let monoid<'T> = { new Monoid<'T list> with
member this.Mempty = []
member this.Mappend(x, y) = List.append x y }
let cons x xs = x :: xs
https://en.wikipedia.org/wiki/Tacit_programming
Point free
Example C# ceremony:
Try build release and remove all other folders
You sometimes get the same issue with c# references
The post is not clear enough and does not convey what's distracting
Is there a historical view we can find?
Are SQL type provider unique type of DB mapper?
When is Go a nice language?
Note the influence of C from Ken Thompson?
What's missing?
Null, error handling
Only a factor 3 difference on mono. Does it matter?
But it is a factor 11 on standard .net !!
Expression compile on standard .net ...
What kind of performance do we have on regex in mono?
Kotlin looks interesting as an alternative when programming Java.
Dependency injection container: Func<Type, Object>
or Func<Type, string, Object>
vs System.IServiceProvider
Logging see logadapter vs logging abstractions
a logging abstraction could be something like Action<Exception, string, object[]>
, Action<string, object[]>
(i.e. where you have the choice to plug in whatever)
Parameters and configurable options : why is a POCO class not enough? Could Func<Poco>
fill the same role?
Js is not a good language for new developers. The sooner we start looking at it as the assembly language for the web that Hanselman mentioned the better.
JavaScript has some nice things:
I'm not sure that extending it is a good thing. You still have legacy left.
Previous way of dealing with this
:
function TCtor(){
var self = this;
// ... init
this.method = function (p1) {
// use self
}
}
New way:
class T{
method = (p1) => {
// ... use this
}
}
Both of these ways suffer from not being compatible with inheritance (and less performant than prototype based). Though that might be less of a problem.
People also use bind in the constructor (though that creates a lot of noise as well).
How does JavaScript compare to Elm ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.