DEV Community

loading...

What if we use naming instead of syntax highlighting?

natancieplinski profile image Natan Cieplinski Updated on ・1 min read

Today i opened a project i'm working on and for some reason VSCode deactivated the theme i usually use. The first thing that i noticed is how hard it is to read code without syntax highlighting, and that got me thinking.
For every programming language there is a favorite/recommended case style. To give some example in Python it's snake_case while in Javascript it's CamelCase. This is great for consistency, but then distinguishing variables from methods becomes hard without good syntax highlighting, and with good I mean that not every theme does this well.
So I propose a solution: why don't we use different case naming for different things? For example:

  • snake_case for variables.
  • CamelCase for classes and objects.
  • camelCase for methods.

I tried this naming style on a javascript project, since in javascript functions and variables blend more easily compared to other languages, and i found it really convenient in how quick i could read code.

Thoughts?

Discussion (0)

pic
Editor guide