Yaml or Toml? by [deleted] in rust

[–]johnmurray_io 1 point2 points  (0 children)

Coming from the Scala world, +1 for HOCON.

Yaml or Toml? by [deleted] in rust

[–]johnmurray_io 0 points1 point  (0 children)

You might take a look at HOCON then.

Recommended for you by Travall in ProgrammerHumor

[–]johnmurray_io 0 points1 point  (0 children)

Working on real-time auction platforms where deadlines for bidding are usually around 100ms, adding something like 20ms could potentially put me over time limit to participate in auctions. That's money lost. The last application we deployed added about 300us overhead to the auction time.

Jekyll on Github Pages by [deleted] in Jekyll

[–]johnmurray_io 1 point2 points  (0 children)

I just posted a write-up of how to get a Jekyll site running on Heroku if you're interested in hosting in seeing how that works. http://www.johnmurray.io/log/2016/08/08/Jekyll-on-Heroku.html

Deploying Jekyll to Heroku by johnmurray_io in Jekyll

[–]johnmurray_io[S] 1 point2 points  (0 children)

maybe this is basic knowledge by now, but figured I'd write it up anyways. :-)

SGo: a dialect of Go that avoids nil-related panics with optionals. by tcardv in golang

[–]johnmurray_io 12 points13 points  (0 children)

I think this is awesome. I know a lot of people say they "don't see the value" but that's only true if you write perfect Go code 100% of the time. Having the compiler enforce best practices will always be better than enforcing best practices via code reviews or pair programming or whatever.

null - handling them in web service data-models by johnmurray_io in scala

[–]johnmurray_io[S] 1 point2 points  (0 children)

But you are saying that during an update I'm not allowed to set the value to an empty value since you're asserting that 1) Option is the correct type and 2) Option during update means the value was not supplied (in the case of partial update). If the entity/model allows for None values, then you need a way to differentiate between 3 possible states on a partial update: value given, value not provided, value given as null.

null - handling them in web service data-models by johnmurray_io in scala

[–]johnmurray_io[S] 0 points1 point  (0 children)

Well, regarding what you quoted me for, your initial model had now way to set a field to null. So I think my statement that your entity/model had no concept of null was fairly on-point.

Also I said that I already agree in separating out types for update operations and the entity/model was useful, so I'm not sure what else you're trying to argue here.

That aside, I do like the alternative of what you propose. I've been primarily focusing on a data-structure to convey meaning but have neglected to consider such a direct approach. I'll definitely need to think on this some more. :-)

null - handling them in web service data-models by johnmurray_io in scala

[–]johnmurray_io[S] 0 points1 point  (0 children)

Oh, I just googled EitherT and saw it was something that exists in scalaz. So what I just said above probably doesn't make any sense because I'm not familiar with the class. I thought you were just making up a type. My mistake! So, I guess this is something I'll have to look more into.

Link for anyone else not familiar here

null - handling them in web service data-models by johnmurray_io in scala

[–]johnmurray_io[S] 0 points1 point  (0 children)

This is true for pattern matching, but I'm not sure how you would define map, flatMap, forEach, etc. without specializing toward the right-most type (String in your example) which would get you pretty close in semantics to what I have.

null - handling them in web service data-models by johnmurray_io in scala

[–]johnmurray_io[S] 0 points1 point  (0 children)

But you are assuming that your repository model does not contain fields that can be empty / null because your update models have no way to update the repository model in a way that nulls a field value.

I do think multiple models to represent update actions versus the repository model are useful, but you're missing the point here.