Hacker News new | past | comments | ask | show | jobs | submit login

TIL about cweb. [1]

> CWEB is a version of WEB for documenting C, C++, and Java programs. WEB was adapted to C by Silvio Levy in 1987, and since then both Knuth and Levy have revised and enhanced the system in many ways, notably to support C++ and ANSI C. Thus CWEB combines TeX with today's most widely used professional programming languages.

> If you are in the software industry and do not use CWEB but your competitors do, your competitors will soon overtake you---and you'll miss out on a lot of fun besides.

I guess it never took off due to the "I'll do it latter when I have time mantra". Documenting and testing are always seen as low priority.

Trying to convert maxcliques.w but it rightfully warns about missing gb_types.w

Is there a zip file with all programs and dependencies?

texlive-binaries ctangle also seems to be losing some formatting.

[1] http://www-cs-faculty.stanford.edu/~uno/cweb.html




Nobody's business was ever ruined because of bad documentation, sadly.

Literate programming is an interesting idea from academia, but in the engineering environment of most startups it's a waste of time. Our program sources are annoying byproducts of a business, not something of value unto themselves.


> Nobody's business was ever ruined because of bad documentation, sadly.

I've seen quite a few startups fail because they had a smart, but completely undocumented code base. Then the smart programmers leave and who is left cannot handle the code and new hires take too long to get into it. Then funding runs out and the apparent lack of progress ensures that nobody wants to put more money into the company.

> Literate programming is an interesting idea from academia, but in the engineering environment of most startups it's a waste of time.

Amazingly, we're actually getting back to something that resembles literate programming - via TDD. Instead of asking for a proper spec, we now ask for test definitions that the code must pass. Those can even be written in something that is pretty close to natural language (cucumber etc) so that management can write them. Then we spend time to make the test framework understand all those pseudo-natural-language test definitions and then we finally write the code. Is that really faster? Or are we just missing the tools that would allow us to tie a natural language specification to code?


> pretty close to natural language (cucumber etc) so that management can write them

This sounds so familiar ...


What a jokester! Management doing work?

Then the engineers get to program in a less-powerful, more cumbersome language.


Nobody's business was ever obviously, directly ruined because of bad documentation, and so nobody was ever blamed for it or fired over it.


> Nobody's business was ever ruined because of bad documentation, sadly.

Maybe not ruined, but certainly severely hampered. I worked for several months with an original author of a 1M LOC application, and he was let go because the company was too cheap to re-up his contract. The documentation in that time was barely passable and it took many months of tweaking and breaking things just to get back to the point of becoming productive again. No one had a well-documented procedure on how to even compile the code until I decided to set my tasks aside(to my own schedule's detriment) so I could document all the steps and dependencies along the way. Luckily for them the company was well established and could afford the wait, others may not have that luxury.


Just because it doesn't make you money doesn't mean it has no value.


There is no engineering without dollar signs in the equation.

I didn't say it had no value in general, just in a particular context.


That assertion seems arbitrary and unprovable.


I was able to get CWEB working on my mac as follows:

    wget http://www-cs-faculty.stanford.edu/~uno/programs/sat0.w
    brew install cweb
    cweave sat0.w
    tex sat0.tex
    dvips sat0.dvi
"tex" and "dvips" were already on my system and I don't remember how I installed them.


Just got to work also. I also noticed that some code no longer compiles, at least the older programs.

On my GNU/Linux box:

> dependencies:

  wget ftp://ftp.cs.stanford.edu/pub/sgb/sgb.tar.gz
  tar -xzf sgb.tar.gz
> documentation:

  cweave back-pdi.w
  pdftex back-pdi.tex
  okular back-pdi.pdf &
> code:

  ctangle back-pdi.w
  gcc -o back-pdi  back-pdi.c
  back-pdi 2 1

(I'll be damned if I'll ever get fluent in HN thread formatting)


My guess is that you will find the necessary dependencies in the Stanford GraphBase:

http://www-cs-faculty.stanford.edu/~uno/sgb.html

If I remember correctly, the GraphBase source files start with the gb_ prefix (sorry, I'm ony phone so can't check).

Note: the Stanford GraphBase for me is an example of how a full blown library can be beautifully written in a literate style. Worth buying the hardcopy and reading it.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: