lets compile a list of less usual things that results in your question not being answered

Pages: 12
What I mean is, I will not help someone find a platform-dependent way to solve a problem. If they're their program needs to create a shortcut, and I for whatever reason need to help them, I would only help them find the platform-independent way of doing it.

I am morally opposed to writing code that only works on one platform no matter what settings/environment is it compiled with.

Also, I personally find an in-game/in-app debugger easier to deal with than using the default console window, even with portable code. I'm morally opposed to using console windows for anything but seeing the output to std::cout, std::clog, and std::err. Anything more is misusing the console in my view.

If you think it's stupid of me not to help someone just because I don't morally support what they're doing, you're implicitly calling a lot of people stupid. I'm not so stubborn that I won't ever help someone do something morally wrong - I tend to make exceptions when society is against me, but for the most part I try to not get involved when I don't approve. Sometimes it's hard not to say "I don't like this and I think you should do this differently" though.
Last edited on
L B wrote:
If they're program needs to create a shortcut, and I for whatever reason need to help them, I would only help them find the platform-independent way of doing it.

But there isn't a platform independent way to create shortcuts. There might be a library that wraps it up, but it's such a trivial thing, there's no point adding extra dependencies to your program to do it. You may as well write it yourself for every platform you plan to support and then have your Makefile or IDE only include the files relevant to each platform, or use the preprocessor for conditional compilation.

I am morally opposed to writing code that only works on one platform no matter what settings/environment is it compiled with.

Ridiculous. Not every program needs to run on multiple platforms. Many programs are specific to one operating system, like a program that modifies system files or files related to another program that is not cross-platform (such as a game). Someone might be writing a program specific to a certain system because they want to learn that system's API. Or maybe they're doing a homework exercise and the program only needs to run on one platform.

Like helios said, writing cross-platform code isn't always trivial, and like I said, it isn't always necessary. If it's non-trivial and unnecessary, why bother? It's just a waste of time.

Also, I personally find an in-game/in-app debugger easier to deal with than using the default console window

If the game isn't fullscreen, then implementing your own console window where one already exists is a total waste of time.

I'm morally opposed to using console windows for anything but seeing the output to std::cout, std::clog, and std::err. Anything more is misusing the console in my view.

Why? The console is a convenient interface for lots of different types of programs. Not to mention that console programs are more flexible for reuse by other programs, because you can redirect their input and output to pipes, sockets, files and even the input and output of other programs. Say you were writing a text editor and you wanted to use sed for regular expression find-and-replace (rather than re-implementing all of sed yourself just to use it in one program). Because sed is a text-only program, it's trivial to pipe the input and output. You could even redirect its input and output to a socket and run it across a network. You can do that with programs that only operate on text, but not with graphical programs. And say someone wants to write a text game. Who are you to say they shouldn't because you think the console should only be used for the things you use it for?

If you think it's stupid of me not to help someone just because I don't morally support what they're doing, you're implicitly calling a lot of people stupid

I said that it was stupid not to help someone because of the specific moral views being discussed. The same doesn't apply to everything you don't morally support. Some things are reasonable. These are not those things. You're coming off narrow-minded.
Last edited on
This moral thing is much the same in artists and musicians circles, a lot of people are stupid also known as snobs, ironicaly everyone was at this 'moraly wrong' stage once.

Snobs make me angry
Last edited on
theres something i wont answer, leaving the line numbers up the side of the code, its too hard to remove em so that i cant run it, not that im ready to check peoples code yet
chrisname wrote:
But there isn't a platform independent way to create shortcuts. There might be a library that wraps it up, but it's such a trivial thing, there's no point adding extra dependencies to your program to do it. You may as well write it yourself for every platform you plan to support and then have your Makefile or IDE only include the files relevant to each platform, or use the preprocessor for conditional compilation.
That's what I meant as being the platform-independent way of doing it. I have a bad habit of aliasing "portable code" as "platform-independent".
chrisname wrote:
Ridiculous. Not every program needs to run on multiple platforms. Many programs are specific to one operating system, like a program that modifies system files or files related to another program that is not cross-platform (such as a game). Someone might be writing a program specific to a certain system because they want to learn that system's API. Or maybe they're doing a homework exercise and the program only needs to run on one platform.

