HNHacker News
TopNewBestAskShowJobs

macca321

846 karma · joined May 15, 2010

mcintyre321 (at) gmail com
submissionscomments
macca321··on What it feels like to be in the zone as a programmer
Then the next day you realise how to achieve the same thing in a tenth of the code...
macca321··on The Problem with F# Evangelism
We're singing from the same hymn sheet :)

https://github.com/mcintyre321/OneOf https://github.com/mcintyre321/ValueOf

macca321··on The Problem with F# Evangelism
We're singing from the same hymn sheet

https://github.com/mcintyre321/OneOf

https://github.com/mcintyre321/ValueOf

macca321··on The Problem with F# Evangelism
I think a better approach is encouraging the use of functional/F# concepts in C#.
macca321··on How I didn't become a SoundClouder
Except when you deliver the homework, working, with tests, and then you receive a rejection with incorrect bikesheddy feedback , or even worse, no feedback at all.
macca321··on TDD did not live up to expectations
This is the only comment to mention ATDD, and none mention BDD. :(
macca321··on Ask HN: Real time communication for .NET Core
It's actually dead easy to write a controller implementing Server Sent Events (SSE) which is one of the technologies SignalR uses. There are various articles on it if you Google around.
macca321··on Ask HN: What resources are there for a strong dev to learn computer science?
This book http://rob.conery.io/2016/07/03/imposters-handbook/ is written specifically with you in mind.
macca321··on Announcing .NET Core 2.0 Preview 2
I wonder if core has actually tempted anyone from osx/linux-land to use .net, or if the traffic is all in the other direction
macca321··on How to Interview Engineers
The problem with interviews is that there is no time for false starts. When approaching a coding problem in real life, I pick a solution that seems to be right.

Half the time I pick a good solution and half the time I've rushed in and picked the wrong one.

If I have picked the wrong one, I know within 30 mins that it is a flawed approach, but have usually explored the problem sufficiently to pick a good solution. The interview unfortunately ends after 30 mins.

I should also add that I'm not much better at this after 13 years of professional development than I was when I left uni, when it comes to manipulating linked lists and arrays. My systems design is a lot better though.

macca321··on Craig Venter's ‘Digital-To-Biological Converter’ Is Real
A dark possibility - a baby printed on another planet and raised by software.
macca321··on Ask HN: How can one learn to build API gateways?
Start with an open source http proxy

http://www.catonmat.net/http-proxy-in-nodejs/

https://github.com/nodejitsu/node-http-proxy

macca321··on Rules for REST API URI Design
And in a 'true' REST API the pretty name for humans should be in the link text, not the href
macca321··on Rules for REST API URI Design
Yes, The article is talking about REST as in "JSON RPC over HTTP" as opposed to REST as the person who came up with it (Roy Fielding) intended.

If you are worrying about URL readability you aren't doing REST.

macca321··on How to Improve a Legacy Codebase
Another thing you can do is start recording all requests that cause changes to the system in an event store (a la event sourcing). Once you have this in place, you can use the event stream to project a new read model (e.g.a new, coherent, database structure).
macca321··on SQL Notebook
LINQPad is amazing. I have a full licence and have persuaded a couple of companies to buy site licences before.

It's would be great if there was some kind of full version trial so people could try it with full intellisense and package manager support.

macca321··on Pattern Matching for Java
I retrofitted F# style "discriminated unions" (which are basically sealed heirarchies) into C# by creating a series of generic types `OneOf<T0, ..., Tn>` which can hold exactly one value,

Each type has a `.Match` and `.Switch` methods, in to which you have to pass lambdas to handle each case `.Match(Func<T0, TResult, ..., Func<Tn, TResult>`.

I don't know if this would work in Java, given the generic type erasure, but it might...

1. https://github.com/mcintyre321/OneOf

macca321··on Semantic UI
I'd like to find a framework like this that comes with platform-neutral (handlebars or similar) templates for each component
macca321··on Will Spotify go public without an IPO?
They should go mutual and offer shares to their customers.
macca321··on Problems with Swagger
You can use game AI techniques like needs-based-AI to create smart, resilient clients. What fun!
macca321··on Problems with Swagger
You're hard-coding 'terms' from a hypermedia 'vocab'.

The thing is, if you use well-known terms, your client will work against ANY API that uses those terms, not just the one that you coded it to work against.

Not only that, but the APIs will have flexibility to move things around, or delegate functionality to other hosts by linking through.

As for the cost of walking the chain, once a target resource has been found the can be cached, and you only need to rewalk if the resource 404/410s.

macca321··on Ask HN: Which non-technology book has influenced you the most and why?
Catch 22. I use Yossarian's behaviour to justify my own.
macca321··on Redis as a JSON store
>Since there does not exist a standard for path syntax, ReJSON implements its own.

Well there's this: JavaScript Object Notation (JSON) Pointer RFC https://tools.ietf.org/html/rfc6901

macca321··on Ask HN: I got duped into working on legacy code, should I leave?
Must be Wasabi
macca321··on Ask HN: I got duped into working on legacy code, should I leave?
Add regression tests, replace with your own code. or quit.
macca321··on New Features in C# 7.0
And another called RoslynPad
macca321··on Zen and the Art of Unit Testing
It's a shame that the functional requirements, which were neatly stated in the spec, weren't preserved in the test code.

Rather than "arrange", "act", "assert", I've taken to writing the Gherkin spec inline with the test code, e.g.

  @Test
  public void onlyExistingEmailsCanResetTheirPasswords() {
   //Given an email address which is not in the database 
      String email =  "unknown@example.com";
      when(userRepository.findByEmailAddress("unknown@example.com"))
	   .thenReturn(null);
      
   //When a password reset is requested for that email
   UserServiceImpl userService = ...
   userService.startResetPasswordProcess("unknown@example.com");

   //Then no password reset notification should be sent
   verify(notificationService, never()).sendResetPasswordNotification(any());
   //And the user should be given a success message so they can't determine if the email address is already present
   verify(userInterface, once()).sendMessage("You have been sent Please check your email.");
  }
This way you preserve the intent for the programmers that will come after you, but you don't need a complicated Gherkin runner
macca321··on Show HN: SpreadServe – Cloud automation for Excel spreadsheets
I had a summer job in 1997 at a large Insurers (kill me), and people on my team would spend at least half an hour a day waiting for networked, dependent Excel files to calculate after opening them.

Since then, I have always suspected it was still a problem in large financial institutions, although the few times I mentioned it to people they looked at me blankly. Now I feel vindicated!

Out of interest, does the Financial Industry use any analogues to source control and unit testing for spreadsheets?

macca321··on Update: CRISPR
You can edit the genes so they are always passed on, rather than passed on half the time. This means that the genes will eventually spread to every organism in the species (given enough generations, but it will be an exponential rate).

It's cool you could encode your name into your genes and then it would live on as long as humanity.

macca321··on New Features in C# 7.0
For anyone who is disappointed at the lack of exhaustive matching / Discriminated Unions, please try out my library OneOf* (https://github.com/mcintyre321/OneOf). Hopefully something similar will be brought into C# soon, but in the meantime, these libraries provide fairly idiomatic substitutes.

Also, ValueUtils (https://www.nuget.org/packages/ValueUtils/) is nice for making value types.

*or one of the many alternatives (https://www.nuget.org/packages?q=discriminated+unions) e.g. SuccincT, DiscU

← PreviousPage 6 of 13Next →