[lug] Programming

Chan Kar Heng karheng at softhome.net
Sat Feb 22 11:59:06 MST 2003



>>wow, thats neat...didn't know that :) I will definitely try this..
>>On a side note...I would like to learn a compiled language
>>that will work for Windoz and Linux. If I start learning
>>MS Visual C++, Could i write c++ progs for Linux with it?
>>I know this is probably a dumb question :)
>
>The IDE makes a nice editor. You could not comnpile for linux on it. You could not use any MS features on Linux, and almost everything on VC++ seems riddled with MS proprietary items. If you wrote core code that has nothing to do with MS frameworks or extensions (which isn't easy), then it would in theory compile also on Linux (this requires some discipline). If you use STL, you'd have to use something like the boost STL on windows, the MS version of STL is...well..."not up to standards in almost every case".

i agree with the statement above... some discipline is really required
to keep your code tied to a specific compiler/linker and platform.
(note that there _is_ a big difference in writing non-compiler specific
code and non-platform specific code...)

like what the others have said, the other alternatives are
very much worth considering (java, perl, tk, even c# and others).

really depends on what you want at the end of the day.

i'd recommend going with mingw and linux if C/C++ is indeed the
choice... cygwin is quite okay too (but it uses its own runtime).
try looking up third party libraries like libsdl, gtk and opengl too.

while other languages usually come with large sets of
standard API functions, (such as java with swing, etc),
C/C++ only has a _very_ small set of standard APIs...
(functions defined by ANSI, and common ones defined
by POSIX).

with C/C++, the distinction of language or language syntax
and API is quite apparent. so while the code will most often
compile without syntax errors, it will quite likely fail to compile
with errors of undefined identifiers, missing files or libraries or
compiler directives.

might need to take note of things like calling convention too
if you go deep enough...
there're a whole lot of other considerations when writing
non-compiler specific and non-platform specific code...


rgds,

kh




More information about the LUG mailing list