3 ms·
>I pasted a lot of code in PHP and Python, and in both case you have to select the pasted block and adjust left or right according to the change of depth level.
by parfe 15y ago
>I pasted a lot of code in PHP and Python, and in both case you have to select the pasted block and adjust left or right according to the change of depth level.
Yes, you readjust the PHP for aesthetics. Not for correctness of execution.
In vim, if I recall(emacs for a while now), =G auto formats bracketed code without issue. Pasting code, deleting enclosing block, adding an enclosing block, or highlighting a mismatched bracket (when formatting goes horribly wrong) can be handled automatically.
- gbog 15y ago> Yes, you readjust the PHP for aesthetics Here we differ. A code uncorrectly indented is wrong for me, and must be corrected right now. I don't care at all if it runs or not.
- parfe 15y agoif user_set_delete: logger.info("User set flag to delete file") delete_file() vs if($user_set_delete===True){ log("User set flag to delete file"); delete_file(); } "Correct" and "looks good" can have very different consequences. Acting like proper indentation for looks is on the same level as proper indentation for execution is ignoring the real dangers of improperly indented python. I know copying that php block will not change the execution, no matter how it is formatted vs copying python where I need to guarantee I've got it right. Hence "some overhead".
- headhuntermdk 15y agoActually if user_set.delete: logger.info("User set flag to delete file") delete_file() Becomes: if ($user_set_delete==True){ log("user set flag to delete file") } delete_file();