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

Group up extension methods by source type and comment them. #64

Closed
jeremylcarter opened this issue Aug 30, 2017 · 4 comments
Closed

Group up extension methods by source type and comment them. #64

jeremylcarter opened this issue Aug 30, 2017 · 4 comments
Assignees
Labels
enhancement Type - Changes that may affect performance, usability or add new features to existing modules.

Comments

@jeremylcarter
Copy link

jeremylcarter commented Aug 30, 2017

There are many extension methods in use by the neo project.

I would like the group them up into individual static classes based on their type. During this process I would also comment the extension methods to explain what they are doing. This will improve the codebase for future development and documentation.

For example:

internal static BigInteger Mod(this BigInteger x, BigInteger y)
{
	x %= y;
	if (x.Sign < 0)
		x += y;
	return x;
}

Would become

/// <summary>
/// Divides the value of the source BigInteger by the division parameter, and returns the remainder.
/// See: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/modulus-operator
/// </summary>
internal static BigInteger Mod(this BigInteger source, BigInteger division)
{
	source %= division;
	if (source.Sign < 0)
		source += division;
	return source;
}
@jeremylcarter
Copy link
Author

@erikzhang Could you assign this to me if you would like me to carry out the work? Thanks!

@AshRolls
Copy link
Member

AshRolls commented Aug 30, 2017

@jeremylcarter these would be useful improvements. We (City of Zion) have improvements of this nature planned for the core, please could you drop into #develop in slack and DM 'ashant' so we can coordinate?

@erikzhang erikzhang added the enhancement Type - Changes that may affect performance, usability or add new features to existing modules. label Aug 31, 2017
jeremylcarter added a commit to jeremylcarter/neo that referenced this issue Sep 5, 2017
@erikzhang erikzhang added this to the Future milestone Nov 23, 2017
@erikzhang erikzhang removed this from the Future milestone Jun 25, 2018
@neo-project neo-project deleted a comment from yanfaruiec Aug 13, 2018
@penlite
Copy link

penlite commented Aug 28, 2018

What is the status of this @jeremylcarter, it sounded like a good idea.

@jeremylcarter
Copy link
Author

Its a great idea but I don't see anyone else trying to improve the quality of incoming code. Why would I slave away at cleaning up the code, documenting it and making it readable when incoming code from other contributors has no comments, does not follow conventions and will require a clean up again. Its a never ending cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Changes that may affect performance, usability or add new features to existing modules.
Projects
None yet
Development

No branches or pull requests

4 participants