Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Though the alert may look nice, the actual JS behind it is hugely wanting for several reasons: - 690 LOC to produce an alert dialog

- Heavy use of Javascript for what CSS is designed for: https://github.com/t4t5/sweetalert/blob/master/lib/sweet-ale...

- Inconsistent between function spacing followed by mixed tabs and spaces

- Odd use of DOM based attributes to pass configuration options

- Colourspace manipulation on each call where SASS would be effective https://github.com/t4t5/sweetalert/blob/master/lib/sweet-ale...

- Includes jquery, but uses it very little, instead opting to re-invent the wheel in most cases.

- Strange click event firing, gratuitous use of magic key code numbers https://github.com/t4t5/sweetalert/blob/master/lib/sweet-ale...

etc...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: