Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor API #27

Open
cmbankester opened this issue Jan 21, 2015 · 3 comments
Open

Refactor API #27

cmbankester opened this issue Jan 21, 2015 · 3 comments
Milestone

Comments

@cmbankester
Copy link
Contributor

Since the addition of server-side pagination, there is a lot of room for refactoring (e.g. some public methods could be made private, code styling, etc.).

I also propose that we switch to pure Javascript to remove the dependency on CoffeeScript-related compilation steps, that we add a grunt watch for development, and that we add a linting step to the minification process.

@cmbankester cmbankester added this to the 1.0.0 milestone Jan 21, 2015
@ohadschn
Copy link
Contributor

Specifically, I noticed some duplicate code between initWithClientSidePagination and initWithClientSidePagination (most of which I propose to move to the view anyway in #22 (comment)). Also on the topic of refactoring, I think it would be nice to have sortDir as an enum (rather than a plain string).

Regarding CoffeeScript (CS), that is an interesting decision to make. I've been doing some reading and it seems like a heated topic with many pros and cons either way. I wouldn't lose much sleep over the loss of CoffeeScript (I'm not a Ruby guy after all), but I do think that this can be an opportunity to improve upon it rather than "downgrade" to JS.

Ruling out CS and JS, the main alternatives are Dart and TypeScript (TS). As an MS employee I may be biased, but I think TS is the clear winner: http://programmers.stackexchange.com/a/193582/132066. Some even go as far as to say Dart is dead: https://medium.com/@richardeng/dart-is-dead-aedced9fd3d1. If you go that route I would recommend Visual Studio (with Web Essentials), but grunt will still be an option: https://www.npmjs.com/package/grunt-typescript.

Having said that, knockout-datatable has (and probably will in the future) a small enough code base that it could probably get away with pure JS.

@cmbankester
Copy link
Contributor Author

I think we'll stick with either JS or CoffeeScript, as those are what Immense uses in-house.

@ohadschn
Copy link
Contributor

That just means you need to convince the rest of Immense to move to TS ;)
Until that happens though, if the choice is between JS and CS, I tend to agree with your initial proposal of pure JS. It seems CS forces you to basically learn a new language (with questionably terse syntax) and it's not clear that the rewards are worth it. While it does protect you from certain JS pitfalls I understand it substitutes them with its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants