Giter VIP home page Giter VIP logo

assertfail's People

Contributors

dependabot[bot] avatar jackoliver avatar wallymathieu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

assertfail's Issues

Why shouldn't you use your favorite technology?

  • Does it benefit the team? Can the team use and understand the tech? Will it increase the workload of the team with little benefit right now?
  • Is it compatible with the company recruiting strategy? I.e. what kind of skillset is required to operate?
  • What's the cost of the technology? Has it become aggressively prised?
  • Is it the right time for it? Is it useful right now? Are you gold plating?
  • Just because a big company pushes the tech does not mean that it will help you. Have you bought into their marketing spiel and hype? Have you tested it in real deployment under load?

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.

Go

When is Go a nice language?

Note the influence of C from Ken Thompson?

What's missing?
Null, error handling

Conceptual dependencies instead of explicit library dependencies

  • Dependency injection container: Func<Type, Object> or Func<Type, string, Object> vs System.IServiceProvider

    • Are concrete types automatically registered?
    • Can you have multiple things of the same type registered?
    • Does the order of registrations matter?
  • 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)

    • is the string a template? are the objects added as context regardless of the string?
  • Parameters and configurable options : why is a POCO class not enough? Could Func<Poco> fill the same role?

Identity Server

  • OAuth is kind of complicated
  • identity server is very opinionated, so unless you subscribe to their view you might hurt (for instance if business want a different login flow, it's hard to implement)

It would perhaps been better to have API gateway (hosted with identity server) for site code and used regular cookie auth?

Kotlin

Kotlin looks interesting as an alternative when programming Java.

Code styles, C# vs F#

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:

  • Following FSharp design guidelines. A good example of code following these guidelines are FSharpx.
  • Writing a smaller subset of f# inspired by Don Syme's view of f# : it should be very beginner friendly. You should try to avoid certain constructs that are harder for beginners to understand like <| or ((=) (a,b)).
  • Writing FSharpPlus enabled code. It's essentially a different dialect of f#. You can write some of your code in a very clean way. It draws inspiration from Haskell, but takes it in a slightly different direction.
  • Writing OCaml inspired code. You prefer 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

  • Writing mostly object oriented code in f#. You get a cleaner syntax than c#.

https://gist.github.com/swlaschin/485f418fede6b6a36d89

https://gist.github.com/swlaschin/149deab2d457d8c1be37#file-jsonparser-fsx

F# styles

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:

Better c#

Easier to declare classes
https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/operator-overloading

F#+ style

Module oriented style

https://fsharpforfunandprofit.com/posts/recipe-part3/

Inline object declaration to implement interface

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

C#

Example C# ceremony:

  • having to create a named class to just return value with IDisposable
  • Having to declare Func and Action explicitly with type annotations
  • "public"
  • No object expression + 'with'
  • Iffing instead of pattern matching (or not a robust way of doing it)
  • static class instead of 'module'
  • Class hierarchy instead of ADT
  • How do you declare a newtype?
  • And the 'one type per file' convention

NLog

Throwing exceptions in the error handler?

Post about struct equals

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?

Java 11 vs c#

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.

Js is confusing (how does it compare to Elm)

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:

  • Easy to get started
  • Dynamic
  • Loots of innovation
  • An async model that is easier to grokk than multithreading

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 ?

Render data by template

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

Why f# and why not?

Pros

  • brevity and readability (productivity)
    • ctor dependencies
    • record declaration
    • more inference
  • sensible defaults for mutability, access level
  • discriminated unions : sensible declaration of simple enumeration types and union types (compared to the options for c#)
  • focus on composition over inheritance
  • shared runtime with other .net languages
  • nice OO style language
  • nice story around integrations with type providers
  • possible to be more explicit and less explicit than what's seen in c#
  • no implicit type conversions
  • very mature

Cons

  • most c# developers want to ignore anything else than c# : the one ring, fear of the other
  • current msbuild/nuget developments have left big community driven projects such as paket, FAKE have taken flack due to msbuild/nuget breaking changes
  • low market penetration (looks like it's around same numbers as Haskell in some markets)

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:

  • c# is good for low level implementations
  • c# is good enough for services with less need to deal with complex domain (simple ~= CRUD + simple domain logic)
  • F# shines when you have something novel that might be kind of complicated to implement.
  • f# can be quite productive: spike or POC work when there is no demand on continued operation by commonly available worker

Beautiful F#

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.

Haskell vs f# vs ocaml vs others

  • f# is a nice OO language, it's possible to have a mix of impure and pure code that is performant. You get some benefits and downsides from being very compatible with c# et.c..
  • OCaml has awesome single threaded performance and you have lwt library for async code, you have some interesting work in Mirage that could imply really cheap hosting
  • Haskell is very pure, both a pro and a con. This simplifies reasoning. You can allow untrusted programmers to write modules as long as you apply certain restrictions on the modules.

https://serokell.io/blog/rust-vs-haskell

Helm

  • What value does Helm + tiller provide except templating?
  • Not a package manager, more like a template manager

Comparison of stateless and stateful db mapping

Is there a historical view we can find?

  • Raw SQL using DataReader, JDBC, SqlDataReader, ...
  • DataSet, active record, Typed dataset
  • Dapper, massive, PetaPoco : how do they compare to DAL/DA ?
  • SQL focused libraries: Hyperboliq and jooq
  • ORM and entities referenced by ORM in order to keep track of them
    • stateful entities (how does it compare to DS?)
    • stateless
    • hibernate and nhibernate compared to EF

Are SQL type provider unique type of DB mapper?

https://stackoverflow.com/questions/37644957/what-is-the-difference-between-dal-dto-and-dao-in-a-3-tier-architecture-style-i/37751345

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.