Is there a way to edit/write templates from the user interface? One of the UI/UX issues with Drupal is that theme templates are not editable from within the interface. Even for devs who know what they are doing this is awkward time consuming distraction needing FTP and other software outside of Drupal to create/remaster themes or put in a little logic . While knowing that the ability to edit tpl.php templates from the UI can potentially create security issues, still it seems to me that showing the template code and ability to re-write templates within the interface is lacking in Drupal 7. 

Css can be writen to files (from themes and modules ie administratiom theme and css editor) so why not templates?

Can it be done?
As far as I know, the best you could do in Drupal from the admin side is alter the layout using Display Suite, Panels, and to some extent, Field Groups (Bootstrap Field Group can come in handy). Advanced functionality will still require code access (i.e. adding custom layouts and layout CSS). That's usually what you end up doing with templates most of the time, just moving things around.

It's rare that you edit the widgets and field outputs (you write formatters for those, which then can be changed via admin once installed). Also, editing widgets using templates instead of formatters is a maintenance nightmare and full of surprises.


  Even for devs who know what they are doing


Devs who know what they're doing store changes in version control, and therefore code. ;)