This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Calculator Programming subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. General Coding and Design => Calculator Programming
Author Message
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 14 Sep 2006 06:07:00 pm    Post subject:

Am I the only one who has no preference in positioning the curlies? ;)

Actually, I tend to like the emacs default (GNU style), but it's a hell to maintain with an editor that's not aware of it. If anyone is interested, PTI is written in K&R style, with hard tabs. Razz I don't mind the 'lost' opening braces, since I have long ago developed the habit of immediately typing the matching parenthesis/bracket/brace/quotation mark after opening any of them. I haven't even realised until someone pointed it out. Neutral
Back to top
Tiberious726


Advanced Member


Joined: 07 Oct 2005
Posts: 284

Posted: 14 Sep 2006 09:15:45 pm    Post subject:

just because something is more popular does not make it better;

i think that they coding style is simply a matter of personal preferance, i find K&R appealing and actually easier to read but that could have a lot to do with learning C from K&R's book; additionally i am not interested in C++ and doubt i ever will be; the only current OO language that looks even slightly apealing is JAVA (which BTW uses K&R for almost everything)

OO really just strikes me as another of those silver bullets employers pick up and believe they need; i have always found C to be the apex of beauty in programing (tho i do freely admit i do not know every programing language) and i see no advantage to OO; if you would like to "enlighten" me as to the benifits of OO i would be glad to listen but from all that i have read it really does strike me as something that is not of great use (the only argument i have heard is reusable code, which in practice only works if the programer followed good programming style, and if the programmer did that then C code would be just as reuseable)
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 14 Sep 2006 09:28:55 pm    Post subject:

Tiberious726 wrote:
if you would like to "enlighten" me as to the benifits of OO i would be glad to listen but from all that i have read it really does strike me as something that is not of great use
[post="88290"]<{POST_SNAPBACK}>[/post]

It is good for GUIs and video games and simulations and that's about it.
Back to top
JoeImp
Enlightened


Active Member


Joined: 24 May 2003
Posts: 747

Posted: 14 Sep 2006 11:05:00 pm    Post subject:

After those last two comments I'm done responding in this thread unless it switches over to a non-formatting/OOP subject. The farther this current topic goes, the less people know anything about the subject they're discussing.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 15 Sep 2006 03:18:18 am    Post subject:

I see BSD/Allman and K&R used about evenly amongst the books I've used. I think K&R might be more popular with Java, that's where I see it most, and it seems to fit it well.

The people ("colleagues".. lol!) who's code I('ve) see(n) use K&R, though the only difference really is that opening { . I think it just comes down to a return instead of a space, if that bothers you so much in someone's code just do a replace all " {\n" with "\n{\n".

JoeImp wrote:
Since C++ is object oriented, I see moving to a more object orientated coding/formatting approach as sensible rather than trying to blend code blocks into other code to get an extra 4 or 5 lines out of my screen.[post="88258"]<{POST_SNAPBACK}>[/post]
How is K&R not OO enough and how does it blend blocks together? (also Java is MORE (purer) OO than C++ so why is K&R so popular there?)

Last edited by Guest on 15 Sep 2006 03:19:43 am; edited 1 time in total
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 15 Sep 2006 05:09:30 am    Post subject:

Arcane Wizard wrote:
(also Java is MORE (purer) OO than C++ so why is K&R so popular there?)
[post="88295"]<{POST_SNAPBACK}>[/post]

That's an easy one. It's simply because everything Java that comes out of Sun uses K&R, so everyone follows precedent.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 15 Sep 2006 05:17:03 am    Post subject:

And why does Sun use K&R? : )

Last edited by Guest on 15 Sep 2006 05:17:12 am; edited 1 time in total
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 15 Sep 2006 06:34:02 am    Post subject:

Arcane Wizard wrote:
And why does Sun use K&R? : )
[post="88297"]<{POST_SNAPBACK}>[/post]

Who cares.
Back to top
benryves


Active Member


Joined: 23 Feb 2006
Posts: 564

Posted: 15 Sep 2006 08:39:43 am    Post subject:

How is OO anything to do with indentation/curlies placement? VB doesn't use any curlies at all and manages to be OO :)

I would never say that C is the apex of beauty. Wink It's a nice language and all, but lack of forward referencing and having to write header files gets old very quickly. From the point of view of the main code, yes, it's great, which is probably why it's mimicked so much (C#, Java, PHP, ECMAScript, &c).

Anyway, OO is old news. Functional programming languages seem to be getting back in fashion for some reason...
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 15 Sep 2006 03:39:32 pm    Post subject:

benryves wrote:
It's a nice language and all, but lack of forward referencing and having to write header files gets old very quickly.

It's a compiler friendly language. Wink Linear readability has the nice property of allowing fast parsing. Whether it encourages or discourages good programming practices, that's another question.

benryves wrote:
Anyway, OO is old news. Functional programming languages seem to be getting back in fashion for some reason...

Wondering why they are the focus of my PhD studies? Very Happy
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Page 2 of 2 » All times are UTC - 5 Hours

 

Advertisement