Thread: Strange loop

  1. #16
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    heh I said something like that code, not a ver betum copy of it. By the way, C++ is not a scripting language.

  2. #17
    Registered User
    Join Date
    Dec 2004
    Posts
    14
    You dident say this :cin.ignore(100, '\n');
    And why is C++ not a scripting language, what is it ?

  3. #18
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    It would be a programming language. As for the reasons well cause I said, not sure if this is right so don't kill me. Because you compile it, and it gets turned into machine executable code.
    Last edited by prog-bman; 12-18-2004 at 04:49 AM.
    Woop?

  4. #19
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    While the distinction is blurry (as there are languages that can be both interpreted and compiled, Haskell for instance, and there are C interpreters too), the grouping is about like this:

    The main distinction to make is between markup languages and programming languages.
    Markup languages, such as HTML, are just stuff that is put around normal text to declare that the text is special in some way. XML is mostly a markup language, but some specific XML-based languages are more like programming languages (XSLT, for example, is very close to a programming language, and there's a real programming language that uses XML syntax, too).
    Defining this accurately is a problem. I think a good definition is that a markup language, when processed, directly leads to output.
    A programming language, on the other hand, doesn't directly lead to output. Instead, processing a programming language (compiling or interpreting it) yields a program (in a wide sense), which is a processor in itself. It takes input and produces output from that.
    So, markup language:
    ML -- processing --> Output
    Programming language:
    PL -- processing --> Program -- running --> Output
    ........................................ Input ^
    (XSLT is a processing instruction language, making it look like this:
    PIL -- processing --> Output
    ..... Input ^
    )

    Programming languages then have a few orthogonal further distinctions. One is the separation into imperative (procedural and object-oriented) and declarative (logical and functional) languages. The other is the very blurry separation into scripting languages and, well, others, which are usually called just programming languages. That's the term prog-bman was referring to. For the sake of discussion, I'll call them program languages. (That's because scripting language code is called a script, and the other code is called a program, but 'programming language' is too confusing.)
    Again it is very hard to come up with a definition. I'd say that scripting languages are usually run within a very limited environment with a very specific purpose. For example, the limited environment can be the web browser and the specific purpose the manipulation of web sites, you have JavaScript. On the other hand, in the Gecko Runtime Environment, JavaScript is given far more power and leeway, so it could be called a program language. A scripting language will run predefined actions of the environment to make a bigger thing, but so do program language, and the main difference is whether the environment is a program (scripting language) or an API/VM (program language). You could argue that the GRE is a VM for JavaScript.
    In addition, a scripting language is practically always interpreted, but there are program languages that can be interpreted, too, so I don't think that's a good indicator.
    C++, as it is now, is a pure program language. I'm not aware of any C++ interpreter, nor of any application that can be scripted using C++. Personally, I think that a C++ interpreter would be far too complex to be practical. Another sign of scripting languages is that they are very simple, both so that they can easily be learned and that they can be interpreted quickly. But PHP is very easy and interpreted, yet I wouldn't call it a scripting language. (Despite the name server-side scripts.)
    Perl and Python are more such blurry cases. There are a few programs that can be scripted with Python (Gecko has experimental support for it), but there also are complete programs written in Python (PySLSK, for example, a P2P file sharing client).

    Sooo...

    The point is that C++ is among the few languages that I would surely call pure program languages. C, C++, Pascal, Assembly and perhaps Java and C# are the only ones that I would call that. (Disregarding lesser known or cared-about languages such as Fortran.)



    All of the above is just my personal opinion, of course, and others may have different definitions.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #20
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Yeah what CornedBee said. Granted its not a term with a definition set in stone, but script refers to interpreted languages.

    Languages like Java, or really the whole .NET framework and its dedicated languages as well as any code compiled for it, are somewhat in the gray area. They compiled into an interpreted binary. For the sake of simplicity I'd go ahead and not call them scripting languages, since when i say scripting language people immediately think of Python or HTML.

  6. #21
    Registered User
    Join Date
    Dec 2004
    Posts
    14
    Sorry, i dont understand the last 2 replies my english isnt good

  7. #22
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Ok. Simple version: C++ is a programming language, not a scripting language, so don't use the term "script" for your code. Use "program" for long stuff and "code snippet" or just "snippet" for short stuff.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #23
    Registered User
    Join Date
    Dec 2004
    Posts
    8
    cin.ignore(100,'\n');

    That line ignores upto 100 characters or the enter key witch ever comes first. Without doing so if you only typed in a single character everytime it would be ok but if you entered multiple characters then you would run into the same problem you had before.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My loop within loop won't work
    By Ayreon in forum C Programming
    Replies: 3
    Last Post: 03-18-2009, 10:44 AM
  2. While loop misbehaving (or misunderstanding)
    By mattAU in forum C Programming
    Replies: 2
    Last Post: 08-28-2006, 02:14 AM
  3. Personal Program that is making me go wtf?
    By Submeg in forum C Programming
    Replies: 20
    Last Post: 06-27-2006, 12:13 AM
  4. A somewhat bizzare problem!!! - WHILE LOOP
    By bobthebullet990 in forum C Programming
    Replies: 3
    Last Post: 03-31-2006, 07:19 AM
  5. when a while loop will stop ?
    By blue_gene in forum C Programming
    Replies: 13
    Last Post: 04-20-2004, 03:45 PM