:: Re: [DNG] Readable code; making cod…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Edward Bartolo
Date:  
À: Apollia, dng
Sujet: Re: [DNG] Readable code; making code more easily writable; Emacs, multifiles-apmod; VUE; Code Bubbles; Lisp; Inform 7; HyperCard and HyperTalk - was Re: "Common knowledge?"-question
Hi,

> combined-list-of-files-in-all-source-folders


That is a phrase. I use keywords instead of phrases to give
identifiers meaningful names.

Suppose I want to scan for surrounding wifi transceivers and connect
to one if an essid and password are available. I would call the
function:

int wifi_autoconnect().

In your example, resultant_list is describtive enough to be used.

Edward


On 25/01/2016, Apollia <apollia112@???> wrote:
> On Sun, Jan 24, 2016 at 4:08 PM, Rainer Weikusat <
> rainerweikusat@???> wrote:
>
>> Apollia <apollia112@???> writes:
>>
>> [...]
>>
>> > I think if I ever did code much in C, my code would end up looking very
>> > unusual and unconventional to many people, because I often like to use
>> > long, descriptive names for functions and variables, no matter what
>> > language I'm using, even Bash.
>>
>> This style isn't really uncommon for people used to IDEs doing
>> identifier auto-completion. But that's not only a bitch to work with
>> without it but also difficult to read because of the sheer verbosity of
>> the text. Eg, using an identifier
>>
>> combined-list-of-files-in-all-source-folders
>>
>> doesn't really communicate more than 'all-files' or even just 'all' (if
>> the files is evident from the context) would.
>>
>
> Thanks for the feedback! Perhaps as I get more comfortable with
> programming in general I'll stop relying so much on the crutch of overly
> verbose names. I know I overdo it to some extent.
>
> But another thing I like about long, unique, non-generic names is that when
> doing searches, I can more easily find definitely related pieces of code,
> and avoid finding a lot of unrelated pieces of code which just happen to
> use the same generic variable names like "x" or "all".
>
>
> If I were a painter instead of a coder, perhaps I might be more of an
> impressionist than a realist or a minimalist. But even that might be too
> complimentary of my style. :-) Rather than impressionist, I'm maybe more
> of a hasty, impatient finger-painter specializing in abstract blobs. :-)
> Or a caricaturist who exaggerates many things ridiculously. :-)
>
> But, hopefully I'll learn to do better after plenty more practice, and
> continuing to strive to learn as much as I can from wiser and more
> knowledgeable people than me, such as you and probably everyone here.
>
> I'm probably going to go back to being mostly quiet now since I can't think
> of much else of interest to add.
>
> But, thanks to you and everyone for all your fascinating, very educational
> posts, and all the wonderful work you're all doing on Devuan!
>
> Best wishes,
> Apollia
>