Open g4v4g4i opened 8 years ago
[...] with [color = red]
. I dunno about funny behavior of the Netlogo editor b/c I'm currently using notepad++ with a customized language setup for netlogo which makes everything look quite nicely structured. Regarding 4b.
I think if we define or set variables it would be helpful to know which format they're in (list, string, agentset,…) and how their content looks like e.g. for a list a comment could look like: list: [[ (argument a) color a] [ (argument b) color b] …]
This simplifies in my experience checking and understanding the code especially when references to list items is made somewhere in the code by something like last but-last
.
I agree with 4b.
Concerning max width: although good editors will line-break it for you, the intendation will get destroyed and code will look messy. I'd still opt for a roughly 80 chars width (as seems pretty standard among coders anyway). This has also other advantages (e.g., printing, putting two instances of code beside each other on a standard sized screen, etc.).
Regarding the discussion of 2b: actually for me it doesn't destroy intendation. Here is an example of hefty in-procedure-commenting:
I dunno… for me when it comes to a trade-off between style and clearness/understandability of the code I'd rather go for the latter. Additionally comments can probably also be completely hidden/represented visually differently by an editor which recognizes the syntax. Maybe we could try to explore such options before hard limiting the length of in-procedure-comments too much? But though I personally feel that 80 chars is to little sometimes, I'd generally agree that we probably don't want whole novels as comments in the code: my hefty comment example from above has it's longest comments still at around 250 chars. Descriptions which get really long should anyway go to the "Info" section of the model and imho that's also true for above-procedure-comments. What do you think? ☺️
Same in emacs. Nevertheless, e.g. if you look at code in github you have quite a mess with lengthy lines. Anyway, when I learned to code we had still squary screens with comparatively low resolutions and people were more concerned about this than nowadays. So if you and AnneMarie are for no restrictions on column width, I will not object ;-)
Just as an update recapping what we agreed upon so far (imho):
Point 4 (the different naming for global vs local variables) hasn't been implemented and I don't recall us really discussing that issue. I guess though it's also not a very pressing issue as we do not use many global variables anyway.
Maybe a few recaps from our WhatsApp conversation for documentation purposes, regarding the "tab situation" which I caused by using tabs instead of space: Part of my submitted code currently looks a bit messy on GH when watching with default settings, as GH interprets tabs as 8 space indentations. A way to (temporary) alleviate this issue is to call the respective GH url with a ?=ts2
amended: e.g. https://github.com/g4v4g4i/ArgABM/pull/32/commits/80d8ab6355192114a2cd1a76767a4bc220de1e8e?ts=2.
As an aside: Amending the Url by a ?w=1
will prevent pure white space changes to show up in diffs on GH. This can be combined with the tab space command to ?w=1&ts=2
(e.g. https://github.com/g4v4g4i/ArgABM/pull/32/commits/80d8ab6355192114a2cd1a76767a4bc220de1e8e?w=1&ts=2 ).
But as soon as @g4v4g4i has time for that we want to address the issue in a more comprehensive way à la https://eev.ee/blog/2016/06/04/converting-a-git-repo-from-tabs-to-spaces/ .
Update from a conversation between @AMBorg and me yesterday:
Update from a conversation between @AMBorg and me today:
example:
set subjective-arguments [subjective-arguments] of
grp-share-researcher
btw: maybe we should transfer the guidelines collected here to the wiki to have everything concise in one place?
What's your opinion on naming globals with an g-
prefix i.e. g-variablename
in the future?
Regarding commit messages: https://medium.com/@steveamaza/how-to-write-a-proper-git-commit-message-e028865e5791 (via @AMBorg )
This is the summary:
A commit message should answer three primary questions;
Why is this change necessary? How does this commit address the issue? What effects does this change have?
We should agree on a common coding style: