[Vm-dev] coding convention

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Jan 5 10:05:20 UTC 2019


Le sam. 5 janv. 2019 à 06:19, Eliot Miranda <eliot.miranda at gmail.com> a
écrit :

>
>
>
> On Fri, Jan 4, 2019 at 9:11 PM Ben Coman <btc at openinworld.com> wrote:
>
>>
>> What is the preferred coding convention for function definitions...?
>> For example...
>>
>> static int convertCopy(char *from, int fromLen, char *to, int toLen, int
>> term)
>>
>
> I loathe this.
>
>
>> static int
>> convertCopy(char *from, int fromLen, char *to, int toLen, int term)
>>
>
> Yes please.  Being able to grep for function definitions bu searching for
> the name at beginning of line is very useful.  Yes, one can use project
> files to get more convenient searching than find and grep provide, but
> those are platform specific. If one really wants to search the entire code
> base across all platforms only find and grep work reliably.  And hence
> designing coding conventions for those tools, while apparently antiquated,
> makes solid sense in a complex cross-platform project, IMO & IME.
>
> Ah, thanks for fleshing those conventions with some meaning, it makes more
sense :).
Of course, my O & E differs a bit.
Hovering other the text to see the definition, or just displaying a few
lines in an embedded text editor will beat find/grep productivity by large.

[image: image.png]

I'm still using grep/find, but not for those trivial things that the IDE
can do.
I'm also using the github search in web browser as a complementary tool.

Also the productivity of an IDE shines for inspecting the code starting
from a (sub) list of compiler warnings!

I should perhaps write up the coding conventions I prefer, but in the
> absence of that, one that I really like is 4-space tabs.
>
>
4-space tabs is the default in many editors nowadays, but I recently saw
platforms code depending on legacy 8-space tabs for correct alignment.
I love tab indent, tolerate space indents, hate tab in the middle of text,
and hate the mixture of spaces and tabs indent. But I don't always notice,
editors are too bright.

What I would really like is a comprehensive list of editors people use and
> what conventions those editors support for specifying tab stops, if any.
> We could then start adding those specifications to platform files and
> generated files alike.
>
> I'm mostly using VisualStudio and Notepad++ on Windows, XCode on Mac. I'm
still using vi or vim when I want well known regex power, or when working
with the console.
They all support any tabs stop you like, can indent with tab or spaces
etc... It's just a matter of taking time to configure them.
I try to respect the style of original author, but if it's too exotic (like
2 space indent on platforms/win32), and I'm to lazy to reconfigure my
editor, I have to fight against it... For this reason, I would prefer to
see more uniform conventions.

_,,,^..^,,,_
> best, Eliot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190105/88160c75/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 167102 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190105/88160c75/attachment-0001.png>


More information about the Vm-dev mailing list