This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kdevelop syntax color meaning

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS

kdevelop syntax color meaning

Wed May 09, 2012 7:56 am
Hi all,
this could sound trivial, but what is the rationale behind the variable syntax colors? I mean, of course it is useful to have each variable with a predefined color, even if I find it a little confusing to read a so colored code, but how is a color for a particular variable chosen? For instance within a method I've got three QString declared sequentially and with the color of yellow, blue and red. Are these colors randomly chosen or do they have a specific meaning?
User avatar
Milian Wolff
KDE Developer
Posts
61
Karma
1
OS

Re: kdevelop syntax color meaning

Wed May 09, 2012 8:03 am
Local variables are randomly colored (but once a given name has a given color, it should be reused). The big gain here is that it's much simpler to see where a given variable is used. I know of many people who really like this feature (including me) and I also heard it quite a few times that people where first reluctant in accepting it but came to love that feature.

Here's one (maybe bad) example of where this really helps:

int longVarNameuAsdf = 1;
int longVarNameaAsdf = 2;

Usually you'd had to read both long names to find the difference of one char, with the colorization it's quite easy to differenciate the two vars.

If you don't like that, disable it by reducing the local color intensity in KDevelop's settings.


current KDE projects: Quanta, KDevelop, Kate
danni
Registered Member
Posts
29
Karma
0

Re: kdevelop syntax color meaning

Tue May 15, 2012 4:16 pm
It is probably also worth mentioning that the colouration really helps determine whether the variable you are calling is a local variable, a global variable or a class variable. It is possible under some circumstances to end up with variables of the same name with the coloration it becomes easier to figure out which you are affecting.
fluca1978
Registered Member
Posts
81
Karma
0
OS

Re: kdevelop syntax color meaning

Thu May 24, 2012 12:45 pm
Milian Wolff wrote:Local variables are randomly colored (but once a given name has a given color, it should be reused). The big gain here is that it's much simpler to see where a given variable is used. I know of many people who really like this feature (including me) and I also heard it quite a few times that people where first reluctant in accepting it but came to love that feature.


Effectively, after several days of using this feature, I'm loving it.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell