1

Topic: Programming art

(I am sorry for a pun, it will be a question not of Whip work). I suggest to share thoughts on esthetic aspect of programming. What do I mean? Programming is an expression of algorithm in some arbitrary (one of it is uncountable possible) the form, and its result - the program - can be object of an esthetic estimation, i.e. can cause a certain sort the experience similar to when we perceive objects of traditional art, and this experience can be expressed adequately in the same terms that the art critic uses. (The in itself algorithm, most likely, the beautiful or ugly cannot be, as is not the expression form). We take, for example, FizzBuzz. More low - typical variants of its implementation: Haskell: main = mapM_ (putStrLn. fizzbuzz) [1. 100] fizzbuzz x | x ` mod ` 15 == 0 = "FizzBuzz" | x ` mod ` 3 == 0 = "Fizz" | x ` mod ` 5 == 0 = "Buzz" | otherwise = show x Perl: say ' Fizz ' x $ _ %% 3 ~ ' Buzz ' x $ _ %% 5 || $ _ for 1. 100; PicoLisp: (for N 100 (prinl (or (pack (at (0. 3) "Fizz") (at (0. 5) "Buzz")) N))) Peloton: <@ DEFUDRLIT> __ FizzBuzz|<@ SAW> <@ TSTMD0PARLIT> 1|3 </> <@ TSTMD0PARLIT> 1|5 </> <@ O12><@ SAYLIT> Fizz </> </> <@ O22><@ SAYLIT> Buzz </> </> <@ BTH><@ SAYLIT> FizzBuzz </> </> <@ NTH><@ SAYPAR> 1 </> </> </> </> <@ ITEFORLITLIT> 100|<@ ACTUDRPOSFOR> __ FizzBuzz |... </> </> That we (i.e.) see? The variant on Haskelle is that banality occurs to the first, i.e. The decision on a pearl - the shortest, but thus tangled, careless - all is sacrificed to short. And here a variant on  - clear, elegant, not banal - it is possible to tell, beautiful. The final program is resulted for contrast. What does it mean in practice? That there are languages programming more and less beautiful. For example, it is possible to assume that With simply more beautiful With ++, and .... ... I Hope, it was easier what to read this post, than it to write.

2

Re: Programming art

Hello, Basil B, you wrote: BB> we Take, for example, FizzBuzz. More low - typical variants of its implementation: BB> That it means in practice? That there are languages programming more and less beautiful. For example, it is possible to assume that With simply more beautiful With ++, and .... In my judgement, the prettiness of the code depends on the programmer, than from a programming language more.

3

Re: Programming art

Hello, Basil B, you wrote: BB> Perl: say ' Fizz ' x $ _ %% 3 ~ ' Buzz ' x $ _ %% 5 || $ _ for 1. 100; BB> PicoLisp: (for N 100 (prinl (or (pack (at (0. 3) "Fizz") (at (0. 5) "Buzz")) N))) BB> And here a variant on  - clear, elegant, not banal - it is possible to tell, beautiful. The final program is resulted for contrast. Something it not strongly is more readable than a pearl, in my opinion.

4

Re: Programming art

Hello, Basil B, you wrote: BB> we Take, for example, FizzBuzz. More low - typical variants of its implementation. Apprx. And now we take the code of setting of interception in  the code on platform ARMv7. And that supported all 4 variants ARM/THUMB <-> ARM/THUMB, had minimum possible length of insert, considered 32 bit instructions THUMB-2, correctly did interworking, and also analyzed transferable instructions, and in a case relative PC addressings transferred and addressed constants after them, forming the own table of constants, thus considering that alignment of commands in THUMB can differ from alignment of offsets... If absolutely to get poisoned by fumes - let by an interception call . In parameter adds the address of "psevdno-original" function. That from interception it was possible to cause "the not intercepted" original TO the code, AFTER the code, not to cause or cause at all some times. Without addressing to global variables, after all they - ANGRILY! Certainly for> = 4 parameters it is necessary to move a stack, and how without it? How this code will look on piko-chegototam?

5

Re: Programming art

Hello, Basil B, you wrote: BB> we Take, for example, FizzBuzz. More low - typical variants of its implementation: BB> Haskell: BB> BB> main = mapM_ (putStrLn. fizzbuzz) [1. 100] BB> fizzbuzz x BB> | x ` mod ` 15 == 0 = "FizzBuzz" BB> | x ` mod ` 3 == 0 = "Fizz" BB> | x ` mod ` 5 == 0 = "Buzz" BB> | otherwise = show x BB> let fizzBuzz = (i) => i % 15 == 0? ' FizzBuzz ': i % 3 == 0? ' Fizz ': i % 5 == 0? ' Buzz ': i; for (let i = 0; i <100; i ++) console.log (fizzBuzz (i)); there are tasks  '  those values on these is much more often, old to delete, new to add, conflict ,  in basis '.