4 ms·
A cracked sword without a hilt can't be called a sword, but it can be called art. A program full of syntax errors may not be a valid program, but it can be val
by svrtknst 8y ago
A cracked sword without a hilt can't be called a sword, but it can be called art.
A program full of syntax errors may not be a valid program, but it can be valid art.
- nemo1618 8y agoSure, but only because "art" is essentially boundaryless and actively resists attempts to define it. If you stretch the definition far enough, everyone is an artist and everything is an artistic medium.
- Rerarom 8y agoIt may be art, but it is not programming anymore. Therefore reinforcing the idea that programming is not art.
- vidarh 8y agoWhat makes a valid program is not easy to define. Is this a valid program? Well, probably not, right now as I'm writing this. But all it takes is someone writing an interpreter that maps words to a suitable instruction set. It probably won't do anything sensible, where do you draw the line? Translating code to other forms and back has a long history that very often has been about doing it for the sake of it rather than for functionality or practicality. I've linked to this elsewhere: https://www.reddit.com/r/programming/comments/b9fqwj/93_of_paint_splatters_are_valid_perl_programs/ https://www.reddit.com/r/programming/comments/b9fqwj/93_of_p... But much more famous were the many incarnations of DeCSS that sought to to blur the lines between code and other expression: http://www.cs.cmu.edu/~dst/DeCSS/Gallery/ http://www.cs.cmu.edu/~dst/DeCSS/Gallery/
- Rerarom 8y agoA valid program in a given programming language has a precise definition.
- vidarh 8y agoYes, but a given string of text does not specify a language. "Is this a valid program?" is syntactically and semantically valid Ruby for example. But in itself it will just throw an error [some might argue this means it is not a valid program, but these errors are part of the normal runtime control flow of Ruby]. Depending on environment, however, it can do something else. E.g. if your environment contains this: def program?; 42; end def valid(arg); arg; end def a(arg); arg; end def this(arg); arg; end def Is(arg); arg; end Then the string Is this a valid program? Will execute and return 42. A lot of random text will be valid programs in any number of existing languages without any intent for them to be so. But any random text can be valid programs in an infinite number of possible languages that does not yet exist. So the question of what is a valid program is very much a philosophical one about whether or not the intent of the author matters in the face of processors that can re-interpret the data in ways it was not intended.