News for hackers. Stuff that matters.
Re:Show HN: Togomak – declarative pipeline orchestrator base... by dpedu on Tuesday October 24, 2023 @09:15PM (#38007960)
I think you're looking at this basic snippet and taking it for something it's not. Not shown in this example and considered best practice are:

- Defining and validating data structures passed in; type doesn't have to be a basic type, it can be complex objects

- Default value

- Input validation criteria

So, with a real world example this is still going to be less verbose than the java equivalents.

Re:Show HN: Togomak – declarative pipeline orchestrator base... by latchkey on Tuesday October 24, 2023 @09:42PM (#38008120)
Sorry, won't back down that HCL is junk. When it is easier to not do best practices in examples, then you're off on the wrong foot to begin with.
Re:Show HN: Togomak – declarative pipeline orchestrator base... by dpedu on Wednesday October 25, 2023 @01:23PM (#38015400)
I could point out how it's way, way easier in java programs, since we're picking on java, to skip over doing things like this. Or I could point out how the bar to do things correctly is lower in this hcl example than the equivalent java. Or I could point out how the things I named as best practices can look in the real world, which seems to be the best course of discussion since unfamiliarity seems to be an issue here:

You have a type defined, it's just string. There's no default, which means it's a required input. Required inputs obviously can't have a default. Arbitrary strings are a perfectly acceptable input and without seeing how that variable is actually used, I can't speculate about validation criteria and it is very reasonable that for arbitrary strings there are none.

Re:Show HN: Togomak – declarative pipeline orchestrator base... by srevinsaju on Wednesday October 25, 2023 @05:10AM (#38010822)
It's also interesting that this is also a valid variable definition which does the same thing, but without the bells and whistles:

  variable "name" {}