C++ in Linux or Windows

Discussion in 'C++' started by Johs, Apr 17, 2007.

  1. Johs

    Johs Guest

    Are there any difference between writting C++ in linux or Windows?

    I was told that it was only a matter of available IDE's (eclipse for both
    platforms, but only Visual Studio for Windows) but are there other
    techincal/syntatical/standard library function differences?

    Johs
    Johs, Apr 17, 2007
    #1
    1. Advertising

  2. Johs skrev:
    > Are there any difference between writting C++ in linux or Windows?
    >
    > I was told that it was only a matter of available IDE's (eclipse for both
    > platforms, but only Visual Studio for Windows) but are there other
    > techincal/syntatical/standard library function differences?
    >


    You'll encounter the difference when you need platform specific api. As
    long as you dwell inside the c++ standard sandbox, you're safe, although
    there are libraries that extend the boundaries of that sandbox to ease
    cross-platform development.

    --
    OU
    Obnoxious User, Apr 17, 2007
    #2
    1. Advertising

  3. Johs

    Lionel B Guest

    On Tue, 17 Apr 2007 16:17:31 +0200, Johs wrote:

    > Are there any difference between writting C++ in linux or Windows?
    >
    > I was told that it was only a matter of available IDE's (eclipse for
    > both platforms, but only Visual Studio for Windows) but are there other
    > techincal/syntatical/standard library function differences?


    Well, in theory there should be no difference in terms of syntax and
    standard library functionality. Some things to bear in mind, though:

    1) The language specification generally does not mandate *implementation*
    of language/library features beyond required functionality, so that
    different compilers - possibly on the same platform - may well implement
    features differently (this may, for example, manifest itself in time/
    memory usage of some function). Also, there are very many instances of
    potential "undefined behaviour" in the language spec; if you hit one of
    these all bets are off and you can't expect similar results across
    platforms/compilers.

    2) Compilers may provide non-standard extensions to the language and
    standard library (hopefully they will also provide a means of "turning
    off" non-standard features and enforcing strict language/standard library
    compliance).

    3) There are likely to be wildly disparate assortments of OS-specific
    libraries available for various platforms, particularly in areas where
    the C++ standard does not provide functionality (eg. GUIs, threading,
    inter-process communication, networking, etc.). Some of these libraries
    may (attempt to) be cross-platform, others not.

    If you stick to strict language standards compliance and avoid non-
    portable libraries then, you should encounter no significant differences
    in the language across platforms; of course this may not be possible,
    depending on what you are trying to program.

    IDEs are a matter of (in)convenience - you may not need/want to use one
    (I don't).

    --
    Lionel B
    Lionel B, Apr 17, 2007
    #3
  4. Johs

    Guest

    On Apr 17, 10:47 am, Lionel B <> wrote:

    > IDEs are a matter of (in)convenience - you may not need/want to use one
    > (I don't).


    Heh - thought I was the only one. Gvim and make for me...
    , Apr 17, 2007
    #4
  5. Johs

    Zeppe Guest

    wrote:

    >> IDEs are a matter of (in)convenience - you may not need/want to use one
    >> (I don't).

    >
    > Heh - thought I was the only one. Gvim and make for me...
    >


    it's just for the 99.99% of the common human beings (I'm among them)
    that a good IDE like Visual Studio improves the productivity by 300%...

    Regards,

    Zeppe
    Zeppe, Apr 17, 2007
    #5
  6. Zeppe wrote:
    > wrote:
    >
    >>> IDEs are a matter of (in)convenience - you may not need/want to use
    >>> one (I don't).

    >>
    >> Heh - thought I was the only one. Gvim and make for me...
    >>

    >
    > it's just for the 99.99% of the common human beings (I'm among them)
    > that a good IDE like Visual Studio improves the productivity by
    > 300%...


    .... yeah, and now you will also tell us that a debugger is useful,
    right? Pff! All my code runs the first time around -- I don't need
    no stinking debuggers! <g>
    Victor Bazarov, Apr 17, 2007
    #6
  7. Johs

    Howard Guest

    "Victor Bazarov" <> wrote in message
    news:f02rrd$ecf$...
    > Zeppe wrote:
    >> wrote:
    >>
    >>>> IDEs are a matter of (in)convenience - you may not need/want to use
    >>>> one (I don't).
    >>>
    >>> Heh - thought I was the only one. Gvim and make for me...
    >>>

    >>
    >> it's just for the 99.99% of the common human beings (I'm among them)
    >> that a good IDE like Visual Studio improves the productivity by
    >> 300%...

    >
    > ... yeah, and now you will also tell us that a debugger is useful,
    > right? Pff! All my code runs the first time around -- I don't need
    > no stinking debuggers! <g>


    Personally, I prefer Zen Programming. No need for compilers, or even code
    editors. The program simply is.

    -Howard
    Howard, Apr 17, 2007
    #7
  8. Howard wrote:
    > "Victor Bazarov" <> wrote in message
    > news:f02rrd$ecf$...
    >> Zeppe wrote:
    >>> wrote:
    >>>
    >>>>> IDEs are a matter of (in)convenience - you may not need/want to
    >>>>> use one (I don't).
    >>>>
    >>>> Heh - thought I was the only one. Gvim and make for me...
    >>>>
    >>>
    >>> it's just for the 99.99% of the common human beings (I'm among them)
    >>> that a good IDE like Visual Studio improves the productivity by
    >>> 300%...

    >>
    >> ... yeah, and now you will also tell us that a debugger is useful,
    >> right? Pff! All my code runs the first time around -- I don't need
    >> no stinking debuggers! <g>

    >
    > Personally, I prefer Zen Programming. No need for compilers, or even
    > code editors. The program simply is.


    IIUIC, when you practice Zen Programming, there *is* no program. Only
    your awareness of it exists. :)
    Victor Bazarov, Apr 17, 2007
    #8
  9. Johs

    James Kanze Guest

    On Apr 17, 6:02 pm, wrote:
    > On Apr 17, 10:47 am, Lionel B <> wrote:


    > > IDEs are a matter of (in)convenience - you may not need/want to use one
    > > (I don't).


    > Heh - thought I was the only one. Gvim and make for me...


    I don't think any professional programmer uses one in his
    professional work. At least, I've never met one who did (and as
    a consultant, I see a lot of different workplaces). Judging
    from what little I've seen of them, they generally don't offer
    the functionality you need for a professional environment.

    That doesn't mean that they're without use. I would hardly like
    to tell a beginning programmer that before compiling his first
    program, he has to learn make. And depending on the
    environment, they may be useful for various types of
    experimenting (although most of the people I know have set up
    their environment so that they can experiment quite easily
    without one).

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 18, 2007
    #9
  10. Johs

    James Kanze Guest

    On Apr 17, 6:06 pm, Zeppe
    <> wrote:
    > wrote:
    > >> IDEs are a matter of (in)convenience - you may not need/want to use one
    > >> (I don't).


    > > Heh - thought I was the only one. Gvim and make for me...


    > it's just for the 99.99% of the common human beings (I'm among them)
    > that a good IDE like Visual Studio improves the productivity by 300%...


    Does it really? Then why isn't it used by the most productive
    programmers?

    An IDE has the advantage of being easy to learn. Typically, the
    easier something is to learn, the less powerful it is, and the
    less productive you are once you have invested the effort to
    learn it. Without any previous knowledge, I'm sure that you can
    write and compile a program quicker with Visual Studios than
    with gvim/shell/makefiles, etc. Once you have learned the
    classical toolset, however, I suspect the reverse is true; at
    least, I've never seen anyone really effective with Visual
    Studios (or with any other IDE).

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 18, 2007
    #10
  11. Johs

    Zeppe Guest

    James Kanze wrote:

    >> it's just for the 99.99% of the common human beings (I'm among them)
    >> that a good IDE like Visual Studio improves the productivity by 300%...

    >
    > Does it really? Then why isn't it used by the most productive
    > programmers?


    and this information where does it comes from?

    > An IDE has the advantage of being easy to learn.


    and easy to keep in mind. That is, if I don't remember something that I
    don't use every day, I can expect to find it quite quickly.

    > Typically, the
    > easier something is to learn, the less powerful it is, and the
    > less productive you are once you have invested the effort to
    > learn it. Without any previous knowledge, I'm sure that you can
    > write and compile a program quicker with Visual Studios than
    > with gvim/shell/makefiles, etc.


    there is no doubt.

    > Once you have learned the
    > classical toolset, however, I suspect the reverse is true;


    oh, well. It depends, actually. Probably if you are able to keep in mind
    every shortcut in vim, every syntax rule of your makefiles and
    everything yuo wrote in them, etc, probably it is true. But if you have
    to remove a specific warning or defining a preprocessor symbol in a
    specific compilation unit, just for example, and you have a makefile
    that you have written long time ago, or you don't have written at all,
    because in the real world you don't work just with your code, I think
    that a left click of the mouse and a check into a box would be faster
    than looking for the appropriate makefile, find the compilation unit,
    hope that is written in such a way you can specify a rule for each
    compilation unit, and then add the command that you have to keep in mind
    anyway in order not to have to look at the manpage of gcc.

    It's the same principle why it's easier exploring a program during the
    debug through the IDE, moving through the program stack by clicking on
    the single functions, keeping under control multiple variables in a
    subwindow, than keeping in mind thousand of "bt", "sb" (I think) and
    other obfuscated gdb commands.

    Regards,

    Zeppe
    Zeppe, Apr 18, 2007
    #11
  12. Johs

    Guest

    On Apr 17, 12:06 pm, Zeppe
    <> wrote:
    > wrote:
    > >> IDEs are a matter of (in)convenience - you may not need/want to use one
    > >> (I don't).

    >
    > > Heh - thought I was the only one. Gvim and make for me...

    >
    > it's just for the 99.99% of the common human beings (I'm among them)
    > that a good IDE like Visual Studio improves the productivity by 300%...


    Maybe if you're doing .net or Windows or some other huge API and need
    Autosense. Slows me down. Also, if working with Java I like
    Eclipse for its ability to hyperlink/jump to definitions of classes/
    methods easily if the code base is large (been a while...think it was
    Eclipse), although it's a horrible memory pig.

    For C++, though, I'm much faster opening all of the buffers I'm
    working on in Gvim. To each his own, I guess.
    , Apr 18, 2007
    #12
  13. Johs

    Zeppe Guest

    wrote:

    > For C++, though, I'm much faster opening all of the buffers I'm
    > working on in Gvim.


    is not just a matter of pure writing. It's everything: managing the
    configuration, building, debugging and so on. Anyway, the last versions
    of gvim provide the integration in visual studio, maybe you like it :)

    > To each his own, I guess.


    Sure :)

    Regards,

    Zeppe
    Zeppe, Apr 18, 2007
    #13
  14. Johs

    Guest

    On Apr 18, 7:23 am, Zeppe
    <> wrote:
    > wrote:
    > > For C++, though, I'm much faster opening all of the buffers I'm
    > > working on in Gvim.

    >
    > is not just a matter of pure writing. It's everything: managing the
    > configuration, building, debugging and so on.


    You only set up the configuration (libraries to link with, include
    dirs, settings, etc.) once, though. After that it's coding and
    building. Too much moving between keyboard and mouse for me with an
    IDE, and I like making my GVim window fullscreen. Don't need a class
    browser taking 30% of the screen on the left, and an output window
    taking another 30% at the bottom.

    Switching between configurations is as easy as "make clean debug" vs
    "make clean all". It's easy to add targets to generate Doxygen info,
    packaging an install executable, etc.
    , Apr 18, 2007
    #14
  15. Johs

    Adrian Guest

    On Apr 17, 8:17 am, "Johs" <> wrote:
    > Are there any difference between writting C++ in linux or Windows?
    >
    > I was told that it was only a matter of available IDE's (eclipse for both
    > platforms, but only Visual Studio for Windows) but are there other
    > techincal/syntatical/standard library function differences?


    Even if you stick to standard C++ paths passto any file access
    functions are system dependent. The one thing I would watch out for is
    the \ and / in file paths and drive letters.


    Adrian
    Adrian, Apr 18, 2007
    #15
  16. Johs

    Adrian Guest

    On Apr 17, 8:17 am, "Johs" <> wrote:
    > Are there any difference between writting C++ in linux or Windows?
    >
    > I was told that it was only a matter of available IDE's (eclipse for both
    > platforms, but only Visual Studio for Windows) but are there other
    > techincal/syntatical/standard library function differences?
    >
    > Johs


    Yes. Anything that passes file paths to the OS. Watch our for the
    direction of slashes and drive letters.

    This is all OS dependent so you need to count for it.


    Adrian
    Adrian, Apr 18, 2007
    #16
  17. Johs

    BobR Guest

    Victor Bazarov <> wrote in message...
    > Howard wrote:
    > > Personally, I prefer Zen Programming. No need for compilers, or even
    > > code editors. The program simply is.

    >
    > IIUIC, when you practice Zen Programming, there *is* no program. Only
    > your awareness of it exists. :)


    Does this 'Zen Programming' have as steep a learning curve as C++?
    Is there an IDE for Zen, or is it all in your id(in your mind)?

    --
    Bob <G> R
    POVrookie
    BobR, Apr 18, 2007
    #17
  18. BobR wrote:
    > Victor Bazarov <> wrote in message...
    >> Howard wrote:
    >>> Personally, I prefer Zen Programming. No need for compilers, or
    >>> even code editors. The program simply is.

    >>
    >> IIUIC, when you practice Zen Programming, there *is* no program.
    >> Only your awareness of it exists. :)

    >
    > Does this 'Zen Programming' have as steep a learning curve as C++?
    > Is there an IDE for Zen, or is it all in your id(in your mind)?


    A young man once came to a Zen Programming teacher and said, "Guru,
    how long would it take me to learn Zen Programming?". The teacher
    said, "Ten years". "What if I study really hard and do all the
    exercises? How long would it take then?" The teacher said,
    "Twenty years".

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Apr 18, 2007
    #18
  19. Johs

    James Kanze Guest

    On Apr 18, 11:20 am, Zeppe
    <> wrote:
    > James Kanze wrote:
    > >> it's just for the 99.99% of the common human beings (I'm among them)
    > >> that a good IDE like Visual Studio improves the productivity by 300%...


    > > Does it really? Then why isn't it used by the most productive
    > > programmers?


    > and this information where does it comes from?


    Personal observation.

    > > An IDE has the advantage of being easy to learn.


    > and easy to keep in mind. That is, if I don't remember something that I
    > don't use every day, I can expect to find it quite quickly.


    Maybe that's the difference. I develop code on a daily basis,
    and remembering things I use on a daily basis isn't difficult.
    I do use a graphical interface with the debugger, for example,
    because that's a tool I'll only use a couple of times a year.
    On the other hand, I'm sitting in front of the keyboard many
    hours most days, so learning to touch type was worth the effort:
    it took time to learn, but that time has more than repaid itself
    since.

    > > Typically, the
    > > easier something is to learn, the less powerful it is, and the
    > > less productive you are once you have invested the effort to
    > > learn it. Without any previous knowledge, I'm sure that you can
    > > write and compile a program quicker with Visual Studios than
    > > with gvim/shell/makefiles, etc.


    > there is no doubt.


    > > Once you have learned the
    > > classical toolset, however, I suspect the reverse is true;


    > oh, well. It depends, actually. Probably if you are able to keep in mind
    > every shortcut in vim, every syntax rule of your makefiles and
    > everything yuo wrote in them, etc, probably it is true.


    Makefiles can be a problem, but they are generally only written
    once, then included. And from what I have seen of Visual
    Studios, the only real difference is that you have to enter the
    text in 100's of little pop-up windows, instead of once in a
    makefile; the default configurations in Visual Studios (and in
    every other tool I've seen, GUI or otherwise) are pretty much
    useless.

    > But if you have
    > to remove a specific warning or defining a preprocessor symbol in a
    > specific compilation unit, just for example, and you have a makefile
    > that you have written long time ago, or you don't have written at all,
    > because in the real world you don't work just with your code, I think
    > that a left click of the mouse and a check into a box would be faster
    > than looking for the appropriate makefile, find the compilation unit,
    > hope that is written in such a way you can specify a rule for each
    > compilation unit, and then add the command that you have to keep in mind
    > anyway in order not to have to look at the manpage of gcc.


    The problem is that you probably want to retrofit this change
    into all of the other makefiles you use. I use GNU make, and my
    local makefiles just define a few variables and include a global
    one (which has become very complicated over time); any such
    modifications go into the global makefile (or a sub-makefile
    included from it, e.g. depending on the compiler or the target
    system).

    This seems to be a widespread technique; at least, I've seen it
    a number of times.

    > It's the same principle why it's easier exploring a program during the
    > debug through the IDE, moving through the program stack by clicking on
    > the single functions, keeping under control multiple variables in a
    > subwindow, than keeping in mind thousand of "bt", "sb" (I think) and
    > other obfuscated gdb commands.


    For the debugger, I agree. Because it's a tool that you'll
    normally only use two or three times a year. (About the only
    exception would be for post mortems, and how much effort does it
    take to remember the single command bt?)

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 19, 2007
    #19
  20. Johs

    James Kanze Guest

    On Apr 18, 3:40 pm, Adrian <> wrote:
    > On Apr 17, 8:17 am, "Johs" <> wrote:


    > > Are there any difference between writting C++ in linux or Windows?


    > > I was told that it was only a matter of available IDE's (eclipse for both
    > > platforms, but only Visual Studio for Windows) but are there other
    > > techincal/syntatical/standard library function differences?


    > Even if you stick to standard C++ paths to any file access
    > functions are system dependent. The one thing I would watch out for is
    > the \ and / in file paths and drive letters.


    Even whether there are paths is system dependent, but on all the
    systems I've seen which supported nested directories, '/' has
    worked as a path separator. I generally use it for internal
    paths, map to a preferred path separator (either '/' or '\\' for
    pathnames which will be passed to other programs or displayed to
    the user), and accept anything in a list of separators (either
    "/" or "/\\") on input.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 19, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. (=?iso-8859-1?Q?=AF=60=B7=2E=2E=2E=F8=A4=B0=60=B0=

    EAGLE v4.11 Professional *Bilingual* - Cadsoft (Windows, Linux - new !

    (=?iso-8859-1?Q?=AF=60=B7=2E=2E=2E=F8=A4=B0=60=B0=, Oct 7, 2003, in forum: VHDL
    Replies:
    0
    Views:
    818
    (=?iso-8859-1?Q?=AF=60=B7=2E=2E=2E=F8=A4=B0=60=B0=
    Oct 7, 2003
  2. Eli Sidwell
    Replies:
    7
    Views:
    2,693
    Gavin Williams
    Jun 24, 2004
  3. news.rz.uni-karlsruhe.de

    comparing java programms on Linux and Windows!

    news.rz.uni-karlsruhe.de, Jul 17, 2003, in forum: Java
    Replies:
    6
    Views:
    379
    Darryl L. Pierce
    Jul 20, 2003
  4. U. George
    Replies:
    4
    Views:
    837
    U. George
    Aug 11, 2005
  5. Krishna Chaitanya
    Replies:
    1
    Views:
    138
    Krishna Chaitanya
    Feb 27, 2009
Loading...

Share This Page