HNHacker News
TopNewBestAskShowJobs

teytra

26 karma · joined September 26, 2023

submissionscomments
teytra··on Water-injected 2.0-liter hydrogen engine makes 410 horsepower
Where do you live? Here in Europe everybody I know has electricity at home. I only know one person who has a petrol/gas pump (he runs a gas station).
teytra··on GnuCash Tutorial and Concepts Guide
I have the same need, and now I'm trying out a system where I put a "label" or "tag" in the Memo or Notes field (e.g. #SummerHoliday2023) that I then can create a filter for and generate a report for.

Got the idea from https://money.stackexchange.com/questions/91029/gnucash-tags...

teytra··on YAML: Probably not so great after all
I cannot agree to the statement "Everyone hates yaml".

If that was true, it wouldn't have been used as much as it is.

teytra··on YAML: Probably not so great after all
TABs should be used for indentation, making it line up pretty.

SPace is for separating words.

Modern editors (and old ones too) should be able to show what is a TAB, so there is no reason to be confused.

The problem is that people think of TABs as a certain number of spaces, as if an indentation must be a certain number of spaces. In Python or Yaml etc, the logical construct is to have "one indentation level" for things like the statemants that belong to an if, or whatever. Requiring people to put in a somewhat randomly chosen number of spaces is just silly. It is "one level", so the logical choise would have been to put in one symbol to designate this fact, then use the settings of the editor to show it as you want (how many "spaces" to move), and this can change depending on personal choice, the monitor you use, etc.

teytra··on YAML: Probably not so great after all
One of the nice things with Python compared to, say C, is that what you see visually is what you get. I.e. if you use TAB and not spaces to indent lines or are very careful about how many spaces you put in, but then you lose the ability to quickly change the visual representation.

In C you actually use indentation when you write code to make it readable for humans, but the machine doesn't care, so there is a disconnect between the visual and how it is parsed.

You have to both use indentation add a lot of curly-braces to your code. In Pyhon you don't have this double-work.

teytra··on YAML: Probably not so great after all
The problem is that people use spaces and not TABs here.

The TABualator key was invented for this purpose, in the age of the typewriter, to make things visually stand out by grouping it in the same column of a table. So all the lines that belong together are listed with the same indent, (originally all items belonging in the same column being listed under the same heading).

Example

    user:
      given_name: something
      family_name: somenting
Using a somewhat randomly number of spaces is just silly, the two name lines is one hierarcical level below "user" so add one tab char to represent that fact. Then you can vary the visual representation in your editor to your liking.

json is created to make it easy for machines to parse, not humans. Leave it to the machines.

Actually: one of the reasons TABis misunderstood is that cheap typewriters didn't have adjustable tabulator positions, and when computers came along it was often implemented with fixed columns (typically every 8), so people think of TAB as 8 spaces, which often is not what you want.

← PreviousPage 2 of 2