3 ms·
Indeed. But that was in reference to the actual array-programming language. I get that they have their own special syntax, and the terseness helps in a way. On
by jiggawatts 5y ago
Indeed. But that was in reference to the actual array-programming language. I get that they have their own special syntax, and the terseness helps in a way.
One talk I saw by a proponent explained that the intention is that you often change just the trailing character (or 2 or 3) to "twiddle" a query until it does what you want.
That interactivity makes sense to me. I do similar things with query languages like KQL.
But... in C? It's compiled! You have to "run" it!
Not to mention that it makes no syntactical sense in C to be fiddling around with suffixes. It has nested brackets that need to be properly closed! It's procedural, not declarative, so even if you condense the syntax, you don't "win" that much in the end.
There is literally no way that anyone could ever justify using single character source file names. That's just absurd. Note that the author had to put a little table explaining what each single-character file does/contains.
WHY NOT JUST NAME THEM to match their function!?
So instead of this madness:
0.c syscalls and main()
m.c memory manager
p.c parser
k.h embedding api
a.h common header
g.h header generated by g.k
Just use words like a normal human:
main.c
memory.c
parser.c
embedding.h
common.h
generated.h
- gitonthescene 5y ago
- omnicognate 5y agoBecause I can already look at a sock and see it's a sock. If you're keen on this style, perhaps you should pack all the socks, underwear and other objects in your home into identical boxes and put labels like "~" and "z" on them.
- gitonthescene 5y agoFunnily enough, I don’t need a label for the drawer I keep my socks in. None of my drawers have labels. See what I’m saying here?
- omnicognate 5y agoI do. You're saying you see your code as a personal posession, whose structure you know and understand. You're saying it doesn't matter how easy your code is for somebody else to get their head round because, like your sock drawer, you don't imagine other people will go rummaging around in it. It's not an attitude I approve of in colleagues, for obvious reasons. Fortunately it's a long time since I've had to work with anyone that thinks that way. They don't survive in workplaces like mine.
- gitonthescene 5y agoWhich colleagues are you talking about in this context? In any event I’ve worked for over twenty years in companies with thousands of employees and I can’t remember a single time that the name of a source file made any practical difference in my day. I think the naysayers are having their own conversations distinct from actual reality of what’s happening here. “I wouldn’t do this” is a perfectly reasonable reaction but not at all useful in a public discussion.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- tzmudzin 5y agohttps://news.ycombinator.com/item?id=31361023#31365022 https://news.ycombinator.com/item?id=31361023#31365022 Ridiculing the value of documentation does not make you look smart. It rather hints at lack of experience with truly complex systems or collaboration in teams.
- gitonthescene 5y agoAre you saying this is a complex system or that any decisions made in the context of complex systems must be used for all software? Also, this was not in response to a post about documentation but rather a post about the file names. In any event, it says nothing about my experience and you are simply extrapolating.
- zozbot234 5y agoYou can always write documentation in comments. Using terse names for the identifiers when feasible can make it a lot easier to see the bigger picture wrt. multiple components interacting. It's a tradeoff.
- tzmudzin 5y agoAgreed, and it would probably be my preference. The code referenced here is pretty extreme NOT providing the guidance, hence my response to the poster defending the extreme and ridiculing the good practice.
- deleted 5y ago[deleted]