Caps in Getting Technical?


#1


https://www.codecademy.com/en/courses/ruby-beginner-en-ET4bU/3/4?curriculum_id=5059f8619189a5000201fbcb

I was just wondering why the "Books" part of firstBook and secondBook are capitalized. Maybe this is an amateur question, but I would like to know.


 = ["Charlie and the Chocolate Factory", "War and Peace", "Utopia", "A Brief History of Time", "A Wrinkle in Time"]

# To sort our books in ascending order, in-place
books.sort! { |firstBook, secondBook| firstBook <=> secondBook }

# Sort your books in descending order, in-place below

books.sort! { |secondBook, firstBook| firstBook <=> secondBook }


#2

In coding circles this is known as camelCase. Another convention often seen in Python is, snake_case.

Both cases permit multiple terms in a name without spaces (which are not valid in a variable name).


#3

Very helpful! Thank you so much!!!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.