[ / / / / / / / / / / / / / ] [ dir / animu / doomer / egy / hkpol / jenny / kohl / strek / vichan ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): c391433ae4e904c⋯.jpeg (366.57 KB, 1280x720, 16:9, scroll-library.jpeg) (h) (u)

[–]

 No.1067666>>1067767 [Watch Thread][Show All Posts]

I just found out about this. Basically, a book is written to explain the workings of a program. The book is the source. The program can be compiled from a pdf.

>Most programmers are still locked into the idea of making a program out of a large pile of tiny files containing pieces of programs. They do not realize that this organization was forced by the fact that machines like the PDP 11 only

had 8k of memory and a limit of 4k buffers in the editor. Thus there was a lot of machinery built up, such as overlay linkers, to try to reconstruct the whole program.

>The time has come to move into a more rational means of creating and maintaining programs. Knuth suggested we write programs like we write literature, with the idea that we are trying to communicate the ideas to other people. The

fact that the machine can also run the programs is a useful side-effect but not important.

Source (this a literate implementation of clojure): https://github.com/daly/literateclojure/blob/master/clojure.pdf

 No.1067739>>1067796

True literate programming as in "write TeX and have a program extract the application source code" only works on small or self-contained projects and is pure autism. Your programming tools cannot work with that. And you do not have to document everything. If your program implements a linked list data structure, so you really need to comment on that?

That said, I would appreciate if projects did more commentary on their source code. Have a HACKING file provide a bird's eye overview of the project structure, have comments explain the rationale or at least name the algorithm they are using. Document the interface to functions. Use docstrings if your language supports them. Not everyone has the autism superpowers to understand your barely commented code.


 No.1067750>>1067796

Literate programming is an idea worth considering, I do see Knuth's point in promoting it. I haven't been particularly motivated to do the literate programming route and intend to do it for my next "small" project.

I am personally a big believer of designing the system on paper and generating a comprehensive set of system models to model the system in multiple angles. This is important for me as it allows me to get a highly detailed understanding of the system without the burden of decoding source code by itself.


 No.1067759

I like the idea and have the book here (still unread, sadly), but one problem I already see with it is that patching becomes very difficult. Arguably the goal of LP is to prevent the need for patching, but it still somewhat bothers me. I adhere to something similar in comments though; whenever I stumble over something or do something that took a while to wrap my head around, it gets documented in a comment. This sometimes results in 30% comments by mass, but it's extremely useful.


 No.1067763>>1067765

just put all the files into an amalgamation, choose your favorite font, add a CoC, an antifa preface and done, you have your faggot hipster book.

i interpret knuth saying as "don't write spaghetti code".


 No.1067765>>1067770

>>1067763

Maybe you should read him before you "interpret", retard.


 No.1067767

>>1067666 (OP)

page iv from your source Knuth states the archival longevity of code was a foolish endeavor, and "Nothing over 30months is trustworthy or interesting. - Knuth 2010."

The idea of the code being complete (source + documentation = code) is good. I've been doing this by writing man pages within code.


 No.1067770>>1067773

>>1067765

yeah, i may be retarded, but i just can't cope to the fact he wrote a book about writing verbose code full of redundant commentaries and preprocessing macros.


 No.1067773

>>1067770

He didn't. Stop talking about shit you admittedly have no idea about, holy fuck.


 No.1067796

>>1067739

>>1067750

My thoughts exactly. I know where Knuth was coming from and I respect that, but he was an academic after all, not a practical programmer, and we all know how academics like their things. We do need more contribution guides with more overviews and no, raw UML class diagram doesn't cut it


 No.1067813>>1067817

>The fact that the machine can also run the programs is a useful side-effect but not important.

yes it is important holy fuck. The fact that other people can read it is the unimportant side effect. I'd take a program that worked well with spaghetti source over a beautiful bound typeset diagrammed book of broken code any day of the week, as would everyone else on the planet.


 No.1067817>>1067823 >>1067825

>>1067813

A spaghetti program that works well does not exist. You could prove me wrong in five seconds if it did, but you can't. On the other hand, writing about the workings of a program in clean text (which is what this is about; what is going wrong in your crankcase that you thought this was about typesetting?!) makes spaghetti design blatantly obvious. Try to describe, in full, the workings of the messier PHP functions, for instance.


 No.1067823>>1067830

>>1067817

>You could prove me wrong in five seconds if it did, but you can't.

>he can't prove himself wrong by writing A spaghetti program that works well.

Get off this board now.


 No.1067825>>1067830 >>1067835

>>1067817

>A spaghetti program that works well does not exist.

Oracle's DB is supposed to be the highest order of spaghetti code. Their customers pay them big bucks for it, which is the definition of working well.

>what is going wrong in your crankcase that you thought this was about typesetting?

I literally quoted the OP text so you could trace what I was responding to. The fact that no one has done literate programming since knuth proves that it is a vacuous concept.

>Try to describe, in full, the workings of the messier PHP functions, for instance.

PHP continues to be the most popular backend for websites, despite years of ruby and node and go shilling. No one cares that it is confusing as fuck

Pretty source code is nice, spend as long as you like picking the font to print it out in. There's no point unless the code does everything it needs to do.


 No.1067830>>1067912

>>1067823

>implying he'll be able to do that

>>1067825

Nowhere in the OP is the focus on typesetting. The only occurrence of the word is in the linked PDF when it mentions that it is typeset in LaTeX. Oracle's DB is infamous for being complete garbage. If you're going to redefine "works well" as "is popular", your previous statement becomes "I'd take a popular program with spaghetti source over literate programs", which makes me wonder why you're on an imageboard instead of Discord.


 No.1067835>>1067912


 No.1067912>>1067938

>>1067830

>Nowhere in the OP is the focus on typesetting. The only occurrence of the word is in the linked PDF when it mentions that it is typeset in LaTeX.

I didn't focus on typesetting either. I was exaggerating the degree to which OP preferred prettiness over utility, which makes it pretty funny that the linked pdf brings it up. Of course, knuth wrote a whole program/book on just typesetting, so this shouldn't be so surprising.

>Oracle's DB is infamous for being complete garbage

People don't use it because it's complete garbage, they use it because it does things that other DBs can't. I know the /tech/ meme is that we all live ascetic lives and reject all computing for being impure, but every now and then a person actually needs to get things done. In that situation, I always take the most garbage code that someone posted a mediafire link to on a forum over some beautiful, literate, source tree written in haskell that doesn't fucking work.

>>1067835

>no actual horror stories pinned on the db in a page of results

either you or ddg just got btfo.


 No.1067938

>>1067912

>i didn't read what the thread is about

>i never used oracle DB

>but here are my hot takes on why the former is shit and the latter is great

>hehe dude "le real world" you lose

Why is this board full of retards?




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
17 replies | 0 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / animu / doomer / egy / hkpol / jenny / kohl / strek / vichan ][ watchlist ]