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

TS Conversion #12

Open
wilbennett opened this issue Aug 29, 2018 · 1 comment
Open

TS Conversion #12

wilbennett opened this issue Aug 29, 2018 · 1 comment

Comments

@wilbennett
Copy link
Contributor

Mark,

I think there is an easier way to do the conversion. You mentioned yesterday that you think the cost of creating a bug is much higher than not writing code. In the same vein, I argue that trying to change everything at once is much more costly than making incremental changes. Here is my suggestion:

  • make the Javascript files compile with Typescript
  • run the app
  • visit each .js file
    • rename to .ts
    • fix any issues
    • convert to a class if needed
    • run the app

This way you can address any errors as they come up and you are not bombarded with a bazzilion error messages. If you encounter an error that you don't know how to fix, you can easily keep that file as .js until you figure it out. The way you are doing it now, if it works, it'll be great. If it doesn't, you may be spending a lot of time trying to figure out what is wrong.

Just my $0.02

Wil

@wilbennett
Copy link
Contributor Author

... Also, as I was trying to mention in the chat, you are doing more than needed. For example, when you have a parameter in a constructor that you need to be a field, you don't have to explicitly create the field and assign it.

Instead of:

private myField: number;

constructor(myField: number) {
    this.myField = myField;
}

You can simply do:

constructor(private myField: number) {
}

It's hard to make these suggestions in real-time if you're not paying attention to the chat ;)

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

1 participant