Re: Cpp Considered Harmful

From: Steven T. Hatton (susudata_at_setidava.kushan.aa)
Date: 09/02/04


Date: Wed, 01 Sep 2004 19:30:12 -0400

Sam Holden wrote:

> On Wed, 01 Sep 2004 03:52:53 -0400,
> Steven T. Hatton <susudata@setidava.kushan.aa> wrote:
>> Phlip wrote:
>>
>>> Steven T. Hatton wrote:
>>>
>>>> And you get threadding, unicode, effortless portability, incredibly
>>>> smooth refactoring, highlevel abstraction with the tools to support it,
>>>> great,
>>>
>>> Threading is good??
>>
>> Hu? Even Microsoft eventually figured that out. Yes. Thread support is
>> crucial for creating any sophisticated application that can be expected
>> to do more than one thing at a time.
>
> Strangely enough I've been using non-threaded applications that
> do more than one thing at a time and are reasonably sophisticated.
>
> Where sophisticated means things like: makes multiple concurrent TCP
> connections, encodes and decodes audio sending and receiving it over
> UDP, displays GUI and so on - without a thread in sight (well one
> thread for the pedants).

OK. Let me be clear as to what I really meant be threading. I really
intended concurrent programming with resource locking and synchronization.
Technically, threading means tracing the same executable image with
multiple instruction pointers. It's main advantages are the multiple use
of the same executable image by different 'processes', and the reduced need
for context switching between processes.

> I even write them occassionaly.
>
> Threading throws away decades of work in creating systems with useful
> protected memory spaces for processes. And lets the average programmer
> meet all the problems and reinvent (poorly) all the solutions all over
> again. Rather than using the solution implemented by the (hopefully
> much more experienced and competent in the domain) OS authors.

What you seem to be suggesting is that threads are used in situations where
multiple processes would be better. Am I to also understand that all
concurrency is bad?
 
> Of course there's that vanishingly small percentage of problems that
> are best solved with threads, but chances are you, me, and the
> next guy aren't working on one of them.

Please clarify what you mean by 'thread'. I suspect we aren't talking about
the same thing.

-- 
"[M]y dislike for the preprocessor is well known. Cpp is essential in C
programming, and still important in conventional C++ implementations, but
it is a hack, and so are most of the techniques that rely on it. ...I think
the time has come to be serious about macro-free C++ programming." - B. S.


Relevant Pages

  • Threads Without the Pain? ACM Queue Vol 3, No 9 2005-11-01
    ... wonder what comp.programming.threads has to say about State Threads, ... Much of today's software deals with multiple concurrent tasks. ... Different approaches to concurrent programming offer different ...
    (comp.programming.threads)
  • "The Problem with Threads" - IEEEs Computer magazine article
    ... For concurrent programming to become mainstream, ... Concurrent programming is difficult, 1yet many technologists predict ... despite a long history of much better data-parallel languages. ... Nondeterminism and Threads ...
    (comp.programming.threads)
  • Re: Concurrent computing and the Actor Model, seek for suggestions
    ... Dao supports concurrent programming by providing ... add more concurrent programming ability to this new language. ... syntax seems totally the wrong way to represent parallelism in code. ... functional-programming language has tackled this problem already. ...
    (comp.programming)
  • Re: Future of Lisp
    ... > Some of you may have watched Herb Sutter's 1 hour + lecture on the ... > which are all already in lisp. ... really are for lisp or for programming generally. ... programming experiences I ever had was working on concurrent systems ...
    (comp.lang.lisp)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... prejudices and the resentment of a literate style in programming, ... campaign on some assertions and a Web page created by Programmer Dude ... they were proven on multiple operating ... systems, compilers and CPU architectures. ...
    (comp.programming)