I have some PHP experience, but hardly any WP theme writing experience...I'm just starting the journey.
All of the themes I have looked at so far in the .org repository have code that looks like this:
<?php if (condition) { ?>
..some html
<?php } else { ?>
..some other html
<?php } ?>
instead of:
<?php
if (condition) {
echo ..some html
}
else {
echo ..some other html
}
?>
I can see that when using an editor like notepad++ we'd rather have the html "naked" and not in an echo statement, to give the editor the ability to color-code and match up HTML tags with their ending tags, etc.
But I see a lot of templates that have a TON of PHP code and very little HTML -- and they still wrap PHP tags around every line of code. To me, that makes it hard to read.
Is there a technical reason for that, or just a preference on the part of the developer?