473,806 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Caps convention.

Use all lower case for ansi c functions, and Capitalise For
Platform-Specific.

If you call something with caps, then your function name requires caps
itself.

Nov 14 '05
20 2020
On 20 Dec 2003 20:15:59 GMT, in comp.lang.c , Alexander Bartolich
<al************ *****@gmx.at> wrote:
begin E. Robert Tisdale:
These aren't really styles. The are typing shortcuts
for programmers with a missing shift key.
The idea was that because capital letters and underscore
required the programmer to hold down the shift key,
they slowed down typing (meaning productivity).


And how do you get an underscore without pressing shift?


By using the right keyboard. Not all keyboards have the same layout as
your current (possibly Austrian) one. Some keyboards used to lack the
angles <>, others lacked square brackets, at signs etc. Some Mac ones
still do lack a hash #.
All the world's not a VT102 you know...
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #11
begin Mark McIntyre:
And how do you get an underscore without pressing shift?
By using the right keyboard. Not all keyboards have the same layout as
your current (possibly Austrian) one.


Nope. I do enjoy fast access to square, curly and angle brackets.

http://sunsolve.sun.com/handbook_pub..._UNIX_Kbd.html
[...] All the world's not a VT102 you know...


In the good old times, when real men wrote their own termcap entries...

--
Für Google, Tux und GPL!
Nov 14 '05 #12
On 21 Dec 2003 01:05:35 GMT, in comp.lang.c , Alexander Bartolich
<al************ *****@gmx.at> wrote:
begin Mark McIntyre:
And how do you get an underscore without pressing shift?


By using the right keyboard. Not all keyboards have the same layout as
your current (possibly Austrian) one.


Nope. I do enjoy fast access to square, curly and angle brackets.


If you reread my post, you'll notice that I didn't say whether you
did, or did not have that. Nor, frankly do I care.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #13
Richard Heathfield wrote:

Quite so. But since we're being so public about it at present, my own
preference is xyz_CamelCase for function names and parameter names in the
xyz library (or, perhaps, the library for which xyz is a suitable
contraction or abbreviation), SEPARATED_UPPER _CASE for type names and
macros, and whatever I feel like for local identifiers.


Which reminds me. I wouls like to see namespaces in C. Just a very
simple thing, nothing very fancy.

Putting something in a namespace.
Accessing the namespace explicitly.
Maybe a way of setting the namespace currently being used.

As simple as that.

What do people think?

--
Thomas.

Nov 14 '05 #14
begin Thomas Stegen:
Which reminds me. I wouls like to see namespaces in C.
Just a very simple thing, nothing very fancy.


No, it ain't not simple.

Eventually all symbols end up in one global scope, the symbol table
of the linker. C++ uses a technique called mangled names to work
around this. Think of it as an automatic translation of std::string
to _std_string or something similar, only that C++ also adds argument
types to that.

The net effect are almost unreadable map files, linking problems
between object code from different compilers, additional syntax to
switch back to old behaviour (extern "C"), and increased resource
demands for the linker.

You can use C++ as A Better C (TM), if you like.
The ecological niche of C is bare bones programming, though.

--
Für Google, Tux und GPL!
Nov 14 '05 #15
begin Mark McIntyre:
If you reread my post, you'll notice that I didn't say whether you
did, or did not have that. Nor, frankly do I care.


Thomas Matthews wrote:
# These aren't really styles. The are typing shortcuts
# for programmers with a missing shift key.
# The idea was that because capital letters and underscore
# required the programmer to hold down the shift key,
# they slowed down typing (meaning productivity).

I think that's an urban legend.

--
Für Google, Tux und GPL!
Nov 14 '05 #16
Mark McIntyre wrote:
<al************ *****@gmx.at> wrote:

.... snip ...

Nope. I do enjoy fast access to square, curly and angle brackets.


If you reread my post, you'll notice that I didn't say whether you
did, or did not have that. Nor, frankly do I care.


You cruel unfeeling beast.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #17
Richard Heathfield wrote:

Arthur J. O'Dwyer wrote:
On Sat, 20 Dec 2003, Richard Heathfield wrote:
Malcolm wrote:
>
> Use all lower case for [ANSI C] functions, and Capitalise For
> Platform-Specific.
>
> If you call something with caps, then your function name requires caps
> itself.

Taken to its logical conclusion, this requires you to define your entry
point as Main() - and then it won't link.


Only if your main function is Platform-Specific.


