-
Notifications
You must be signed in to change notification settings - Fork 26
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
Coding Conventions #241
Coding Conventions #241
Conversation
This commit expands the coding conventions and implements part of them for the whole code base.
Making this commit was possible only due to the combined brilliance of several emacs features. I'll so use this as a war story in the IOOPM lab. |
|
any other tool apart from |
kiko: we could be using a tool, but this would become a de-facto dependency (it'd be practically impossible to write "legal" code without the tool) |
We decided not to do that this time. As for the other points: a majority wanted camel case. It also does not matter what it looks like, it matters that it is consistent. |
This argument could easily be reversed to say that in the current situation there would be noise from the C backend if we need to find all places where a call to
I (unsurprisingly) disagree. See our discussion here about coding conventions and local functions. This piece of code shows that we need to respect conventions even in local functions:
...but the Haskell (standard) libraries are using camelCase, so if we want the Haskell code to be internally consistent, snake_case would not work. But @kaeluka's comment is the most important:
|
I strongly argue that we should keep the PonyRT's coding style for the C code that we generate. (Not sure anyone is arguing against that but it is an important point to make.) It will be very strange otherwise. There is no big gain in enforcing another style on the generated C code as it will (ideally) not be read. Coding style should naturally be enforced everywhere — what would be the point otherwise? |
@TobiasWrigstad: +1 (but I don't think anyone was arguing for -1) |
@albertnetymk Apparently there was a camel case vote and the good guys lost ;) Now we just have to deal. Different coding convention for the Haskell code we write and the C we (mostly) generate does not seem to be a problem. For clarification: is there a coding style for the C code part of Encore? |
I wasn't arguing for that and the PR does not alter the C-code output at all (if you find that to be wrong, that's a bug). |
Nothing official, but there should be! And there you can have all the snake_case you want ;) |
@EliasC Great. Then I think @albertnetymk and I can hash that one out since that's our preferred level of abstraction ;) |
|
As if we didn't have too much prefix anyways! |
This commit expands the coding conventions and implements part of them
for the whole code base.