Re:Ask HN: How do you switch between programming languages?
by EnderShadow8 on Tuesday September 20, 2022 @05:24AM
(#32909507)
Why not use double quotes for strings in all languages? It makes sense for a number of reasons. Single quotes are much more likely to be in the contents of a string than double quotes.
Of course, if you have a style guide, you should stick to that.
Re:Ask HN: How do you switch between programming languages?
by pabs3 on Tuesday September 20, 2022 @05:43AM
(#32909653)
In some languages double quotes have different meaning to single quotes, for example in shell variables expand inside double quotes but not inside single. So you need to know which your current language uses.
Instead of starting with a empty file, I copy an existing file in the language that I'm using. Simply by seeing examples of syntactically correct code, I assimilate. It's only a 90% solution. For example using single quotes on strings in C and putting a ';' at the end of lines tends to creep into my Python code.