5 ms·
https://github.com/amsul/pickadate.js/blob/gh-pages/pickadate.js https://github.com/amsul/pickadate.js/blob/gh-pages/pickadat... the code is a giant var stateme
by armandososa 14y ago
https://github.com/amsul/pickadate.js/blob/gh-pages/pickadate.js https://github.com/amsul/pickadate.js/blob/gh-pages/pickadat... the code is a giant var statement. I don't know why, but somehow that bothers me.
- jontro 14y agoThe lack of semicolons and the use of jshint bothers me.
- tinco 14y agoThe fact that the code is very neat and is well documented bothers me. Also the fact that javascript is a lot more readable when you put a blank line between every two lines bothers me (a lot!). And that it works perfectly and looks great, man that bothers me.
- devinus 14y ago// If datePassed is true else if ( datePassed === true ) { Yes, very well documented. >.>
- thezilch 14y agoIndeed. In fact, I'd posture that the comments, after the first, are wrong; the lines' intents are to _set_! // Set the element as readonly element.readOnly = true // Get the date today DATE_TODAY = P.getDateToday() // Get the date to select DATE_SELECTED = P.getDateSelected() // Get the month to focus MONTH_FOCUSED = P.getMonthFocused() // Get the date ranges DATE_MIN = P.getDateRange( SETTINGS.date_min ) DATE_MAX = P.getDateRange( SETTINGS.date_max, 1 )
- Stratoscope 14y ago// Return the calendarObject return calendarObject It's like this all the way through the code!
- insin 14y agoIt doesn't lack semicolons, it's only using them where necessary.
- deleted 14y ago[deleted]
- kurrent 14y agolooks like a single var pattern inside an immediately invoked function expression to me. works well and great for readability
- kevincennis 14y agoThank you for not calling it a "self-executing anonymous function".
- jackmoore 14y agoI'm a proponent of simply calling them 'immediate functions'.
- rymith 14y agoYea, I'm not a fan of this pattern, it's a pain to step through with a debugger.
- city41 14y agoSometimes I feel like the JS community is more concerned with "style" than practicality. I always do one variable per var, so much more readable and much easier to debug.