From: Yannick Tremblay on
In article <4b584dcf$0$14127$703f8584(a)textnews.kpn.nl>,
Bas <none(a)noone.nl> wrote:
>
>"Francis Glassborow" <francis.glassborow(a)btinternet.com> wrote in message
>news:0rudnYqeK6jWs8XWnZ2dnUVZ8gVi4p2d(a)bt.com...
>> Bas wrote:
>>
>>>
>>> "Albert" <albert.xtheunknown0(a)gmail.com> wrote in message
>>> news:KAM5n.2415$pv.2254(a)news-server.bigpond.net.au...
>>>> Hello,
>>>>
>>>> For coding contests I only have a solid knowledge of C. When problems
>>>> get hard, I won't have time to code up my own Andersson tree but will
>>>> have to use a binary search tree in the STL.
>>>>
>>>> Is there a good tutorial on C++ you would recommend, covering especially
>>>> the STL, on the internet for C programmers? I need a solid understanding
>>>> of C++ programs that are the C++ version of the C counterpart (so I can
>>>> found out what I need to #include, what using namespace std means), and
>>>> don't need OOP *at all* (but I think the STL requires understanding of
>>>> OOP, I'm not sure).
>>>>
>>
>> > IMHO I dont think you can understand STL really well if you don't know
>> > C++ really well.
>> >
>> > Bas
>>
>> However you do not need to understand it in order to use it. E.g.
>>
>> std::vector<T>
>>
>> all the user needs to know is that creates an expendable sequence of T.
>
>..I think you need at least some knowlegde of templates. If T is a compound
>object (Base and derived class) you need to know etc.
>I doubt one can use the STL without knowing C++.

I think the point is the the OP (Albert) fears that using C++ would
require him to switch completely to Object Oriented programming rather
than the functional programming style that is more common in C and
that he has been using for years and that he is familiar and
confortable with.

Personally, I think although one needs to gain an undertanding of C++,
one can keep working in functional programming, close to C style and
gain significant benefits by using the STL.

Yannick




From: Richard Heathfield on
Bas wrote:

<snip>

> I doubt one can use the STL without knowing C++.

Oh, I dunno - I seem to get by.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within
From: Albert on
Yannick Tremblay wrote:
> In article <4b584dcf$0$14127$703f8584(a)textnews.kpn.nl>,
> Bas <none(a)noone.nl> wrote:
>> <snip>
>>> <snip>
>>>> <snip>
>>>>> <snip>
>>>> <snip>
>>> <snip>
>> <snip>
> I think the point is the the OP (Albert) fears that using C++ would
> require him to switch completely to Object Oriented programming rather
> than the functional programming style that is more common in C and
> that he has been using for years and that he is familiar and
> confortable with.
> <snip>

Not quite. In coding contests, everyone I know uses a functional
programming style, it's just that they are about getting the algorithms
right in a limited time, not spending half the time debugging the
various operations/functions for the sometimes tricky data structures
required (eg. height-balanced binary search trees, *maybe* the
heap-based priority queue and the disjoint set operations for
Kruskal's). I'm keeping in mind that at international level (ie. the
IOI), no reference materials can be brought in by people, and the
computers only provide STL docs and C reference.
From: Keith Thompson on
Albert <albert.xtheunknown0(a)gmail.com> writes:
> Yannick Tremblay wrote:
>> In article <4b584dcf$0$14127$703f8584(a)textnews.kpn.nl>,
>> Bas <none(a)noone.nl> wrote:
>>> <snip>
>>>> <snip>
>>>>> <snip>
>>>>>> <snip>
>>>>> <snip>
>>>> <snip>
>>> <snip>
>> I think the point is the the OP (Albert) fears that using C++ would
>> require him to switch completely to Object Oriented programming rather
>> than the functional programming style that is more common in C and
>> that he has been using for years and that he is familiar and
>> confortable with. <snip>
>
> Not quite. In coding contests, everyone I know uses a functional
> programming style, it's just that they are about getting the
[snip]

I don't think "functional programming style" is really what
you mean. A functional programming style is common in Lisp and
similar languages. The most common programming style in C is an
imperative or procedural style.

--
Keith Thompson (The_Other_Keith) kst-u(a)mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
From: Albert on
Keith Thompson wrote:
> Albert <albert.xtheunknown0(a)gmail.com> writes:
>> Yannick Tremblay wrote:
>>> In article <4b584dcf$0$14127$703f8584(a)textnews.kpn.nl>,
>>> Bas <none(a)noone.nl> wrote:
>>>> <snip>
>>>>> <snip>
>>>>>> <snip>
>>>>>>> <snip>
>>>>>> <snip>
>>>>> <snip>
>>>> <snip>
>>> I think the point is the the OP (Albert) fears that using C++ would
>>> require him to switch completely to Object Oriented programming rather
>>> than the functional programming style that is more common in C and
>>> that he has been using for years and that he is familiar and
>>> confortable with. <snip>
>> Not quite. In coding contests, everyone I know uses a functional
>> programming style, it's just that they are about getting the
> [snip]
>
> I don't think "functional programming style" is really what
> you mean. A functional programming style is common in Lisp and
> similar languages. The most common programming style in C is an
> imperative or procedural style.
>

Yep, you're right; that is indeed what I meant :)