5 ms·
Snow: 33 Lines PHP: 66 Lines - w/o PHPDoc: 45 Lines -- w/ Single-line foreaches, exceptions, and ternary operators: 34 Lines So if we use the same formattin
by whichdan 15y ago
Snow: 33 Lines
PHP: 66 Lines
- w/o PHPDoc: 45 Lines
-- w/ Single-line foreaches, exceptions, and ternary operators: 34 Lines
So if we use the same formatting, the PHP is only one line longer, and 5 of the lines are just end-braces.
Now, taking my condensed PHP, and the Snow code, and converting 4 spaces to a tab, the filesizes are:
Snow: 746b
PHP: 847b
Using a lazy comparison: 12% less code, roughly the same number of lines.
I'm with you - I don't see how using a completely different syntax & complicating your toolchain is worth it to save a handful of characters when typing. Maybe more example code (2k-3k lines) would help.
- guillermovs 15y agoHere's a side by side comparison without comments: http://cl.ly/3Z3l1w0v2I2n2y231Y09/o http://cl.ly/3Z3l1w0v2I2n2y231Y09/o That's 10 lines more. 100 times more readable.
- runekaagaard 15y agoWell actually 15, as it seems fair to remove the comments in Snow too. About it being readable, I think that has a lot to do with experience. For me the Snow version is clear as day ;)
- guillermovs 15y agoWell the comments in Snow are kinda necessary, since it's all abbreviated and hard to read. The PHP class in the other hand is a lot clearer, with informative class and function names.