If constants are structured hierarchically, do the "folders" also need to be capitalized? Take for example a Javascript object that needs to store constants for a video player. Is the convention to capitalize the "folders"?
PLAYER = {
VIDEO: {
WIDTH: 640,
HEIGHT: 480
ENCODING: 'h264'
},
AUDIO: {
BITRATE: 128
ENCODING: 'mp3'
}
};
// usage:
alert('The player's video width is: ' + PLAYER.VIDEO.WIDTH);
Or only capitalize the leaf nodes?
player = {
video: {
WIDTH: 640,
HEIGHT: 480,
ENCODING: 'h264'
},
audio: {
BITRATE: 128,
ENCODING: 'mp3'
}
};
// usage:
alert('The player's video width is: ' + player.video.WIDTH);