[Vm-dev] coding convention

Ben Coman btc at openinworld.com
Sat Jan 5 11:28:14 UTC 2019


On Sat, 5 Jan 2019 at 13:19, Eliot Miranda <eliot.miranda at gmail.com> wrote:

>
> 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.
>

Cool.  btw, the reason I ask is that I've been reviewing minheadless and
several of the files Ronie copied into minheadless
he converted from the former to the latter.  To make it easier to diff
between these, I'll have a go a converting
the original files to the same convention.



> Being able to grep for function definitions bu searching for the name at
> beginning of line is very useful.
>

Ahh, nice trick!   Suddenly I've used that already a few time today.


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.
>
> 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.
>

Me too.



> 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 use mostly `vi` because its the most common tool available.  But back
when I was doing the MSVC minheadless
it was a comparative real joy clicking back and forth between error
messages in Visual Studio to got straight to the related code.
The other Visual Studio feature I discovered that really improved workflow
was shading of #ifdef'd out code.

cheers -ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190105/c041af15/attachment-0001.html>


More information about the Vm-dev mailing list