Skip to content

Conversation

@cwhite911
Copy link
Contributor

Preparing module to add json output to g.mapsets.

@neteler neteler added this to the 8.3.0 milestone Aug 28, 2022
@neteler neteler added the enhancement New feature or request label Aug 28, 2022
@wenzeslaus wenzeslaus changed the title g.mapsets: fix indenting and added json output g.mapsets: Add JSON output Aug 28, 2022
@wenzeslaus wenzeslaus modified the milestones: 8.3.0, 8.4.0 Feb 10, 2023
@github-actions github-actions bot added Python Related code is in Python C Related code is in C module general labels Mar 21, 2024
echoix and others added 4 commits March 21, 2024 18:29
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added HTML Related code is in HTML docs labels Apr 4, 2024
Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

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

Greatly appreciate your work with JSON output!
I added some comments/suggestions.

A more general suggestion is to limit comments to where they really are helpful, not commenting every step in the code. If the code is good written it is usually self-explanatory.

@cwhite911
Copy link
Contributor Author

Thanks for the feedback @nilason!

A more general suggestion is to limit comments to where they really are helpful, not commenting every step in the code. If the code is good written it is usually self-explanatory.

I intentionally overloaded this with comments to kind of serve as documentation for parson library.

@nilason
Copy link
Contributor

nilason commented Apr 9, 2024

Thanks for the feedback @nilason!

A more general suggestion is to limit comments to where they really are helpful, not commenting every step in the code. If the code is good written it is usually self-explanatory.

I intentionally overloaded this with comments to kind of serve as documentation for parson library.

If parson library would have a cryptic API with acronyms of dropped vowels I would perhaps agree with the need for that. Parson API is however very descriptive, e.g.:

// Serialize root object to string and print it to stdout
serialized_string = json_serialize_to_string_pretty(root_value);
puts(serialized_string);

...the comment does not add anything new compared to just reading the code. That is what I mean by self-explanatory code.

Another example:

// Free memory
json_free_serialized_string(serialized_string);
json_value_free(root_value);

We shouldn't underestimate our potential contributors, I would presume there is at the very minimum a basic knowledge of C. The code without the comments, would perfectly work as a good example.

nilason
nilason previously approved these changes Apr 9, 2024
@nilason nilason self-requested a review April 9, 2024 19:42
@cwhite911
Copy link
Contributor Author

@nilason I removed some of the extra comments like you suggested and refactored the code to be dryer creating the json.

Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

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

Great!

@echoix echoix dismissed wenzeslaus’s stale review April 10, 2024 21:37

Outdated and resolved

@echoix echoix merged commit 8bf604c into OSGeo:main Apr 11, 2024
@wenzeslaus wenzeslaus removed their request for review April 22, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C docs enhancement New feature or request general HTML Related code is in HTML module Python Related code is in Python

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants