Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #22627 > unrolled thread

Learning C as an existing programmer

Started byrammy <nospam@nospam.com>
First post2012-06-24 21:52 +0000
Last post2012-07-07 11:56 -0700
Articles 20 on this page of 89 — 29 participants

Back to article view | Back to comp.lang.c


Contents

  Learning C as an existing programmer rammy <nospam@nospam.com> - 2012-06-24 21:52 +0000
    Re: Learning C as an existing programmer Ian Collins <ian-news@hotmail.com> - 2012-06-25 10:26 +1200
      Re: Learning C as an existing programmer "Charles Richmond" <numerist@aquaporin4.com> - 2012-06-24 18:28 -0500
        Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 01:05 -0600
        Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 01:10 -0600
          Re: Learning C as an existing programmer Weland <weland@faeroes.freeshell.org> - 2012-06-25 08:20 +0000
            Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-07-02 01:46 -0600
        Re: Learning C as an existing programmer Edward Rutherford <edward.p.rutherford79@REMOVETHIS.gmail.com> - 2012-06-25 20:37 +0000
          Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-25 16:51 -0400
          Re: Learning C as an existing programmer Keith Thompson <kst-u@mib.org> - 2012-06-25 14:25 -0700
            Re: Learning C as an existing programmer Les Cargill <lcargill99@comcast.com> - 2012-06-25 17:50 -0500
            Re: Learning C as an existing programmer William Ahern <william@wilbur.25thandClement.com> - 2012-06-25 16:52 -0700
          Re: Learning C as an existing programmer Les Cargill <lcargill99@comcast.com> - 2012-06-25 17:49 -0500
          Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 00:09 -0700
      Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 00:55 -0600
      Re: Learning C as an existing programmer Nachy <mazwolfe@gmail.com> - 2012-06-25 13:26 -0700
        Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-25 17:07 -0400
        Re: Learning C as an existing programmer Nachy <mazwolfe@gmail.com> - 2012-06-25 14:56 -0700
          Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-25 18:29 -0400
          Re: Learning C as an existing programmer pete <pfiland@mindspring.com> - 2012-06-25 18:56 -0400
            Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 00:21 -0700
              Re: Learning C as an existing programmer Robert Wessel <robertwessel2@yahoo.com> - 2012-06-26 02:56 -0500
              Re: Learning C as an existing programmer Ike Naar <ike@sverige.freeshell.org> - 2012-06-26 08:10 +0000
          Re: Learning C as an existing programmer "J. J. Farrell" <jjf@bcs.org.uk> - 2012-06-26 07:06 +0100
        Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 00:18 -0700
          Re: Learning C as an existing programmer Keith Thompson <kst-u@mib.org> - 2012-06-26 00:23 -0700
          Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-26 06:47 -0400
    Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-25 01:21 +0100
    Re: Learning C as an existing programmer "Joe." <antelope3@news.net> - 2012-06-25 00:54 -0600
    Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-25 09:19 +0200
      Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 11:15 +0100
        Re: Learning C as an existing programmer "Ronald Benedik" <Aon.912717285@aon.at> - 2012-06-25 12:30 +0200
          Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 11:43 +0100
            Re: Learning C as an existing programmer "Ronald Benedik" <Aon.912717285@aon.at> - 2012-06-25 12:55 +0200
        Re: Learning C as an existing programmer Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-06-25 10:38 +0000
          Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 13:05 +0100
        Re: Learning C as an existing programmer Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-06-25 10:56 +0000
        Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-25 13:34 +0200
          Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 12:43 +0100
            Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-25 15:16 +0200
              Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 14:39 +0100
                Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-26 11:07 +0200
                  Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-26 12:05 +0100
                    Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-26 14:28 +0200
              Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-06-25 14:39 +0100
      Re: Learning C as an existing programmer 88888 Dihedral <dihedral88888@googlemail.com> - 2012-06-25 18:21 -0700
        Re: Learning C as an existing programmer David Brown <david@westcontrol.removethisbit.com> - 2012-06-26 11:03 +0200
    Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-25 00:50 -0700
      Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-25 11:50 +0100
        Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-06-25 04:32 -0700
          Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-25 14:25 +0100
            Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-06-26 02:38 -0700
              Re: Learning C as an existing programmer jacob navia <jacob@spamsink.net> - 2012-06-26 12:13 +0200
                Re: Learning C as an existing programmer jacob navia <jacob@spamsink.net> - 2012-06-26 12:15 +0200
                Re: Learning C as an existing programmer Ian Collins <ian-news@hotmail.com> - 2012-06-26 23:08 +1200
              Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-27 01:55 +0100
                Re: Learning C as an existing programmer 88888 Dihedral <dihedral88888@googlemail.com> - 2012-06-26 18:43 -0700
          Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-25 14:27 -0700
            Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-26 00:18 -0700
              Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-26 04:02 -0700
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 05:54 -0700
                Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 07:22 -0700
                  Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-28 04:28 -0700
                    Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-29 10:07 -0700
                      Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-02 08:57 -0700
                        Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-07-03 03:26 -0700
                          Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 16:28 -0700
                        Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 18:16 -0700
                          Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 04:51 -0700
                            Re: Learning C as an existing programmer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-07 16:48 +0100
                              Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 09:07 -0700
                            Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-07 12:27 -0700
                Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-07-03 15:01 +0100
                  Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 16:13 -0700
                    Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-07-07 19:35 +0100
                      Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 11:52 -0700
                      Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-07 19:40 -0700
            Re: Learning C as an existing programmer gwowen <gwowen@gmail.com> - 2012-06-26 03:03 -0700
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 06:34 -0700
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-26 06:40 -0700
              Re: Learning C as an existing programmer Gareth Owen <gwowen@gmail.com> - 2012-06-27 07:16 +0100
                Re: Learning C as an existing programmer James Kuyper <jameskuyper@verizon.net> - 2012-06-27 06:48 -0400
              Re: Learning C as an existing programmer "io_x" <a@b.c.invalid> - 2012-06-28 09:18 +0200
                Re: Learning C as an existing programmer nick_keighley_nospam@hotmail.com - 2012-06-28 02:02 -0700
                  Re: Learning C as an existing programmer "io_x" <a@b.c.invalid> - 2012-06-28 12:19 +0200
            Re: Learning C as an existing programmer Rui Maciel <rui.maciel@gmail.com> - 2012-07-03 15:00 +0100
              Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 15:56 -0700
                Re: Learning C as an existing programmer Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-07 09:18 -0700
                  Re: Learning C as an existing programmer Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-07 11:56 -0700

Page 2 of 5 — ← Prev page 1 [2] 3 4 5  Next page →


#22759

Fromnick_keighley_nospam@hotmail.com
Date2012-06-26 00:21 -0700
Message-ID<50fb4495-ff72-44a0-9fda-17dc4b4f4686@googlegroups.com>
In reply to#22739
On Monday, June 25, 2012 11:56:02 PM UTC+1, pete wrote:

> (stderr), (stdin), and (stdout) 
> are three examples of lowercase macros.

since when have these been macros?

[toc] | [prev] | [next] | [standalone]


#22766

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-06-26 02:56 -0500
Message-ID<5gqiu7d6pf5be6uudkolj0j34j08f980bg@4ax.com>
In reply to#22759
On Tue, 26 Jun 2012 00:21:00 -0700 (PDT),
nick_keighley_nospam@hotmail.com wrote:

>On Monday, June 25, 2012 11:56:02 PM UTC+1, pete wrote:
>
>> (stderr), (stdin), and (stdout) 
>> are three examples of lowercase macros.
>
>since when have these been macros?


Since at least C89.  Omitting the parenthesis, of course.  They expand
into FILE * expressions that are associated with the streams in
question.  From C89:

"4.9.1 Introduction
The header <stdio.h> declares three types, several macros, and many
functions for performing input and output. 
(...)
The macros are (...)

         stderr
         stdin 
         stdout

which are expressions of type ``pointer to FILE '' that point to the
FILE objects associated, respectively, with the standard error, input,
and output streams. 
(...)

[toc] | [prev] | [next] | [standalone]


#22767

FromIke Naar <ike@sverige.freeshell.org>
Date2012-06-26 08:10 +0000
Message-ID<slrn3vfsjuirio.3il.ike@sverige.freeshell.org>
In reply to#22759
On 2012-06-26, nick_keighley_nospam@hotmail.com
<nick_keighley_nospam@hotmail.com> wrote:
> On Monday, June 25, 2012 11:56:02 PM UTC+1, pete wrote:
>
>> (stderr), (stdin), and (stdout) 
>> are three examples of lowercase macros.
>
> since when have these been macros?

In C99 they are listed under the macros section in

7.19 Input/output <stdio.h>

7.19.1 Introduction
The header <stdio.h> declares three types, several macros, and many
functions for performing input and output.

[...]

3 The macros are

[...]

stderr
stdin
stdout

which are expressions of type "pointer to FILE" that point to FILE
objects associated, respectively, with the standard error, input, and
output streams.

[toc] | [prev] | [next] | [standalone]


#22755

From"J. J. Farrell" <jjf@bcs.org.uk>
Date2012-06-26 07:06 +0100
Message-ID<jsbjh0$4lc$1@dont-email.me>
In reply to#22735
On 25/06/2012 22:56, Nachy wrote:
> On Jun 25, 4:38 pm, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
>> Nachy <mazwo...@gmail.com> writes:
>>
>>> - Constants are UPPERCASE (as in many languages, including BASIC)
>>
>>    Uppercase is used for most preprocessor macros,
>>    which might sometimes expand to literals.
>
> Good point.
> s/Constants/Constants and macros/

It's still nonsense though.

[toc] | [prev] | [next] | [standalone]


#22757

Fromnick_keighley_nospam@hotmail.com
Date2012-06-26 00:18 -0700
Message-ID<60aecac2-65ce-4de7-8220-c972b3e551b7@googlegroups.com>
In reply to#22713
On Monday, June 25, 2012 9:26:29 PM UTC+1, Nachy wrote:

<snip>

> I found that the best book for C is still "The C Programming Language"
> - despite its age - as has been pointed out.  As for moving between
> BASIC and C - I don't know what book will be best, and any that I've
> seen are more than 20 years old.  However, I thought of a few pointers
> to help cover the major differences:

<snip>

> 2) case matters.
> - "if" is not the same as "If" or "IF"
> - Nearly everything in C is lowercase - keywords and the standard
> library.
>     _Exit() is the only exception I can think of.

I don't think _Exit() is standard (unless it's in a newer standard 
than I'm familiar with)

> - Constants are UPPERCASE (as in many languages, including BASIC)

*macros* are conventionally in upper case

> - Identifiers with several words use under_scores, not CamelCase

this isn't a universal convention- though it's a common one

<snip>

> 4) You have to put a lot more effort into memory management.
> - malloc() instead of DIM (whatever that stands for)

DIMENSION

you can declare arrays in C- which look pretty similar to Basic's 
DIM to me

> - Pointers are used much more heavily than in BASIC (which has some
> pointer ability)

again, you make the error of assuming "Basic" descibes a single well-defined language. "Basic" does not necessarily have any "pointer ability"

<snip>

[toc] | [prev] | [next] | [standalone]


#22760

FromKeith Thompson <kst-u@mib.org>
Date2012-06-26 00:23 -0700
Message-ID<ln4npy5yf5.fsf@nuthaus.mib.org>
In reply to#22757
nick_keighley_nospam@hotmail.com writes:
[...]
> I don't think _Exit() is standard (unless it's in a newer standard 
> than I'm familiar with)
[...]

It's in C99.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
    Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#22776

FromJames Kuyper <jameskuyper@verizon.net>
Date2012-06-26 06:47 -0400
Message-ID<jsc3vb$vn9$1@dont-email.me>
In reply to#22757
On 06/26/2012 03:18 AM, nick_keighley_nospam@hotmail.com wrote:
> On Monday, June 25, 2012 9:26:29 PM UTC+1, Nachy wrote:
...
>> - Identifiers with several words use under_scores, not CamelCase
> 
> this isn't a universal convention- though it's a common one

If he's talking only about C keywords and standard C library identifiers
(which he has not explicitly stated), then I think he's correct.
-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#22633

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2012-06-25 01:21 +0100
Message-ID<0.21c0340de7c2b62674be.20120625012127BST.878vfcmebc.fsf@bsb.me.uk>
In reply to#22627
rammy <nospam@nospam.com> writes:

> I need to learn C for numerical analysis as part of my Masters research.
>
> I already have quite a lot of experience with BASIC (my progression was GW 
> BASIC -> QBASIC -> Visual BASIC -> VB.net) so I want to find an 
> introductory book on "C for BASIC programmers".
>
> I looked through the campus bookstore and didn't really find anything. 
> Can you recommend some learning materials that will leverage my existing 
> programming knowledge?

If your application makes extensive use of arrays or of complex numbers,
you might want to find out if you have access to an implementation of
the 1999 standard of C.  Many of the books about C concentrate on 1990 C
(often called, rather confusingly, "ANSI C") but C99 added complex
numbers and some array facilities that might be helpful for numerical
programs.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#22649

From"Joe." <antelope3@news.net>
Date2012-06-25 00:54 -0600
Message-ID<js91je$8mr$1@speranza.aioe.org>
In reply to#22627
"rammy" <nospam@nospam.com> wrote in message 
news:js8275$cpo$1@speranza.aioe.org...
> Hi
>
> I need to learn C for numerical analysis as part of my Masters research.

Fucking liar.

>
> I already have quite a lot of experience with BASIC

OK, then NO experience. Noted. One must ask, WTF are they teaching in 
"universities"? (been there, done that, don't like 'em).

> (my progression was GW
> BASIC -> QBASIC -> Visual BASIC -> VB.net) so I want to find an
> introductory book on "C for BASIC programmers".

You should forget about programming and get into some labor job or politics 
at minimum wage. Thinking is not your forte.

>
> I looked through the campus bookstore

And she rejected you cuz she saw you as the dud you are?

> and didn't really find anything.

Disallusionment.

> Can you recommend some learning materials that will leverage my existing
> programming knowledge?

You don't have any programming knowledge.

>
> Thanks in advance!

Fuck you beforehand. 

[toc] | [prev] | [next] | [standalone]


#22655

FromDavid Brown <david@westcontrol.removethisbit.com>
Date2012-06-25 09:19 +0200
Message-ID<XLSdnSdxHdOhj3XSnZ2dnUVZ8midnZ2d@lyse.net>
In reply to#22627
On 24/06/2012 23:52, rammy wrote:
> Hi
>
> I need to learn C for numerical analysis as part of my Masters research.
>
> I already have quite a lot of experience with BASIC (my progression was GW
> BASIC -> QBASIC -> Visual BASIC -> VB.net) so I want to find an
> introductory book on "C for BASIC programmers".
>
> I looked through the campus bookstore and didn't really find anything.
> Can you recommend some learning materials that will leverage my existing
> programming knowledge?
>
> Thanks in advance!
>

Do you have to use C?  There are other languages that might be a better 
choice - Python with SciPy / NumPy comes to mind - then you can 
concentrate more on the numerical analysis, and less on the details of 
programming.

[toc] | [prev] | [next] | [standalone]


#22665

FromRui Maciel <rui.maciel@gmail.com>
Date2012-06-25 11:15 +0100
Message-ID<js9dn4$62l$1@speranza.aioe.org>
In reply to#22655
David Brown wrote:

> Do you have to use C?  There are other languages that might be a better
> choice - Python with SciPy / NumPy comes to mind - then you can
> concentrate more on the numerical analysis, and less on the details of
> programming.

For numerical analysis, if it's not possible to use Fortran then the next 
best option is plain old C.

And numerical analysis boils down to details of programming, as the main 
purpose is to squeese as much computational juice out of a computer as 
possible.  You don't get that by simply toying with algorithms.  Hence, 
Fortran and C being the standards for real world number crunching 
applications.

Even if a user wants to toy around with numerical analyis stuff without 
having to look too much under the hood, Python is still not an adequate 
option; there is Matlab/Octave for that.


Rui Maciel

[toc] | [prev] | [next] | [standalone]


#22667

From"Ronald Benedik" <Aon.912717285@aon.at>
Date2012-06-25 12:30 +0200
Message-ID<4fe83dc3$0$1574$91cee783@newsreader04.highway.telekom.at>
In reply to#22665
"Rui Maciel"  schrieb im Newsbeitrag news:js9dn4$62l$1@speranza.aioe.org... 

David Brown wrote:

> Do you have to use C?  There are other languages that might be a better
> choice - Python with SciPy / NumPy comes to mind - then you can
> concentrate more on the numerical analysis, and less on the details of
> programming.

>For numerical analysis, if it's not possible to use Fortran then the next 
>best option is plain old C.

I would not recommend the old version of C, but the C99 Standard instead.
Complex Numbers are important for quantum Physics applications.
Also to mention is the complex eletric current.

>And numerical analysis boils down to details of programming, as the main 
>purpose is to squeese as much computational juice out of a computer as 
>possible.  You don't get that by simply toying with algorithms.  Hence, 
>Fortran and C being the standards for real world number crunching 
>applications.

Numerical Analysis is not the Analysis of Algorithms.

Next, what difference between Fortran 2008 and C?
New Fortran standards introduce features as operator overloading and 
object oriented Programming. C99 does not do that: C++ does the job.

[toc] | [prev] | [next] | [standalone]


#22669

FromRui Maciel <rui.maciel@gmail.com>
Date2012-06-25 11:43 +0100
Message-ID<js9fbp$abr$1@speranza.aioe.org>
In reply to#22667
Ronald Benedik wrote:

> "Rui Maciel"  schrieb im Newsbeitrag
> news:js9dn4$62l$1@speranza.aioe.org...
> 
> David Brown wrote:
> 
>> Do you have to use C?  There are other languages that might be a better
>> choice - Python with SciPy / NumPy comes to mind - then you can
>> concentrate more on the numerical analysis, and less on the details of
>> programming.
> 
>>For numerical analysis, if it's not possible to use Fortran then the next
>>best option is plain old C.
> 
> I would not recommend the old version of C, but the C99 Standard instead.
> Complex Numbers are important for quantum Physics applications.
> Also to mention is the complex eletric current.

The "plain old" bit was only an idiomatic expression (like "good old X", in 
contrast with brand spanking new Python).  It wasn't a reference to K&R or 
any specific standard.  But you are right, C99 does offer some nice 
features, particularly if complex numbers are required.


>>And numerical analysis boils down to details of programming, as the main
>>purpose is to squeese as much computational juice out of a computer as
>>possible.  You don't get that by simply toying with algorithms.  Hence,
>>Fortran and C being the standards for real world number crunching
>>applications.
> 
> Numerical Analysis is not the Analysis of Algorithms.

Who said it was?


> Next, what difference between Fortran 2008 and C?
> New Fortran standards introduce features as operator overloading and
> object oriented Programming. C99 does not do that: C++ does the job.

Why is that relevant?  There is quite a lot of fundamental libraries which 
are used in this very day that are written with Fortran 77, and don't even 
have a Fortran90 version available.


Rui Maciel

[toc] | [prev] | [next] | [standalone]


#22672

From"Ronald Benedik" <Aon.912717285@aon.at>
Date2012-06-25 12:55 +0200
Message-ID<4fe8439c$0$18683$91cee783@newsreader03.highway.telekom.at>
In reply to#22669
"Rui Maciel"  schrieb im Newsbeitrag news:js9fbp$abr$1@speranza.aioe.org... 

>> Next, what difference between Fortran 2008 and C?
>> New Fortran standards introduce features as operator overloading and
>> object oriented Programming. C99 does not do that: C++ does the job.

>Why is that relevant?  There is quite a lot of fundamental libraries which 
>are used in this very day that are written with Fortran 77, and don't even 
>have a Fortran90 version available.

I wanted  to give the Basic programmer an idea about Fortran and C
differences.

[toc] | [prev] | [next] | [standalone]


#22668

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2012-06-25 10:38 +0000
Message-ID<slrnjugftp.rk7.grahn+nntp@frailea.sa.invalid>
In reply to#22665
On Mon, 2012-06-25, Rui Maciel wrote:
> David Brown wrote:
>
>> Do you have to use C?  There are other languages that might be a better
>> choice - Python with SciPy / NumPy comes to mind - then you can
>> concentrate more on the numerical analysis, and less on the details of
>> programming.
>
> For numerical analysis, if it's not possible to use Fortran then the next 
> best option is plain old C.

Over at comp.lang.c++ they say it's C++.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#22677

FromRui Maciel <rui.maciel@gmail.com>
Date2012-06-25 13:05 +0100
Message-ID<js9k70$mlh$1@speranza.aioe.org>
In reply to#22668
Jorgen Grahn wrote:

> Over at comp.lang.c++ they say it's C++.

I'm also over at comp.lang.c++, and I've also spent a bit of time developing 
number-crunching applications with C++.  If this discussion was hosted in 
that newsgroup I would still underline the merits of Fortran, C and 
Matlab/Octave.


Rui Maciel

[toc] | [prev] | [next] | [standalone]


#22671

FromHeikki Kallasjoki <fis+usenet@zem.fi>
Date2012-06-25 10:56 +0000
Message-ID<slrnjuggug.8un.fis@iris.zem.fi>
In reply to#22665
On 2012-06-25, Rui Maciel <rui.maciel@gmail.com> wrote:
> Even if a user wants to toy around with numerical analyis stuff without 
> having to look too much under the hood, Python is still not an adequate 
> option; there is Matlab/Octave for that.

Python with NumPy/SciPy can be a perfectly adequate option, when
compared to Octave, especially for people with no Matlab background.

Octave might provide a larger amount of functions (especially if
counting the octave-forge package collection), but the NumPy/SciPy API
is by no means barren.  (Even if it is a bit messy.)

As far as performance goes, they use largely the same libraries (ATLAS,
LAPACK, ARPACK, FFTW, ...) for heavy lifting, and for the odd loop (that
can't be easily turned into a matrix operation) here and there Octave
can be really very slow.  In some random benchmarks NumPy performance
has been somewhere in-between Matlab and Octave for matrix-handling
code, and orders of magnitude better than Octave for "regular" code that
you might also want to have in the same program.  (YMMV, as always; the
benchmarks I found weren't especially comprehensive.)


-- 
Heikki Kallasjoki

[toc] | [prev] | [next] | [standalone]


#22675

FromDavid Brown <david@westcontrol.removethisbit.com>
Date2012-06-25 13:34 +0200
Message-ID<Er-dnTDBMLMj0HXSnZ2dnUVZ8mGdnZ2d@lyse.net>
In reply to#22665
On 25/06/2012 12:15, Rui Maciel wrote:
> David Brown wrote:
>
>> Do you have to use C?  There are other languages that might be a better
>> choice - Python with SciPy / NumPy comes to mind - then you can
>> concentrate more on the numerical analysis, and less on the details of
>> programming.
>
> For numerical analysis, if it's not possible to use Fortran then the next
> best option is plain old C.
>
> And numerical analysis boils down to details of programming, as the main
> purpose is to squeese as much computational juice out of a computer as
> possible.  You don't get that by simply toying with algorithms.  Hence,
> Fortran and C being the standards for real world number crunching
> applications.
>
> Even if a user wants to toy around with numerical analyis stuff without
> having to look too much under the hood, Python is still not an adequate
> option; there is Matlab/Octave for that.
>
>

I take it you have no experience with Python or SciPy, but are merely 
prejudice against Python because it is interpreted?  Of course you can 
get greater speed with C than with straight Python.  But if you can do 
the grunt work using SciPy / NumPy libraries, Python is likely to be 
/faster/ than a program written in C.  That is because the underlying 
libraries for NumPy are written in C by experts who have spent a lot of 
effort making fast libraries using fast algorithms - the chances are 
very low that a non-expert C programmer will write faster code.

And anyway, who says this is all about speed?  And even if it /is/ about 
speed, who says the "speed" in question is the number of computations 
per second the OP can squeeze out of his machine?  If the OP is 
interested in looking at fast algorithms for a particular problem, for 
example, then Python can easily be a better language if it is easier for 
him to work with (being interpreted is a clear bonus here).  Turning 
this into a fine-tuned C implementation is just optimisation.

I am not saying that Python + SciPy is the best choice for the OP - I am 
just saying he should look for a wider choice.  Thinking that you have 
to use C because "only C is fast" is premature optimisation, and 
therefore evil.


[toc] | [prev] | [next] | [standalone]


#22676

FromRui Maciel <rui.maciel@gmail.com>
Date2012-06-25 12:43 +0100
Message-ID<js9isj$j0e$1@speranza.aioe.org>
In reply to#22675
David Brown wrote:

> I take it you have no experience with Python or SciPy, but are merely
> prejudice against Python because it is interpreted?  

What?


> Of course you can
> get greater speed with C than with straight Python.

Exactly.  The rest is just noise.


Rui Maciel

[toc] | [prev] | [next] | [standalone]


#22678

FromDavid Brown <david@westcontrol.removethisbit.com>
Date2012-06-25 15:16 +0200
Message-ID<_YKdnYZwjP4o-HXSnZ2dnUVZ8vKdnZ2d@lyse.net>
In reply to#22676
On 25/06/2012 13:43, Rui Maciel wrote:
> David Brown wrote:
>
>> I take it you have no experience with Python or SciPy, but are merely
>> prejudice against Python because it is interpreted?
>
> What?
>
>
>> Of course you can
>> get greater speed with C than with straight Python.
>
> Exactly.  The rest is just noise.
>

So that's a "yes" in answer to my first question?

Fair enough - we all have different opinions and experiences.  It's up 
to the OP to look at all the answers, learn a little of the options 
available, and then decide for himself - he hasn't told us anything 
about what's important.



[toc] | [prev] | [next] | [standalone]


Page 2 of 5 — ← Prev page 1 [2] 3 4 5  Next page →

Back to top | Article view | comp.lang.c


csiph-web