Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C++ in Linux or Windows

Name: Anonymous 2012-01-11 1:20

>inb4 Google, I looked and couldn't find what I'm asking about

Is it better to code C++ programs in Linux or Windows? I'm new to this. I'm just learning and don't want to start off on the wrong track. I'm using Linux btw.

Couldn't you just take the same code written on Linux and compile it on Windows? The only difference would be certain OS-specific differences like window managers, etc., which could somewhat easily be fixed, right? If so, what's the big deal about porting programs to and from Linux and Windows? What am I missing?

If you also have some brotips on better languages than C++, please share them. I want to be able to make all sorts of programs; efficiency is important. My ideal language is one that can do "anything" so that I can specialize in a master race language. Tl;dr Please confirm whether C++ is god tier.

Name: Anonymous 2012-01-11 1:24

/backplate getgoes/

Name: Anonymous 2012-01-11 1:51

[quote]The only difference would be certain OS-specific differences like window managers, etc., which could somewhat easily be fixed, right?[/quote]

This is the part where we start laughing uncontrollably and reach our shaking fingers to the keyboard to page past your post, lest we collapse from asphyxiation.

Name: Anonymous 2012-01-11 1:55

Start off on the wrong track? You already have, if youre using C++. Use C, honestly, is will put things in your way that _need_ to be in your way for you to structure a program right, such as using structures for different types, where C++ gives you the ``answer'' with inheritence, C causes you to actually think, and therefore it is harder to end up with sphaghetticode. Shitch to C now and you won't regret it. Also, you don't need to worry about portability because fuck windows. Development is better in Linux anyway.

Name: Anonymous 2012-01-11 4:55

>>1
C++ is not really god tier (common noob misconception), more like parasite. Its clumsy at high abstraction, worthless at low level, kinda designed like a joke (bitshift operators for IO).

In Linux C gets the best special treatment, C++ itself doesn't get any particularly special treatment other than its existence alongside various other language compilers in the GNU suite, Stallman considers Lisp the god tier but recommends C for critical mass adoption, Torvalds hates C++ publicly.

In Windows Microsoft used to give C++ the best treatment among its compiler tools in the early 1990s and competitors mainly provided C++ suites for what was apparently directed at an unrefined desktop+enterprise+etc programming market, but now this has waned as Microsoft pushes C# after the predominant market forces demanding managed environments pioneered by various desktop DB languages, FoxPro, VB, some SmallTalks and later Java, the C++ competitors have since gone out of business, went open source, and went into other markets.

In actuality for C++:
1. Has been losing out somewhat in desktop stuff since the early 1990s, a lot of this niche is filling in by various EXE packaged scripting languages and various toy and whatever languages.
2. Has had some in-read in embedded, but not in the same way, many of the C++ compilers are actually mainly C compilers with classes and exceptions, this half-C++ has been made `official' with the EC++ standard. C is probably more common in embedded as knowing what the hardware is doing is rather essential.
3. Inexistent in web client, server, enterprise, etc.

Finally:

1. If you're looking for a job you should probably learn something else.
2. If you want to make something great and get it out there without spending countless days on fixing memory issues on your own time you're better off learning something else.
3. Backtrack choice-points and say 'no'.

Predicate `something else':
1. On low level: C
2. On high level: anything else which should have:
a. Portable on at least 3 platforms and UNIX source (most languages that have more than one guy developing it will have between 6 and more).
b. Have bindings or baked in a portable window manager.
c. Lithp

Name: Anonymous 2012-01-11 4:59

>>5
Learning C++ really makes you appreaciate the 'better' languages.

Name: Anonymous 2012-01-11 5:55

With appropriate libraries like wxwidgets or something and an appropriate developer like Code::Blocks you can do all that stuff in one place.

With appropriate flags and shit you can compile your stuff cross platform through Code::blocks, not try and run cryptic command line GNU+Linux hacker bullshit when you want to deal with them.

Name: Anonymous 2012-01-11 8:32

>>7
run cryptic command line GNU+Linux hacker bullshit
Please elaborate.
Also doesn't Cock::Blocks just use mingw or cygwin which run gcc (GNU x Linux hacker bullshit), like most IDE's which arent MS VC++

Name: Anonymous 2012-01-11 9:12

>>6
that's typically not how the saying goes.

Learning ASM really makes you appreciate the higher languages
Learning C really makes you appreciate the higher languages
Learning Lisp really shows you how to become a god.

Name: Anonymous 2012-01-11 9:14

>>7
IDEs are just for lazy programmers who don't know how to use the command line and thus they have the IDE use the command line for them. Given one day you'll be forced to use the command line you'll have not a clue what to do. You probably don't even know what the compiler is called that you use.

Name: Anonymous 2012-01-11 9:24

>>1
Don't listen to faggots. Install Linux and g++ and you are ready to do some code.

Name: Anonymous 2012-01-11 9:29

>>10
So where do you edit your code, on ed, the standard editor? Even VIM and Emacs offer IDE-like capabilities.

Name: Anonymous 2012-01-11 9:34

