+ Start a Discussion
Ken KoellnerKen Koellner 

What are "v" and "c" in the Expenses example in the Lightning Component Developers Guide?

I'm working through Expenses example in the Dev Guide and see "v." and "c." in several locations but they aren't things that are declare anywhere.

Are these well-known objects that have to be referenced via "v" and "c"?  Like mayb "v" is view and "c" is controller" or something like that?

I'm curious if the code could be altered and the "v." and "c." terms could be changed if they are declared somewhere or if I'm coding in this style, must I use objects referred to by the specific named "v" and "c".
As you have rightly guessed, v refers to view and c refers to controller.  Lightning Component Developer's Guide (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/) does mention that somewhere.
Ken KoellnerKen Koellner
Thanks for the reply jp.

I feel a little better if they are constant than if they are declared variables.  I know a lot of examples use one character variables like "Opportunity o;" or "Exception e" but I happen to deplore it as it makes global renames when refactoring code a pain.  At least "Exception ex" and "Opportunity opp" make it easier to read.
I agree.  That's not a great naming of those "constants."  I wonder if it is a legacy from some framework that Lightning Component is based upon. 
Fabien TaillonFabien Taillon
You can have a look to this perfect answer from Lightning Product Manager : https://developer.salesforce.com/forums?id=906F0000000AndMIAS
Saptarshi GhoshSaptarshi Ghosh
These are value providers, more details on the link.
Susannah PSusannah P
Yes v stands for value providers. A good explanation can be found on trailhead: https://trailhead.salesforce.com/trails/lex_dev/modules/lex_dev_lc_basics/units/lex_dev_lc_basics_attributes_expressions
Ajinkya DhasAjinkya Dhas
Hi Ken,

- When we use v.abc, we are actually calling value hold by attribute abc.
- When we use c.xyz, we are calling value return by the controller It can be server-side-controller (.JS controller )or client-side-controller (Apex Class)
Hence It is called as value providers because they are providing value.

You can also check the following link to learn salesforce lightning development from scratch

Ajinkya Dhas,

Please select this answer as best answer if it helps Thank You.