473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C++ in Linux or Windows

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
Apr 17 '07 #1
21 1740
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
Apr 17 '07 #2
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
Apr 17 '07 #3
On Apr 17, 10:47 am, Lionel B <m...@privacy.netwrote:
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 '07 #4
da***********@fastmail.fm 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

Apr 17 '07 #5
Zeppe wrote:
da***********@fastmail.fm 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>
Apr 17 '07 #6

"Victor Bazarov" <v.********@comAcast.netwrote in message
news:f0**********@news.datemas.de...
Zeppe wrote:
>da***********@fastmail.fm 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

Apr 17 '07 #7
Howard wrote:
"Victor Bazarov" <v.********@comAcast.netwrote in message
news:f0**********@news.datemas.de...
>Zeppe wrote:
>>da***********@fastmail.fm 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. :-)
Apr 17 '07 #8
On Apr 17, 6:02 pm, dave_mikes...@fastmail.fm wrote:
On Apr 17, 10:47 am, Lionel B <m...@privacy.netwrote:
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:ja*********@gmail.com
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

Apr 18 '07 #9
On Apr 17, 6:06 pm, Zeppe
<zeppe.remove.all.this.long.comm...@email.itwrot e:
dave_mikes...@fastmail.fm 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:ja*********@gmail.com
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

Apr 18 '07 #10
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
Apr 18 '07 #11
On Apr 17, 12:06 pm, Zeppe
<zeppe.remove.all.this.long.comm...@email.itwrot e:
dave_mikes...@fastmail.fm 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 '07 #12
da***********@fastmail.fm 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
Apr 18 '07 #13
On Apr 18, 7:23 am, Zeppe
<zeppe.remove.all.this.long.comm...@email.itwrot e:
dave_mikes...@fastmail.fm 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 '07 #14
On Apr 17, 8:17 am, "Johs" <s...@asd.comwrote:
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

Apr 18 '07 #15
On Apr 17, 8:17 am, "Johs" <s...@asd.comwrote:
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

Apr 18 '07 #16

Victor Bazarov <v.********@comAcast.netwrote 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 <GR
POVrookie
Apr 18 '07 #17
BobR wrote:
Victor Bazarov <v.********@comAcast.netwrote 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
Apr 18 '07 #18
On Apr 18, 11:20 am, Zeppe
<zeppe.remove.all.this.long.comm...@email.itwrot e:
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:ja*********@gmail.com
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

Apr 19 '07 #19
On Apr 18, 3:40 pm, Adrian <n...@bluedreamer.comwrote:
On Apr 17, 8:17 am, "Johs" <s...@asd.comwrote:
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:ja*********@gmail.com
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

Apr 19 '07 #20
On Wed, 18 Apr 2007 21:57:39 +0000, BobR wrote:
Victor Bazarov <v.********@comAcast.netwrote 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)?
You may use the "gzz" system:

http://www.nongnu.org/gzz/nutshell.html

Ah, but wait, it's "ceased to exist" (can we say it ever really did?) ...

http://www.nongnu.org/gzz/

....and been superseded by:

http://fenfire.org/

Quote:

"Everything has to do with everything else. Fenfire is a Free Software
project developing a computing environment in which you can express these
relationships and benefit from them."

--
Lionel B
Apr 19 '07 #21
* James Kanze:
>
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?)
Depends what a debugger is used for.

In at least half of the cases I don't debug to find some bug I've
introduced or some bug in the system I'm working on, but in order to
figure out how some library really works, e.g. what's called in what
order with what arguments, and how's that internal message dispatch?,
and what function or class is a good way to accomplish effect X, due to
lack of proper documentation or complete public interfaces.

And many times when using Visual Studio I just run the program in the
debugger as a matter of course, because if there is a bug (and they do
happen! ;-)) what usually happens is that the program does something
like asserting or dereferencing a nullpointer, control is passed to the
debugger automatically, which either points out the offending line
directly or provides a call stack where that bug is very evident.

Debugging in Windows development using Microsoft's tools is, anyway,
very different from debugging a post mortem.

When the program is run and does something that in *nix would produce a
core dump, e.g. during testing, what happens in Windows development is
that the debugger is fired up automatically (Just In Time debugging),
and you get to inspect the live (suspended but restartable) process.
Those tools are very handy and productive. On the other hand, Charles
Petzold wrote an article about how the IDE tools dumb us down so that we
no longer really construct things but just put things together from
menus, canned programming, and I partly agree with that: it's come to a
point where a normal human being just can't keep track of all those tens
of thousands member functions and classes, and must rely on browsing and
try-and-fail, only dimly understanding why things appear to work and
relying on the heuristic that if it works for the most common case then
it probably works, which, not surprisingly, leads to heavy use of
debugging tools for the many cases where it doesn't really work, because
that heuristic is just a guideline that's more like a wish than reality.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Apr 19 '07 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: inquirydog | last post by:
Hello- I, the inquirydog, would like to solicit suggestions for a new web page I am making: I am creating a simple website that will translate concepts between windows os's, Linux, and the...
6
by: gnu | last post by:
Rationale to use Linux ======================= - I can't afford paying for $199 for the license of an OS that's arguably better thank Linux for each of 10 computers I have. - I want to be...
26
by: Simon | last post by:
I'm doing a survey. When do you think GNU/Linux will be ready for the average Joe? What obstacles must it overcome first?
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
4
by: John Owens | last post by:
Hi, I'm looking for a plugin for Visual Studio .NET or another IDE etc that would allow me to develop on Windows but have the compiler and debugger and code run on Linux. e.g. Code using...
4
by: Tim Golden | last post by:
Tim Golden enlightened us with: > > Well, I'm with you. I'm sure a lot of people will chime in to point > > out just how flexible and useful and productive Linux is as a > > workstation, but every...
3
by: A.M | last post by:
Hi, I am planning to develop python applications on windows and run them on Linux. Are ActivePython scripts compatible with Linux? Is there any guideline that explains the compatibility...
3
by: Bruno LIVERNAIS | last post by:
Hi, We are currently installing a DB2 V9 ESE on a Linux server (RHEL4U4-x86_64). Installation runs successfully on each node. Database user environment is OK and the instance is well created. To...
1
Nepomuk
by: Nepomuk | last post by:
You might have heard about Linux, but you don't know what it is? Or you know a few things about it, but they terrify you? Well, then this article is for you. Don't be afraid - Everyone can use Linux!...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.