IDE is just buzzword for "click button to compile"

Name: Anonymous 2012-01-11 9:46

>>12
I use ed because it is the standard

Name: Anonymous 2012-01-11 9:54

>>13
Code completion.
Essential for oop bloat. Which has moar members which are named in the longest, most obscure, possible manner.

Name: Anonymous 2012-01-11 10:39

Related:

In what language is portability generally easiest (between Linux and Windows)?

Name: Anonymous 2012-01-11 10:43

>>12
No they don't you idiot. For example, an IDE will sometimes include a makefile. Vi and Emacs don't include such things. Also, an IDE will sometimes include a debugger. Againg, Vi and Emacs don't include such things.

Name: Anonymous 2012-01-11 10:48

>>16
*er, I should add: among the C family
I don't want to use Java

Name: Anonymous 2012-01-11 10:48

>>3
[quote]The only difference would be certain OS-specific differences like window managers, etc., which could somewhat easily be fixed, right?[/quote]

Any experienced programmer would tell you the windows managers on *nix are broke beyond the point of being fixed.

Name: Anonymous 2012-01-11 10:56

>>4
Holy shit you're an ignoramus. Your arguments make no sense. You say C will puts things in your way that need to be in your way, since C uses structures for different types, while C++ uses inheritance. If anything, it's the opposite. The advantage of inheritance is that you can encapsulate data if you want to, which allows for you to hide implementation details, i.e. it "puts things in your way that need to be in your way". I'm not quite sure what you're saying about the spaghetti code. As for not bothering to support Windows, that depends on the demographic.

>>5
Clumsy at high-level abstraction? Worthless at low level? Elaborate. As for the use of bitshift operators for I/O, I can't say I'm a fan, but there's nothing wrong with it. Some may argue that it's intuitive.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2012-01-11 11:02

>>20

You say C will puts things in your way that need to be in your way, since C uses structures for different types,

This would be called a union. Some of the earlier linux malloc() implementations and the part of the BSD TCP/IP stack uses this sort of an approach. But other than that, C really doesn't use structures for different types.

Well, there is a structure, but that something like that really isn't meant to hold "different types" in the sense that you're talking about.

Name: Anonymous 2012-01-11 11:03

http://en.wikipedia.org/wiki/EC%2B%2B
The language has had a poor reception with many EXPERT C++ PROGRAMMERS. In particular, Bjarne Stroustrup says, "To the best of my knowledge EC++ is dead (2004), and if it isn't it ought to be."[5]
- Bjarne upset that /jp/ improved his language by removing 90% of its features.
emphasis mine

Name: Anonymous 2012-01-11 11:05

>>22
EC++ isn't dead, in fact it's used in the Apple XNU kernel, used in both Mac OS X and iOS. So fuck Stroustrup.

Name: Anonymous 2012-01-11 11:07

>>5
>>4
These sound like good arguments for C. I hope this isn't actually elaborate trolling.

How would you respond to these arguments?
http://unthought.net/c++/c_vs_c++.html

Name: Anonymous 2012-01-11 11:18

>>21
I was quoting him. I don't think he was talking about unions. He made a comparison with inheritance. He didn't say anything about polymorphism, so I'm guessing he was referring to extending structures by inheritance vs. defining structures using existing ones.

I don't understand what you're saying about structures. By "structure" we're referring to structs by the way (or at least I thought that's what he meant).

Name: Anonymous 2012-01-11 11:36

>>1

Simply ignore everything posted above this post.

First, there is no such thing as true portability. Either you stick to the standard and remain "rather" portable (and mostly useless, since you won't be doing any networking, multithreading or graphical interface programming), or you don't and have a bad time porting your code when you need. It is a choice you have to make.

Second, your question "is it better to code C++ in Windows or Linux" is nonsense to me. You could elaborate better what you intend to ask, but, as far as I understood, instead of choosing the most appropriate target for your language, you should choose the most appropriate language for your target. Either way, both systems comprise an extensive C interface, which you could easily use from inside C++ code. The MSVC compiler is an excellent tool; however, standard-wise it is not really compliant: GCC is a better choice if you worry about this.

Third, C++ have a number of problems, but it is one of the best practical languages around. It is not a "god tier" language if you're a neckbeard which derive sexual arousement from debatably "prettier" syntactical constructs and other toy (read this as "dildo") language features, but it surely is your best option if what you seek is some sort of "improved C". Nevertheless, you should experiment it yourself and devise an opinion from your experience instead of relying on others. A "common noob misconception" is to fall victim of appeals to arguments of authority and gratuitous criticism and con-information given without elaboration.

You know, a lot of sexually inexperienced people comes here to offer advice, but they're really more worried in downloading furry pornography and harassing teenagers in Harry Potter forums instead of properly sustaining a debate or conversation. Don't listen to these people. Look, one of them (>>2) just claimed "fuck Windows" and have thus thrown away 90% of the potential users for your programs. Couldn't be wiser, don't you agree?

In my opinion, if you find yourself hating the language, just abandon it on your own right, and don't waste time going to mail-lists and forums and telling everybody about your woes and how the language is ill-designed. Instead, choose another technology: there are plenty of them around. And if you find yourself loving C++, go on and code straight aheaad: don't waste time overhyping it either. Fueling the already gigantic FUD battle is the worst thing you can do for the community.

Also: don't be afraid of using IDEs when you feel like using them, and going for the command-line when you feel like needing it. Don't stick into cargo cult practices. You'll learn "best practices" from experience and extensive reading, not from Internet posts.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2012-01-11 11:40

>>25
Okay, I reread what >>4 said. The guy is clearly clueless. The standard way in C to achieve what he is talking about is to

a)Use a shit load of function callbacks.

