> So why do we bother with all that coding style stuff...
Great minds discuss paradigms.
Mediocre minds discuss languages.
Small minds discuss coding style.
> ...we could make an IDE that edits the program itself instead of text?
Many IDEs have features that reach into the semantics of the code to allow for refactoring, autocompletion, and so on. This requires a language that is amenable to to such analysis.
Dynamic languages like Python and Javascript (without type annotations) make it difficult or impossible, because a lot of things can only be determined at runtime.
Languages like C and C++ make it difficult because of the text-based preprocessor and templates.
Languages like C# or Java make it easy and hence they have some of the best IDE support.
Code formatting is even more trivial and can easily be done with automated tools - if you can just settle on a particular configuration.
> Instead of editing text you could choose to "declare a function", "rename this identifier" or "call function x with y and z arguments" and then save it with some coding style.
Many IDEs and text editors have snippets that make declaring a function or writing a loop less tedious. Renaming identifiers is also commonly supported. Perhaps you're just not used to proper tools, or your language of choice prevents those tools from existing? Have you tried Visual Studio Code with its language addons?
> I know what I'm describing is pretty much visual programming, but I mean for "text" languages.
What you're describing is pretty much a modern IDE, which is full of visual aids.