Author |
Message |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Apr 13, 2008 7:53 pm Post maybe stupid Post subject: |
 |
|
|
|
it's pretty much the same, typing-wise.
There was a big discussion among the Great Geeks of this forum about this... one of the 2 is "more efficient", apparently, but since you don't print something 1000 times a second, it doesn't change anything.
It's like the people who say Firefox is the only worthy browser, vs IE users... there are fanboys on each side, but they have no idea how much their fight is worthless... _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sun Apr 13, 2008 7:59 pm Post maybe stupid Post subject: |
 |
|
|
|
Mostly because "real programmers" use C, rather than C++.
I use the term loosely, of course, since the lower level you are, the more "real" you are. Making the people who cast the silicon the real programmers, I guess... _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
k0zy Server Help Squatter

Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Mon Apr 14, 2008 3:56 pm Post maybe stupid Post subject: |
 |
|
|
|
/me waits for MrEkted to comment on the issue
I still remeber the endless discussions about that... ^^
And why MrEkted uses goto. That was fun to read, too. _________________ It's a shark! Oh my god! Unbelievable! |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Apr 14, 2008 5:18 pm Post maybe stupid Post subject: |
 |
|
|
|
I always thought the formatting was pretty flexible with printf... never used cin/cout, though. |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Mon Apr 14, 2008 6:14 pm Post maybe stupid Post subject: |
 |
|
|
|
Anything you can do with one, you can do with the other. There are arguments for efficiency and abstraction on the C++ streams side, but they're fairly trivial things either way.
If you use C++, then you use iostreams. If you use C, then you use fprintf. |
|
Back to top |
|
 |
Animate Dreams Gotta buy them all! (Consumer whore)

Age:37 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Mon Apr 14, 2008 10:04 pm Post maybe stupid Post subject: |
 |
|
|
|
fprintf is file print, right? I think you mean iostream/printf, or fstream/fprintf |
|
Back to top |
|
 |
Doc Flabby Server Help Squatter

Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Tue Apr 15, 2008 6:20 am Post maybe stupid Post subject: |
 |
|
|
|
i find the printf syntax easier to read and understand, but thats just personal preference. _________________ Rediscover online gaming. Get Subspace | STF The future...prehaps |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Apr 15, 2008 8:06 am Post maybe stupid Post subject: |
 |
|
|
|
IOStreams encompass the console and file io, and fprintf(stdout, "x") and printf("x") do the same task. |
|
Back to top |
|
 |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Tue Apr 15, 2008 8:32 pm Post maybe stupid Post subject: |
 |
|
|
|
I just read a topic somewhere else and turns out in the C# you dont use cout or printf but you use their new function Console.WriteLine("Hello World!");
and its closer to printf but i dont get why do they have to keep changing shit?
this is how the input age works in c#
string input;
int age;
Console.WriteLine("Please enter your age");
input = Console.ReadLine();
age = Int32.Parse(myInput);
Console.WriteLine("You entered {0}", age);
now just tell me how gay is first impression of c# is?
also did Ekted have an acount on MGB? I read some stuff on wiki how ekted said that every one is a noob on SS and thats why he quit, or something like that |
|
Back to top |
|
 |
tcsoccerman Server Help Squatter
Age:33 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue Apr 15, 2008 9:35 pm Post maybe stupid Post subject: |
 |
|
|
|
c# owns. |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Tue Apr 15, 2008 9:58 pm Post maybe stupid Post subject: |
 |
|
|
|
the console is only used for debugging purposes most of the time anyway... getting input from it, and especially validating is a pain in the butt, and ugly  |
|
Back to top |
|
 |
Blocks Novice

Joined: Jul 13 2006 Posts: 95 Location: California Offline
|
Posted: Wed Apr 16, 2008 1:52 am Post maybe stupid Post subject: |
 |
|
|
|
Mr Ekted uses goto? I never knew him, but I thought better of him. |
|
Back to top |
|
 |
Doc Flabby Server Help Squatter

Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
 |
Animate Dreams Gotta buy them all! (Consumer whore)

Age:37 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Wed Apr 16, 2008 11:41 am Post maybe stupid Post subject: |
 |
|
|
|
hellzlaker wrote: | I just read a topic somewhere else and turns out in the C# you dont use cout or printf but you use their new function Console.WriteLine("Hello World!");
and its closer to printf but i dont get why do they have to keep changing shit?
this is how the input age works in c#
string input;
int age;
Console.WriteLine("Please enter your age");
input = Console.ReadLine();
age = Int32.Parse(myInput);
Console.WriteLine("You entered {0}", age);
now just tell me how gay is first impression of c# is? |
You can actually do it the Java way too, I think, with concatenating strings. At the very least, you could do:
string output = "You entered" + age;
Console.WriteLine(output);, but you can probably do that inside of the parentheses. It's just whichever way you choose.
There's certainly a place for both. Most people prefer the first method, with the {0}, but... I had a project recently in my C# class where we were given a project, but we were told that we would later have to re-do the project using Windows programming instead of console input/output. So the idea was to code in a way that could be easily converted. Each class was supposed to have a Show() function that would just print all of the information that class was storing to the screen. So instead of having the function use Console.WriteLine(), I just had the function return "Var1: " + var1 + "\nVar2: " + var2; so that, in the main function, you could just Console.WriteLine(class.Show()); That way, when I had to re-do the project, I wouldn't have to change the classes at all.
Well, that was the idea. Instead I'm changing the project so it can work with a database, so I'll probably have to change the classes anyway, but whatever. |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
 |
k0zy Server Help Squatter

Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Wed Apr 16, 2008 2:57 pm Post maybe stupid Post subject: |
 |
|
|
|
Blocks wrote: | Mr Ekted uses goto? I never knew him, but I thought better of him. |
MrEkted is a great programmer.
In his opinion functions should only have one return.
He uses goto to break out of the funtions and jump to the return in case an error occurs.
That's an okay use for goto.
And I think it was him who said that cout actually uses printf internally. |
|
Back to top |
|
 |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Wed Apr 16, 2008 4:04 pm Post maybe stupid Post subject: |
 |
|
|
|
well i guess i got used to C++ so much that all other languages look weird, but PHP, JAVA they kinda feel like C++, and C of course |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed Apr 16, 2008 7:49 pm Post maybe stupid Post subject: |
 |
|
|
|
Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... wrote: | And I think it was him who said that cout actually uses printf internally. |
He did. He was wrong. |
|
Back to top |
|
 |
k0zy Server Help Squatter

Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Thu Apr 17, 2008 2:14 am Post maybe stupid Post subject: |
 |
|
|
|
Did you guys know that Java features a goto like construct? It can be used to break out of nested loops for example.
I just found that out a few weeks ago. |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Apr 17, 2008 7:44 am Post maybe stupid Post subject: |
 |
|
|
|
Yes, and the entire Java library is written without using it. In the Java specification, they say that it's bad practice to use it. I think they only put it in as a concession. |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Thu Apr 17, 2008 8:22 am Post maybe stupid Post subject: |
 |
|
|
|
I actually saw that the other week when I was decompiling a few java class files; it used a couple of goto statements. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
 |
Animate Dreams Gotta buy them all! (Consumer whore)

Age:37 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Sat Apr 19, 2008 8:39 pm Post maybe stupid Post subject: |
 |
|
|
|
D1st0rt wrote: | @Ani: if you put the Show() method body into ToString() you would be able to Console.WriteLine(class); |
elaborate
You mean, within my class definition, define a string ToString() method? |
|
Back to top |
|
 |
Doc Flabby Server Help Squatter

Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
 |
|