0

I've found such a paragraph in one of programming tutorials:

Ruby strings are simply sequences of 8-bit bytes and they are objects of class String. Double-quoted strings allow substitution and backslash notation but single-quoted strings don't allow substitution and allow backslash notation only for \ and \'

What I have problem with:

  • "class String" instead of "the String class"
  • "substitution" instead of "the substitution"
  • "backslash notation" instead of "the backslash notation"
  • no articles before "\" and "\'"

On the other hand, in the same tutorial we have a sentence:

Constants defined within a class or module can be accessed from within that class or module, and those defined outside a class or module can be accessed globally.

Where we have "a class".

So my question is: are these sentences written correctly? And what rules should I obey with articles as a programmer writing about programming stuff?

  • None of this seems specific to programming, perhaps some more research on omission of articles will help. – Freddie R Oct 22 '18 at 12:44
1

When we program we often have to use a programming language that is based on a human language, such as English. Often such descriptions are crafted to avoid clashes between the descriptive and programming languages.

  • class String

'String' here is subordinate to 'class', a bit like saying: 'This is my friend John'. We could write it '...friend, John' or '...friend: John', but it is not essential as we know that 'my friend' and 'John' are separate noun phrases from the context.

The context here is that the noun phrases are not 'class' and 'String' but 'object of class' and 'String'.

It is important to consider that while 'the String class' could be considered to be descriptive of 'class String', in programming 'String class' could be describing a general programming class called 'String' while 'class String' a specific class called 'String'. So 'objects of the String class' is not necessarily the same as 'objects of class String'.

  • substitution... notation

First remember that what they have written is 'allows substitution notation and backslash notation'. They are talking about forms of programming techniques, that the technique of substitution notation is allowed. If we wrote 'the substitution notation' we would have to define which particular substitution notation we meant, and there may be more than one to choose from within the technique

  • backslash notation

See above.

  • \

This is a backslash, but that is WHAT it is. Its name is backslash. Generally we describe such characters, and say 'insert an A after a backslash...', but sometimes we need to use the real names. for example:

2 times 2 is 4

write: AKŃ

B comes before C in the alphabet

This is an essential principal for the sciences, otherwise talking about mathematical equations would be nearly impossible.

  • Okay, thanks for your response! Only doubt I still have is with this String class - saying "the String class" doesn't I choose the one class from many other classes, something like I'd say "the red car", having the choice of red, green and blue? – Karol Selak Oct 22 '18 at 10:32
  • 1
    Since we have a named class, no matter how we word it, it implies there are other classes. The purpose of a name is always to distinguish 'this one' from 'another one' or 'other ones'. :) – Trevor Christopher Butcher Oct 22 '18 at 12:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.