16 ms·
It's the ability which is best trained by studying mathematics (even if totally unrelated to programming). Do not listen to those saying it's not possible. We
by sklogic 12y ago
It's the ability which is best trained by studying mathematics (even if totally unrelated to programming).
Do not listen to those saying it's not possible. We do implement programming languages based on their specifications, we implement protocols by reading RFCs, we implement numeric algorithms by reading pseudocode in the papers, etc.
It's all trivial and mechanical. The latter notion is very important, one have to understand that there is very rarely a place for "creativity" and even thinking. You simply translate specification from one formal language into another, following simple rules. Thinking too much considered harmful.
- icebraining 12y agoWe do implement programming languages based on their specifications, we implement protocols by reading RFCs, we implement numeric algorithms by reading pseudocode in the papers, etc. We implement spherical-cow versions of languages, protocols, etc by reading those papers and specs. Then we spend months or years fixing it to implement the actual languages and protocols.
- sklogic 12y agoNo. We spend months and years fixing the issues with the specs (especially if they're committee-driven, they tend to be crappy). Yet it's easy to keep your implementation conformant to the specification without any hand weaving and looking at "examples".
- icebraining 12y agoYou can keep it conformant, but that's not enough, because the real world isn't. Try writing a conformant HTML parser that rejects invalid input, and then run a crawler that uses it. You'll reject half the web!
- sklogic 12y agoIn such a case the right way to go is to build a formal model of the informal expectations first. I.e., split scientific and engineering phases. Collect your data, build a theory, validate it, and only then engineer an implementation of it, mechanically, with zero mental activity. And what you seem to suggest, start writing a parser and then experiment with various real-world inputs until you're satisfied, is certainly not a very productive way of doing things.
- icebraining 12y agoI'm not suggesting anything but that you can't build it from first principles. Collecting data and building a theory is not working from first principles, it's just a more structured way of hacking it until it works. You're still liable to have the next website you crawl break your parser.
- sklogic 12y ago> but that you can't build it from first principles Do not confuse principles (which are universal, simple and beautiful) with specs (which suck shit a metric ton per second). > it's just a more structured way of hacking it until it works You're confusing hacking with cargo cult coding. Hacking until it works is exactly this formal loop: collect the data, build a model, test if it's applicable. Cargo cult is "google for an answer, paste some code from stackoverflow, see if it works". The OP article is about the latter.