Skip to content

Refactoring node code into nodeclient module - #2

Merged
Hani Atassi (hinzo) merged 2 commits into
masterfrom
sublime_modules
Feb 5, 2015
Merged

Hani Atassi (hinzo) merged 2 commits into
masterfrom
sublime_modules

Conversation

@hinzo

Copy link
Copy Markdown
Contributor

Steve Lucco (@steveluc) Yui (@yuit)

This is part one: Only separate the node client out. Part two will add the proxy to make it easier to call the commands on the service.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we remove the print statement? and whoever need it will add the print themselve

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep it for now and then remove it when the proxy raises an event which then we can add a print in the event handler.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep sound good.

@yuit

Copy link
Copy Markdown

VERY VERY minor stuff : python style uses underscore instead of camel case. I do not if we want to follow Python style guide closely. I just raise this now since we are moving things around

@yuit Yui (yuit) closed this Feb 4, 2015
@yuit Yui (yuit) reopened this Feb 4, 2015
@steveluc

Copy link
Copy Markdown
Contributor

Great to see some modularity. OK with me to remove all print statements. Was planning to go_to_snake_case. I figured out after I started with camel case that Sublime Text was normalizing to snake case and that python often uses that convention.

Am wondering what would happen if we placed listener class in separate file (would somehow need to get at the singleton client instance). It's about half the code.
👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming this to nodeClient to avoid association with AST nodes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@hinzo

Copy link
Copy Markdown
Contributor Author

I referred to this for coding guidelines: https://www.python.org/dev/peps/pep-0008/ I don’t see one recommended naming standard. They definitely use different naming standards in the Python library. I just would like us to stay consistent. Here is my preference:

  • I prefer camel casing
  • Pascal casing for classes
  • all lowercase for modules
  • constants are UPPER_CASE

I will look into the listener when I do my other proxy change.

From: Steve Lucco [mailto:[email protected]]
Sent: Wednesday, February 4, 2015 9:31 PM
To: Microsoft/TypeScript-Service
Cc: Hani Atassi
Subject: Re: [TypeScript-Service] Refactoring node code into nodeclient module (#2)

Great to see some modularity. OK with me to remove all print statements. Was planning to go_to_snake_case. I figured out after I started with camel case that Sublime Text was normalizing to snake case and that python often uses that convention.

Am wondering what would happen if we placed listener class in separate file (would somehow need to get at the singleton client instance). It's about half the code.
[:+1:]

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/2#issuecomment-72996639.

@yuit

Copy link
Copy Markdown

Hani Atassi (@hinzo) I see. I agree with you on consistency. I have no strong preference on naming standard so if that is what you prefer, I will be happy to adopted into the vim-client and use the similar style.

Hani Atassi (hinzo) added a commit that referenced this pull request Feb 5, 2015
Refactoring node code into nodeclient module
@hinzo
Hani Atassi (hinzo) merged commit bacceae into master Feb 5, 2015
@DanielRosenwasser

Copy link
Copy Markdown
Member

To clarify, there is a section for naming conventions:

Prescriptive: Naming Conventions

Function Names

Function names should be lowercase, with words separated by underscores as necessary to improve readability.

Method Names and Instance Variables

Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability.

Constants

Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL

Though I agree, I prefer camel casing.

@steveluc

Copy link
Copy Markdown
Contributor

Camel ok with me. Note sublime will turn camel into snake in for example view.run_command. Also Sublime has conventions such as command classes end in 'command' but this is dropped in command name used for menus and run_command

Sent from my Windows Phone


From: Yuimailto:[email protected]
Sent: ý2/ý5/ý2015 12:02 PM
To: Microsoft/TypeScript-Servicemailto:[email protected]
Cc: Steve Luccomailto:[email protected]
Subject: Re: [TypeScript-Service] Refactoring node code into nodeclient module (#2)

@hinzohttps://github.com/hinzo I see. I agree with you on consistency. I have no strong preference on naming standard so if that is what you prefer, I will be happy to adopted into the vim-client and use the similar style.

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/2#issuecomment-73115973.

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

Successfully merging this pull request may close these issues.

4 participants