and/or

b)Have the function defintion in the header file followed by a series of undef/define.

Now the only time I've seen structs (structures) used for different types were for device drives. But I don't think that is what this idiot had in mind.

Name: Anonymous 2012-01-11 11:53

>>27
*Okay, I reread what >>4 wrote.*

The cheap coffee hasn't kicked in yet -(.

Name: Anonymous 2012-01-11 11:53

>>26
Lisp is shit. You are a huge faggot.

Name: 5 2012-01-11 11:55

Let's put it another way...

Why should we have to provide arguments for you guys to not use C++? >>4,5 just provides arguments on why it should not be considered `god tier'.

A lot of other languages compile to fast code, have C++'s features and none its shortcomings. Some provide truly powerful abstractions that are absolute headaches to emulate in C++. Many languages also satisfy this and have truly safe typing, some of them are used in industry...

The `feature' of being able to mix C and C++ is a subjective matter, it could be seen in the same lens that mixing HTML and PHP is good. Static and dynamic linking and FFI models have been created for a reason. This may mean that there has been a lack of separation of concerns, and now theres low level and "high level" jizzed all over the place in a 50KLOC app. What if one wants to, or worse, HAS TO (by contract, etc) port to a platform that does not have (complete) C++ compilers but obviously has support for ANSI C? Even a Lisp + C project would have been easier to retrofit, as the C is fine, and the Lisp will need to macro'd to an intermediate form and then compiled from there. How are you going to transform the same sugared up UI "layer" (if its been layered to begin with) source code written in C++, write your own translator parser? on the probably most difficult to parse syntax after PL/I?

People latch onto C++ by peer consensus only. The academic concensus OTOH for C++ is particularly dim, even C hasn't gotten this much scorn.

Name: >>30 2012-01-11 11:59

(and inb4 someone says "what? scorn on C?" at the end of my post, I only mean the baseline popularity (don't hate me because I'm beautiful) scorn of academics with competing languages.)

Name: Anonymous 2012-01-11 12:12

>>29
You haven't read what I wrote, did you.

Yeah.

Just go away.

Name: Anonymous 2012-01-11 12:50

>>19
The guts of the GDI system on Windows are not sane either (DWM is a little better now, from what I've heard), but most people don't interact with them directly so you see fewer complaints.  Someone who does all their GUIs in Qt isn't likely to have much to say about the shortcomings of X, either.

Name: Anonymous 2012-01-11 13:17

>>30

>>4,5 do not provide arguments. They just add opinions disguised as facts. There are good reasons for not using C++, inasmuch as good reasons for positively using it.

If a platform does not have a C++ compiler, well, then don't use C++. What the fuck. This is an external restriction, not a language design problem. What is your point?

And you must be really kidding when talking about mixing Lisp and C, and on mostly about the rest of your post. Write a translator parser? What are you talking about?!

Dude. Chill out. You're overcomplicating the matter. Note, you're talking about portability issues. As it has already been said, portability is always a pain: no tricks, no tools, no silver bullet. From my experience, I've never seen such approach ("translate" a general-programming language source code into another language or another thing) applied for solving problems like these. The simplest solution (and which often yields good results) is to rewrite the unportable parts of the code. No "compiling Lisp to intermediate form", no "translate source code", no hackyish tricks. One is often very conservative when tackling problems like that.

People latch onto C++ because of long-term marketing hype. Just that. This is a well-known fact. However, besides the rage of many cult programmers, this does not promptly illegitimize C++ as a proper language for many tasks. It does bring some doubt over whether C++ is adequate for most tasks, but the wise will readily know that, again, there is no silver bullet: you should choose what is better for you and your task. No news here.

Now, academic consensus usually go towards things like Lisp and APL. Think very well. Are you sure you want to stick with the "academic approval"? FUD is the real by-product of academy in this area.

This is really up to you. Whatever your choice is, just do a good job with it.

Name: Anonymous 2012-01-11 14:37

It's not really any "better" to write C++ for either platform. There are some MSVC++ specific features, and some G++ specific features, but as a general rule of thumb, most tutorials for either will show you code that works with -pedantic. I suppose Windows has it better than Linux in that it has a better choice of compilers, but in reality if you're using anything other than the GNU Compiler Collection, you're doing things wrong. I personally prefer *Nix for programming, if only because the package managers make it easier to install things like up to date versions of various libraries and compilers.

Don't change these.
Name: Email:
Entire Thread Thread List