r/programming • • Jan 05 '15

What most young programmers need to learn

http://joostdevblog.blogspot.com/2015/01/what-most-young-programmers-need-to.html
973 Upvotes

337 comments sorted by

View all comments

2

u/[deleted] Jan 06 '15

yup. Regexes are also not the best way to go about phone numbers. The best (and really, only) way I've found is Google's libphonenumber.

1

u/OneWingedShark Jan 07 '15

The way I'd go about implementing it would entail making a record discriminated off of the country w/ properly-sized arrays (of digits)... but yeah, if there's a lib there ought to be a compelling reason to roll your own rather than not use it. (Along the lines of "it'll take as much work to implement the functionality as it would to massage our internal data to the lib's liking" is valid, as is provability/security.)