Or if it /calls/ something Platform-Specific, according to Malcolm.

<snip>
FWIW, except for Malcolm's miscapitalizati on of the terms "ANSI C",
I basically agree with his statement. I just don't think it really
needed to be broadcast to the world, any more than it would be
appropriate to start a new thread in alt.usage.engli sh to say,
"Start a new paragraph when there's a new speaker," or in comp.programmin g
to point out that the worst-case running time of Quicksort is O(n^2).
Those who care, already know.


Quite so. But since we're being so public about it at present, my own
preference is xyz_CamelCase for function names and parameter names in the
xyz library (or, perhaps, the library for which xyz is a suitable
contraction or abbreviation), SEPARATED_UPPER _CASE for type names and
macros, and whatever I feel like for local identifiers.

If I declare a function..
void * Malloc(size_t);
...the compiler is not confused at all. It knows that Malloc is not
malloc. But what about the linker? Are the symbols and symbol tables
used in linking alse case sensitive? Can I declare Malloc in one
translation unit and define it in another and be ensured that they will
link?
--
Joe Wright http://www.jw-wright.com
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #18
Joe Wright wrote:
Richard Heathfield wrote:

But since we're being so public about it at present, my own
preference is xyz_CamelCase for function names and parameter names in the
xyz library (or, perhaps, the library for which xyz is a suitable
contraction or abbreviation), SEPARATED_UPPER _CASE for type names and
macros, and whatever I feel like for local identifiers.

If I declare a function..
void * Malloc(size_t);
..the compiler is not confused at all. It knows that Malloc is not
malloc. But what about the linker? Are the symbols and symbol tables
used in linking alse case sensitive? Can I declare Malloc in one
translation unit and define it in another and be ensured that they will
link?


In C90, you can't be sure.

"The implementation may further restrict the significance of an external
name (an identifier that has external linkage) to six characters and may
ignore distinctions of alphabetical case for such names."

ISTR that this restriction has been removed (or at least, /effectively/
removed) in C99.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #19
Alexander Bartolich wrote:
Thomas Matthews wrote:
# These aren't really styles. The are typing shortcuts
# for programmers with a missing shift key.
# The idea was that because capital letters and underscore
# required the programmer to hold down the shift key,
# they slowed down typing (meaning productivity).


It was Tisdale who said that.

Nov 14 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
4938
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not help. I have seen some example that looks at the characters entered in an input field to determine if the caps lock is on, but I was wondering if something is possible that is a bit more immediate to report the caps
7
3900
by: John A Grandy | last post by:
does anyone know of an intrinsic .NET function , or font , or other mechanism , to do "proper-case all-caps" ... ? so, for a name like "Arnold Schwarzenegger" ... .... I want it entirely in capital letters , "ARNOLD SCHWARZENEGGER", *except* that the "A" and the "S" should be a slightly larger font-size than the rest of the letters ...
1
15675
by: charlies224 | last post by:
Hi, I am writting a software that requires me to make sure the Num Lock is always on and Caps Lock is always off. First, I know how to detect if Num Lock or Caps Lock is on or off (if someone is interested, let me know and I will send you the codes). Once we know if the stat of Num Lock/ Caps Lock is not what we desired, we just send the Num Lock / Caps Lock key to change the stat. From most of
114
7890
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for any comments. --
2
2872
by: Mick Charles Beaver | last post by:
Hello, I've been looking into using PyLint on some of my programs, just as a best practices kind of thing. Here's a snippet: #====================================================================== if __name__ == '__main__': parser = optparse.OptionParser(usage='usage: %prog ') parser.add_option('-c', '--config',
9
1579
by: trondhuso | last post by:
Hi, I have a solution that - at time of writing - has to use tables to render a list of database-results. My challenge though is that we have used iframes and such to render the different lists on this page, and now - for some reason - the table has become to wide. I am looking at the code and trying to change width using css, but without much luck. I see that in some of the data there are Caps-only text, and I am now wondering if...
18
15665
by: DanicaDear | last post by:
I want to use all caps in a database. I desire to show all caps AS YOU TYPE regardless of how the keyboard/caps lock is set. I tried to format my form field with an on-click event…and this is the code I am trying to use (which I found on the internet while researching this). Private Sub ChangetoUpperCase(KeyAscii As Integer) If KeyAscii >= 97 And KeyAscii <= 122 Then KeyAscii = (KeyAscii - 32) End If End Sub I have tried to put this...
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.