Yes, except there are like several different barrel lengths (multiple barrel lengths on just the compact 2.0's now, including 4 " and 3.6" , not to mention the 5" and the full size 4.25", etc and they now have the original versions and then the 2.0's).
but the numbers DO refer to caliber and traits. Most... many... some guns have some sort of reference to the gun's traits in the number or naming so you can discern what it is aside from gross memorization, even if only within a production or model range. S&W has had several systems but they do try using a system. glocks have none whatsoever except 42/43 are the smallest.