5 ms·
How is it unreadable? I've spent a fair amount of time digging my teeth into it, and I find it fantastic. It's terse, but far from unreadable.
by kick 7y ago
How is it unreadable? I've spent a fair amount of time digging my teeth into it, and I find it fantastic. It's terse, but far from unreadable.
- saagarjha 7y ago> I've spent a fair amount of time digging my teeth into it I tend to label code that makes me do that "unreadable"; it's not that I literally can't read it (I routinely deal with worse) but it requires more effort than I consider reasonable for the medium it is presented in.
- kick 7y ago"digging my teeth into it" wasn't meant to imply difficulty in any way, it was meant to imply depth: it's easier to read than most C codebases.
- saagarjha 7y agoPlease point me at these C codebases so I can steer clear of them except for when I need inspiration while writing reversing CTF challenges.
- anonymoushn 7y agoYou might try nginx?
- saagarjha 7y agoSeems fairly reasonable to me?
- anonymoushn 7y agoit's totally full of unwritten assumptions and the same header is usually parsed in several places slightly differently. it's a spooky action at a distance playground.
- tluyben2 7y agoBut it conveys far more information for one page than you have in other styles, so obviously it will take you more time to read + understand it. It's far more content dense. If you change the style, you probably spend more time reading it, spread over more pages & files and personally that takes me more time to read + understand (depending on the functionality, much more).
- smcl 7y agoUsually it falls on the accuser to justify their accusation, however we are discussing if code like this is unreadable: https://bitbucket.org/ngn/k/src/master/m.c https://bitbucket.org/ngn/k/src/master/m.c It is plain to any developer that this fits all definitions of "unreadable" and honestly I think in this case it falls on you to explain why you think it isn't.
- geocar 7y ago> It is plain to any developer False. I am a developer. It is readable to me. > I think in this case it falls on you to explain why you think it isn't Why code isn't unreadable? What a silly question! You simply don't know how to read it. If you do not know Java, you might say all Java code is unreadable. Why would you expect any other language to be different?
- deleted 7y ago
- bakul 7y agoIf you are interested, try something like this to start making sense of the code: cc -E m.c | indent | grep -v INDENT | less and separately read k.h for typedefs etc.
- geocar 7y agoSure. The variables x,y,z are used to describe the first, second and third arguments. This is a common convention, so you get used to it. tX, tA and ta are type enums. A1(f,b) is just a 1-ary function f with the body b; A2 2-ary, and A3 3-ary. A_(f...) is a list of A (box) objects; literally (A[])({f1, f2, ... fn}) to avoid an extra definition. atnv is a mnemonic for allocate of (t)ype, le(n)gth, (v)alues. This is not dissimilar from Arthur's ktn(t,n) function, except it also fills the buffer with the values (memcpy). These are allocation wrappers for the rest of the interpreter. I've tried to write some about why this style is better on HN previously: - https://news.ycombinator.com/item?id=10876975 https://news.ycombinator.com/item?id=10876975 - https://news.ycombinator.com/item?id=8476294 https://news.ycombinator.com/item?id=8476294 and I'm used to a certain amount of abuse from people who think I'm "trolling" because I have adopted a similar style for my own work: - https://github.com/geocar/dash/blob/master/d.c#L63 https://github.com/geocar/dash/blob/master/d.c#L63 - https://github.com/geocar/con/blob/master/con.c https://github.com/geocar/con/blob/master/con.c I don't let it bother me though. Occasionally you meet people who can be convinced to take a certain leap of faith, and then you get to have very interesting conversations about making software that you can't have otherwise. Perhaps you've heard this said of other things as well: That learning lisp makes you a better programmer even if you do not use lisp. This thing here, is kind of like that.