Hacker News new | ask | show | jobs
by bob1122 3828 days ago
Did you intentionally obfuscate your code?
2 comments

You may find this difficult to believe, but this approach helps me find bugs and repetition.

I have noticed every page I scroll causes a comprehensive loss of around 90%, so in reading something that is 10 pagefuls long, I might only be able to produce a tiny part of the program.

Your milage may vary.

I find not scrolling, and just moving my eyes, I rapidly absorb the program, and I find most bugs just by reading the code. This practice is absolutely impossible for me if I have to scroll very far and made difficult by scrolling at all.

I do not know how to do this except to write horizontally.

It's idiomatic style in the K community, e.g. here's a random source file from kdb itself - http://code.kx.com/wsvn/code/kx/kdb%2B/c/c/odbc.c

Some members of that community prefer this style because they find it more readable.

Some people like to have big monitors so that they can fit more code on their screen at once. Instead of getting a bigger screen why not shrink the code?

As a side project I implemented a small text editor in this style. I had a working text editor with the ability to load a file, insert and delete text, scroll around a large file, and save changes. It fit within about 100 lines of concise (but I wouldn't say obfuscated) C.

In the end I decided to reformat it and use my usual style before implementing more features. But it was a good experiment and I now understand the appeal of the ultra-condensed style you see in J, K, some Forth, and some Perl code.