HN user

justasitsounds

170 karma
Posts0
Comments49
View on HN
No posts found.

I don’t know Go well, but this API would surely piss Alan Kay off.

Why a function that takes an Actor instead of each Actor being a type that implements a receive function?

That function is a method with receiver type `Actor` - IE `Actor` implements this HandleMessage function.

Granted it is exactly equivalent to ``` func HandleMessage(a *Actor, from gen.PID, message any) error { ... } ```

But I'm happy sticking with composition over inheritance

Coding is the tip of the 'working in software' iceberg. If you don't see value in being able to communicate the reasons behind the technical choices and trade-offs you've made, both within your own team and to other stakeholders then you'll quickly find that your coding time is quickly eaten up by people asking you to explain it.

If you value periods of deep focus or 'flow' then believe me, having concise, accurate documentation that explains why, how and what you are building pays off - if only to help you separate the planning from execution process in your own workflow. I don't think any moderately complex software can be written without some degree of planning - but maybe your experience differs

My house is in a mobile phone blackspot - no reception on any network. I tell every guest if they want to receive or make calls they have to join my wifi and enable wifi calling.

Fine, it's the threat of your guns that is doing such a grand job of keeping you all so very free.

Almost 1% of US citizens are in prison. Your police forces routinely brutalise and oppress large parts of your population even though (or perhaps because) you are all armed to the teeth. The majority of your fellow citizens are a couple of paychecks or one health scare away from homelessness, your social security safety nets are in tatters and your collective Labour rights have been eroded away over the last 50 years. Thank goodness you've got your guns or your government might screw you over

It is difficult for governments to commit large scale atrocities without the consent of the governed unless those so governed are first disarmed.

Not when the government has tanks, attack helicopters and assorted hardware that IS prohibited for the public to own

A more modern example was the prohibition of the free movement of the Australian population during covid. Australians were held prisoner by the state and were not permitted to leave.

Not true. You could leave and you could also enter - but would have to stay in mandatory quarantine.

The world's first commercial liquid air battery project has been commissioned to be built in Trafford, Greater Manchester, UK - it's a very residential area: https://www.gov.uk/government/news/greater-manchester-to-hou....

This guy (https://www.youtube.com/watch?v=tMLu9Dtw9yI) makes some good points about how cheap and scalable the technology is for medium-scale energy storage. It uses tried and tested, reliable and simple components for example

This story hits very close to home for me.

Back in 2001 I worked for a 'Medical Communications' company, building marketing websites for various drugs companies. I was young, it was my first coding job and I desperately needed the money

I even ended up building an internal marketing website for use by sales reps pushing an antidepressant. It was an awful PoS, technically, but it had a basic CMS system and I was flown to the US (from the UK) to show the very friendly team at the drug company how to use it. I was fairly blasé about the ethics of it - they paid a lot of money after all. The drug in question was later removed from the market after it was found to increase suicide risk.

14 years later, my mother had maxxed out on the same kind of anti-depressant. She kept relapsing and the doctors kept upping the dose until they couldn't prescribe her any more. She took her own life shortly after.

Not so long ago, I interviewed a candidate for a data engineer position at the 'FinTech' I was lead engineer at. He turned us down because he didn't like the CTOs attitude towards the credit data we were collecting about our customers. Until that point I hadn't really considered the ethics of what we were doing, again. I started looking for another job the same day.

I know it's been mentioned before, but I really feel there is a need to codify an 'internet lore law' about how many comments can appear on a Go themed HN post before someone brings up how superior Rust is

Something like: Pikes law of unfavourable comparison OR HN Golang oxidation rate

plantUML[0] may be what you're looking for, specifically the activity diagrams[1].I've been using it extensively for sequence diagrams (has more features than websequencediagrams.com). Most recently I've been using this C4 architecture diagrams extension[2]. There's a VSCode preview extension[3] and a docker image[4] for running a plantUML server locally that lets me create and share version controlled diagrams with my colleagues easily.

I especially like that there's an ascii renderer for the sequence diagrams that makes embedding them in Readme's very easy

[0] http://plantuml.com/ [1] http://plantuml.com/activity-diagram-beta [2] https://github.com/RicardoNiepel/C4-PlantUML [3] https://marketplace.visualstudio.com/items?itemName=jebbs.pl... [4] https://hub.docker.com/r/plantuml/plantuml-server/

  I'm sorry that this will come across as rude, but I feel like you're repeating something you've heard but didn't quite understand.
You're right, it does come across as both rude and condescending, and you know it, so don't apologise.
  In my previous post I hinted that the name of the function should "describe what the function does", which is the same as "describe the intention of the function", because if the function doesn't do what it's intended to do, that's a bug.
`is_foolike` to me, implies `test_for_abstract_quality_foo`. `starts_with_foo` implies an assertion a string beginning with a particular prefix
  If we're representing beverages as strings which are somehow guaranteed to begin with "co2" if the beverage is carbonated, and we've decided that the deserialization should be mixed into your "high-level, in your business domain", the program is so badly written that we're not going to get any truths about good programming from it
I feel like you're intentionally misunderstanding my point. Please don't critique my entirely fictitious codebase as if it represents anything other than an abstract example. The point being that even though, in this (again) entirely fictitious example, the implementation is very simple, the intention of the method is different from it's implementation

`is_foolike` is a bad name if you name your methods to only describe how they are implemented internally.

At a high-level, in your business domain, you generally write your code to hide the implementation details and to describe the intention of the method EG. `is_carbonated`

  if is_carbonated(beverage):
    beverage.jiggle(false)
vs
  if beverage.startswith("co2"):
    beverage.jiggle(false)
(edit) for formatting

In this case the desired functionality can be encompassed in a single standard library method.

However, the author of the code may have started with a much more complex implementation but still feels like `is_foolike()` is better at describing the _intention_ of the method than the eventual implementation.

Replacing the descriptive method name with the actual implementation may mean the author now feels that they have to append a non-functional comment to explain that in order to test for foo-ness one only needs to do a simple string-prefix match.

Well, if we're talking about potential, most pro-lifers make exceptions for cases of rape or incest. However, if it's one's "sincerely held belief" that a ball of cells is a human because it has the potential to become a conscious human being then such exceptions are the equivalent to killing an adult who's only crime is to have been conceived as a result of rape or incest.

Personally I am pro-choice, but if you are really pro-life you cannot morally allow for exceptions in the case of rape or incest- unless of course your stated agenda isn't the same as your real agenda

Genuinely interested to hear/read these use cases. I'm using a serverless stack at the moment (AWS Api GW + Lambda), and after the initial headaches of wrestling with Cloudformation it's been relatively simple and performant

We use golang lambdas, binaries are built in our CI pipeline. Build stage takes ~10 seconds, tests (integration + unit) take ~30 seconds. We use AWS SAM for generating our CFN templates, we package and deploy using the AWS Cloudformation CLI and this takes the remaining 3-4 minutes.

I didn't include post-deployment end-to-end tests in the 5 minute figure, but technically speaking, we do deploy that quickly

In my case switching to an AWS API Gateway + Lambda stack means I have zero-downtime, canary deployments that take less than 5 minutes to deploy from version control. Api Gateway is configured using the same swagger doc that autogenerates my request/response models (go-swagger) and (almost) completely removes routing, request logging, throttling and authentication concerns from the request handlers. Combined with a staticly hosted front-end and SNS/SQS+lambda pub-sub for out-of-process workers I never have to worry about auto-scaling, load-balancing or cache-invalidation and we only pay for what we use. It may not suit every use case, but in our case, we have bursty, relatively low-volume traffic and the hosting bill for our public-facing site/service that comprises most of the main business revenue is the same as a rounding error on our BI service bill.

AWS's Golang support for Lambda involves including their library and passing your function to a Lambda initializer function

AWS announced 'native' Golang support last year - since then there hasn't been a need to use a Python or node 'shim' to bootstrap the golang executable like this. You just upload your compiled binary to S3 and provide the path to AWS lambda