4 ms·
Just FYI, the code-formatted block quotes in your comment need a lot of horizontal scrolling both on mobile and desktop because of the very long lines. Unfortun
by Stratoscope 7y ago
Just FYI, the code-formatted block quotes in your comment need a lot of horizontal scrolling both on mobile and desktop because of the very long lines. Unfortunately HN doesn't provide any kind of nice formatting for block quotes, so it's understandable that people try to use code formatting for this.
Sometimes commenters will use code formatting with manually entered line breaks, e.g. keeping lines to 72 characters or less. But that is still hard to read on mobile devices.
Instead of code formatting using leading spaces, here's a good alternative for block quotes (the '>' goes in the first column, no leading spaces):
> *A paragraph of block quoted text.*
This renders as:
> A paragraph of block quoted text.
If the quote has * characters within it, don't try to italicize it, just do this:
> A paragraph of block quoted text.
which renders as:
> A paragraph of block quoted text.
Either way the quoted text will be wrapped correctly on any device.
Give each paragraph its own '>' indicator and a blank line between them so they don't get wrapped together.
In case you don't get a chance to edit your comment, here's a more readable copy:
- - - - - - -
> Looping - performing a computation repeatedly - is what programs do. In most computer languages, all loops are expressed by one of two statements:
> Do While - repeat a code block until a condition is met
> For - repeat a code block, with a loop index indicating how many times the block has been repeated.
> Programmers trained on scalar languages have spent many years internalizing the Do-While and For paradigms. Discarding these paradigms is the biggest re-think they need to make when they learn J.
A lot of languages have these kinds of semantics and arguably in a more streamlined / better organised way - Haskell typeclasses for example. I don't know if it's true that 'most languages' only support for/while loops, but probably not. It also doesn't take 'many years' to internalise for/while loops, these are fairly basic constructs which are learned by most novices in the beginning of an introductory programming course.
> (x + y) is an expression rather than a statement. The J programmer can embed (x + y) in a larger expression, perhaps a matrix multiplication (w +/ . * (x + y)) which adds the equivalent of three more nested loops, but is still a single expression. Expressions can be combined; statements cannot.
(x + y) is going to be an expression in almost any language...
> Many modern languages have iterators, which slightly streamline the For loop, but without addressing its fundamental deficiencies.
What are the 'fundamental deficiencies'?
This seems like a pretty low-effort write-up.
- - - - - - -
(end of reformatted version of NOGDP's parent comment, please direct any replies to the original)