Like helios said, writing cross-platform code isn't always trivial, and like I said, it isn't always necessary. If it's non-trivial and unnecessary, why bother? It's just a waste of time.
Specialty programs are a side-effect of the failure to make various platforms and hardware consistent and compatible. I don't like thinking about them. I have some...radical beliefs that I just backspaced. Can't I make it harder to do something wrong for the benefit of others?
chrisname wrote:
Why? The console is a convenient interface for lots of different types of programs. Not to mention that console programs are more flexible for reuse by other programs, because you can redirect their input and output to pipes, sockets, files and even the input and output of other programs. Say you were writing a text editor and you wanted to use sed for regular expression find-and-replace (rather than re-implementing all of sed yourself just to use it in one program). Because sed is a text-only program, it's trivial to pipe the input and output. You could even redirect its input and output to a socket and run it across a network. You can do that with programs that only operate on text, but not with graphical programs. And say someone wants to write a text game. Who are you to say they shouldn't because you think the console should only be used for the things you use it for?
So, what you're saying is, I should help people color and format their console output and set the character's position on the screen because you can pipe the input and output to things that aren't even a console window. I also don't see how your argument is in any way against my statement...
chrisname wrote:
I said that it was stupid not to help someone because of the specific moral views being discussed. The same doesn't apply to everything you don't morally support. Some things are reasonable. These are not those things. You're coming off narrow-minded.
Where I live, we have freedom of religion. I'm not religious, so I don't in any way involve myself with religious things. I also don't treat anyone differently because of their religion. The same applies here; I don't help someone perform an action that is against my morals, however I won't hesitate to help them for other things just because they are trying to do something I don't agree with. I'll help build the computer, but I won't help program it to launch the nukes. (I'm making the generous assumption that people are inherently good and that enabling them to do evil is not to help them do evil.)
To me, in this context, a narrow-minded person would not help someone with anything because of X. I, however, just won't help that person with X in specific, but I'll help them with Y and Z.
Last edited on
L B wrote:
chrisname wrote:
I said that it was stupid not to help someone because of the specific moral views
being discussed. The same doesn't apply to everything you don't morally support. Some
things are reasonable. These are not those things. You're coming off narrow-minded.

Where I live, we have freedom of religion. I'm not religious, so I don't in any way involve myself with religious things. I also don't treat anyone differently because of their religion. The same applies here; ...

Er, the same does not apply, and it is a logical fallacy to link them.

The first issue is that you are confounding the sense of the word 'moral'. The morality of <insert religion here> upon human society is a profoundly different creature than the so-called 'morality' of using the Windows console or writing platform-dependent code.

You may still choose to not support any attempt to do so, and as chrisname already agreed it is within your true moral agency to do it -- or to not do it, as it were.

There actually are many valid reasons to write platform-specific code. Whether or not you agree does not change that fact. You have actually been treated quite fairly by chrisname: he has not questioned your intelligence nor your integrity, nor your skill nor your character in any way. He has pointed out that the argument you are using here is nonsense.

Just say that you won't do it because you find it objectionable. No one can rightly give you a hard time for that. (And if they do, then you'll find yourself leaving the thread to the same knuckleheads that like to attack me on a fairly regular basis -- as the honest professionals here don't tend to do that without coming back and admitting their error.)

Sorry. :-\
Duoas wrote:
Er, the same does not apply, and it is a logical fallacy to link them.

The first issue is that you are confounding the sense of the word 'moral'. The morality of <insert religion here> upon human society is a profoundly different creature than the so-called 'morality' of using the Windows console or writing platform-dependent code.
I in no way used the word "moral" in the same context as "religion". I was making an analogy.
Duoas wrote:
You have actually been treated quite fairly by chrisname: he has not questioned your intelligence nor your integrity, nor your skill nor your character in any way. He has pointed out that the argument you are using here is nonsense.
I've experienced a consistent theme that my arguments and ideas are nonsense. I only felt the need to clarify.
Duoas wrote:
Just say that you won't do it because you find it objectionable. No one can rightly give you a hard time for that.
I thought that this was my whole argument and point of view?
closed account (z05DSL3A)
...Gangnam Style...
Agreed, I don't respond to those threads either.
closed account (iw0XoG1T)
@Duoas

I once attacked you--I truly feel bad about that--you are a true gentleman.

I looked at my code and noticed that I normally loop through a file this way:

1
2
3
4
5
6
7
8
9
while(true)
{
    std::getline( ifs, buf);
    if ( ifs.eof())
        break;
    if ( ifs.fail())
        throw std::runtime_error( "read run time failure" ) ; 
    //...mess with code
}

someone said they have a problem with while( true ) {} but I have seen it written as example code in some respectable text book, and I have found that it works quite nice.
L B wrote:
I've experienced a consistent theme that my arguments and ideas are nonsense.
I thought that this was my whole argument and point of view?
(emphasis added)

Ah, sorry you feel that way. I don't think your ideas are nonsense -- I disagree with some of them -- but only your argument for them was the problem.

@chwsks
Anyone who gives you a problem with while (true) is a wannabe. You can safely ignore him.

Thanks, BTW.
L B wrote:
That's what I meant as being the platform-independent way of doing it. I have a bad habit of aliasing "portable code" as "platform-independent".

But how do you know the guy asking for help making shortcuts on Windows isn't writing the library that wraps that on multiple platforms? How do you know he hasn't already written the code to do it on Linux? Even if he is making a Windows-only program, why should you care? He may have very good reasons for not supporting other platforms. Maybe Richard Stallman and Linus Torvalds once beat him up and stole his lunch money. Like I said before, maybe he's doing a homework assignment that only needs to support one platform. In that case he would have a deadline, and writing extra code to support other platforms would be a waste of time. Don't forget that not every program can be written at the pace of the author. Programmers often have time and budget constraints as well as priority features that must be implemented, even at the expense of portability.

Specialty programs are a side-effect of the failure to make various platforms and hardware consistent and compatible.

And so everyone should put extra effort into making code run on multiple platforms when they don't need it to run on those platforms? Game developers don't target Linux or BSD or OS X because their target market largely uses Windows, Xbox or PS3. People who produce mods for games don't see the point in targeting any platform other than the ones that the games they're modding run on. There are other types of programs that don't need to be cross-platform too, like the homework assignments I've mentioned three times now, and the program that modifies system files that I've now mentioned twice.

Can't I make it harder to do something wrong for the benefit of others?

I'm not saying you can't, and I'm not even saying you shouldn't, I'm saying that these things are not wrong.

So, what you're saying is, I should help people color and format their console output and set the character's position on the screen because you can pipe the input and output to things that aren't even a console window. I also don't see how your argument is in any way against my statement...

That's not what I said. Did you see the example about text-based games? You must have, since you included it in your quote. If text-based games are a valid use of the console, and text-based games use coloured and formatted output, then using coloured and formatted output is also valid. To believe otherwise, you either have to believe that no-one should make text-based games, or that text-based games should never use coloured or formatted output.

For future reference, any time you start an argument with "so what you're saying is", you're probably about to commit this fallacy: http://en.wikipedia.org/wiki/Straw_man
Last edited on
@chwsks

someone said they have a problem with while( true ) {} but I have seen it written as example code in some respectable text book, and I have found that it works quite nice.


There are situations where infinite loops are OK, and you will find them in respectable textbooks. What I was alluding to was that newbies do it out of sheer laziness or ignorance, in the same way as they use goto, call main etc.

The thing is that it is easy to mess it up - like this example:

http://www.cplusplus.com/forum/beginner/86027/#msg461611


Apart from the FP & algorithm problems, there is trouble with the break, not exiting the infinite loop, which can lead to using goto to fix it ........... :+D

With your code snippet above, I don't think lines 4 & 5 are necessary - checking eof isn't recommended (perhaps unless you are reading 1 char at a time). Lines 6 & 7 are much better, because it checks the fail bit & throws the error, rather than eof & break. I realise you might have written it quickly as an example.

Btw, something thoroughly pedantic - all the infinite loops (used properly) I have seen use for(;;) rather than while (true), especially for C where true is not defined.

There are other situations where infinite loops are OK. The arrangement of a loop is like this (but the order can be rearranged a bit to suit):


BEFORE - Initialisation
Start of loop
MAIN BODY CODE

INCREMENT

END CONDITION
End of loop


Say you have 4 variables, and each of the sections above are complex relationship between the 4. By using an infinite loop, one can code the complex relationships, because one cannot fit the code into the loop conditions normally used - eg. for (initialise; end; increment)

Hopefully this is helpful to someone.
chrisname wrote:
But how do you know the guy asking for help making shortcuts on Windows isn't writing the library that wraps that on multiple platforms? How do you know he hasn't already written the code to do it on Linux? Even if he is making a Windows-only program, why should you care? He may have very good reasons for not supporting other platforms. Maybe Richard Stallman and Linus Torvalds once beat him up and stole his lunch money. Like I said before, maybe he's doing a homework assignment that only needs to support one platform. In that case he would have a deadline, and writing extra code to support other platforms would be a waste of time. Don't forget that not every program can be written at the pace of the author. Programmers often have time and budget constraints as well as priority features that must be implemented, even at the expense of portability.
There are obvious exceptions.
chrisname wrote:
And so everyone should put extra effort into making code run on multiple platforms when they don't need it to run on those platforms? Game developers don't target Linux or BSD or OS X because their target market largely uses Windows, Xbox or PS3. People who produce mods for games don't see the point in targeting any platform other than the ones that the games they're modding run on. There are other types of programs that don't need to be cross-platform too, like the homework assignments I've mentioned three times now, and the program that modifies system files that I've now mentioned twice.
I'm not stopping these people from getting help! I'm just encouraging what I think is right and discouraging what I think is wrong.
chrisname wrote:
I'm not saying you can't, and I'm not even saying you shouldn't, I'm saying that these things are not wrong.
They're not in an ideal world, therefore I consider them wrong. That's LB::wrong, not society::wrong or chrisname::wrong or ::wrong.
chrisname wrote:
That's not what I said. Did you see the example about text-based games? You must have, since you included it in your quote. If text-based games are a valid use of the console, and text-based games use coloured and formatted output, then using coloured and formatted output is also valid. To believe otherwise, you either have to believe that no-one should make text-based games, or that text-based games should never use coloured or formatted output.
Text-based games are wrong in my opinion, therefore I consider your argument invalid.
chrisname wrote:
For future reference, any time you start an argument with "so what you're saying is", you're probably about to commit this fallacy: http://en.wikipedia.org/wiki/Straw_man
I quote:
chrisname wrote:
Not every program need to be cross-platform and not every program needs a GUI.
LB wrote:
I don't help people who want to e.g. color the output of their console.
chrisname wrote:
If someone is making a graphical application with a console for debugging, they might still want coloured output (my RPG uses the console window for debug, info and error messages (all three of which are in different colours (grey, white and red respectively)) as well as for interaction with the game engine (like the console in many games, but since my game isn't fullscreen there's no need to reinvent the wheel, I can just use the normal console)). Even so, not every application needs to have their own GUI (don't forget that the console is really just a GUI displaying text), many wouldn't make sense with a GUI because they only need to process text.
LB wrote:
I personally find an in-game/in-app debugger easier to deal with than using the default console window, even with portable code. I'm morally opposed to using console windows for anything but seeing the output to std::cout, std::clog, and std::err. Anything more is misusing the console in my view.
chrisname wrote:
Why? The console is a convenient interface for lots of different types of programs. Not to mention that console programs are more flexible for reuse by other programs, because you can redirect their input and output to pipes, sockets, files and even the input and output of other programs. Say you were writing a text editor and you wanted to use sed for regular expression find-and-replace (rather than re-implementing all of sed yourself just to use it in one program). Because sed is a text-only program, it's trivial to pipe the input and output. You could even redirect its input and output to a socket and run it across a network. You can do that with programs that only operate on text, but not with graphical programs. And say someone wants to write a text game. Who are you to say they shouldn't because you think the console should only be used for the things you use it for?
LB wrote:
So, what you're saying is, I should help people color and format their console output and set the character's position on the screen because you can pipe the input and output to things that aren't even a console window.
I say I don't support colored console output, you give a use-case, I give my opinion on why I don't like that use-case. I then say that the console should only be used for seeing the output of std::cout, std::clog, and std::cerr, and then you give a nice example of why I made that statement, but you said it as if you were proving me wrong somehow. I then made the ironic "So what you're saying is" statement forgetting that irony doesn't work on the internet. SORRY.
L B wrote:
Text-based games are wrong in my opinion, therefore I consider your argument invalid.

How can a type of game be "wrong"? I mean, if you were talking about video games depicting sex or violence being wrong then I could understand, even though I wouldn't agree, but I can't understand your apparent belief that all text-based games are "wrong". Plenty of people play them; just because you don't, doesn't mean they're "wrong" or bad.
Last edited on
@chrisname: your reading method is bugged http://cplusplus.com/forum/lounge/85957/#msg461444

@LB: ¿what's the difference between coloring one word in the console against coloring it in X?
By instance `grep'
@ne555
Thanks for pointing that out.
Last edited on
Topic archived. No new replies allowed.
Pages: 12