Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 212 213 [214] 215 216 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 903497 times)

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3195 on: October 23, 2012, 10:35:23 pm »

My school teaches C++ with Visual Studio 6.0!
And IE 6~7 (mixed)!
And my school teaches C-style code!

I think scanf() and printf() are mainly C functions... though then again printf does have functionality cout could lack.

How am I supposed to use <vector> and <string> a year from now, and how am I going to deal with
if (int i=5;i==5;)
  ; //nothing here, just an empty line and a semicolon.
cout << i;

returning 5? Dx

Is there a good IDE that can be loaded onto a USB and quickly installed and used? Or even better, use directly from the USB after just copying it.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3196 on: October 23, 2012, 11:02:36 pm »

My school teaches C++ with Visual Studio 6.0!
And IE 6~7 (mixed)!
And my school teaches C-style code!

So... Your school is confused?

I think scanf() and printf() are mainly C functions... though then again printf does have functionality cout could lack.

They are from the C Standard Library. Stream objects (including cout) can do everything the C stream functions can do, and more.

How am I supposed to use <vector> and <string> a year from now

Lots of ways! The Standard Template Library, which vectors are a part of, are extremely useful for storing groups of data. They're like arrays, but more powerful. And strings are an absolute necessity. No matter what you're coding, you'll inevitably end up dealing with strings at some point.

and how am I going to deal with
if (int i=5;i==5;)
  ; //nothing here, just an empty line and a semicolon.
cout << i;

returning 5? Dx

Are you sure it's "if(int i=5;i==5;)" and not "for( int i=5; i==5; ; )"?

Is there a good IDE that can be loaded onto a USB and quickly installed and used? Or even better, use directly from the USB after just copying it.

Code::Blocks is my C++ IDE of choice, and it can be installed to a USB drive with relative ease.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3197 on: October 24, 2012, 12:09:39 am »

Yeah, it's for.
And I know how to use STL. Really nice.
But I can't use it in school, because my school uses VS 6.0. I believe that came out almost two decades ago. Before the age of STL.

And my point is that cout/cin are easier than printf/scanf (though printf has a few advantages like formatted output...), my school teaches stdio.h and its C functions.

You know that I know how to use <vector>, don't you? Dx I'm not that bad at programming...
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3198 on: October 24, 2012, 12:44:12 am »

Yeah, it's for.
And I know how to use STL. Really nice.
But I can't use it in school, because my school uses VS 6.0. I believe that came out almost two decades ago. Before the age of STL.

And my point is that cout/cin are easier than printf/scanf (though printf has a few advantages like formatted output...), my school teaches stdio.h and its C functions.

You know that I know how to use <vector>, don't you? Dx I'm not that bad at programming...

First off, I assume nothing.

The formatted output that printf can do can also be done with streams, via stream manipulators.

Back to that code segment, now.

Code: [Select]
for(int i = 5; i == 5;)
    ;
cout << i;

Unfortunately, the behavior of this code depends on the standard being used. Since you're using VS 6.0, your compiler is using the old (non-ISO) standard, which allows variables defined within for-loops to be referenced outside of the for-loop. So, the code initializes i to 5, and runs through the body of the for-loop. There is only a semicolon, which means the body does absolutely nothing, so the condition for the for-loop is checked. Since i == 5, the loop exits, and the value of i is printed to standard output.

If you were using a standards-compliant compiler, you'd get something a bit different:

Code: [Select]
$ g++ -o test test.cpp
test.cpp: In function ‘int main()’:
test.cpp:7:11: error: name lookup of ‘i’ changed for ISO ‘for’ scoping [-fpermissive]
   cout << i << endl;
           ^
test.cpp:7:11: note: (if you use ‘-fpermissive’ G++ will accept your code)

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3199 on: October 24, 2012, 02:24:30 am »

Aaaand that's exactly why I'm in consternation at my school using VS 6.0.
It also lacks STL.

I use VS 2010 at home. :/ Why do you keep repeating things I already know? Dx
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3200 on: October 24, 2012, 08:07:51 am »

I misunderstood, I thought you were asking why that stuff was happening.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3201 on: October 24, 2012, 08:19:45 am »

Bring it up with the people running your department and find out the hell /why/. There are, after all, people who can change it, and might accept a better alternative if provided.

At the very least, I'd love to hear the reasoning.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3202 on: October 24, 2012, 08:36:43 am »

Assuming you're talking to me:

It's a Korean public school. Nothing more needs to be said.


I wish I knew who the Computer teacher is, so I could try and effect Change.
IE 9 is free, and so is Visual Studio 2010 Express, or Code::Blocks, which is equally free :D

However, tendency is for teachers to look down on high school students as immature, and there's a really high wall between teachers and students. :< I once accidentally said "Excuse me" in the wrong way and got lectured for a few minutes. Also, the older teachers are quite conservative. Don't fix it if it ain't broken.

Hmm.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3203 on: October 24, 2012, 09:43:21 am »

Except success at things like that can look awful good on college applications if you can phrase it right. Most good colleges (at least in the states), want students who take initiative and improve things, taking charge of their own education. After all, it makes things easier for them. :P
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3204 on: October 24, 2012, 10:18:59 am »

Well... where wouldthat go on a college app? Dx It's not extracurricular... essay, perhaps?
If this is too off-topic, you could reply via PM. Also, don't colleges want more of a regional level, not a single person? xD

More on-topic note: Not having learned Java, I struggled through the AP Diagnostics Test for an hour and got like one third of them wrong.
Lesson: Java is very different from C++. Go learn it.
I think using Java to Do Stuff would be better than reading the AP book. Then again, the AP book might teach Java.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3205 on: October 24, 2012, 11:22:48 am »

Well... where wouldthat go on a college app? Dx It's not extracurricular... essay, perhaps?
If this is too off-topic, you could reply via PM. Also, don't colleges want more of a regional level, not a single person? xD

More on-topic note: Not having learned Java, I struggled through the AP Diagnostics Test for an hour and got like one third of them wrong.
Lesson: Java is very different from C++. Go learn it.
I think using Java to Do Stuff would be better than reading the AP book. Then again, the AP book might teach Java.

Wait... This is for an AP CompSci class? That's a problem. A HUGE problem. They're supposed to be teaching you Java, not C++. C++ hasn't been the language for AP CompSci for nearly a decade. Make sure their asses get chewed, and read Stargrasper's Java tutorials. They'll help you get started. Any other questions you have, bring them here.

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #3206 on: October 24, 2012, 12:10:45 pm »

And from what I have seen Java is a few years past true relevance for a good chunk of comp sci jobs. C# jobs are way more common, at least in the UK. And I'd argue c# is a better language for learning than Java...

Then again I still argue C(++) knowledge is good for being a better coder in the same way I'd argue knowing mechanics would make you a better driver. It's always good to appreciate and have an understanding of what goes on under the hood. Doing some work 'closer to the machine' in C(++) will help with that understanding.
« Last Edit: October 24, 2012, 12:14:54 pm by MorleyDev »
Logged

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3207 on: October 24, 2012, 12:24:38 pm »

Wait... This is for an AP CompSci class? That's a problem. A HUGE problem. They're supposed to be teaching you Java, not C++. C++ hasn't been the language for AP CompSci for nearly a decade. Make sure their asses get chewed, and read Stargrasper's Java tutorials. They'll help you get started. Any other questions you have, bring them here.

What the hell is wrong with C++? C (basic C) is still more widely used than Java, and the C family languages (C and C++) are more than twice as popular.

Even ignoring that, even if Java WAS the dominant language or the up and coming language - why is it better for learning in? Why should ever teach every class the same language? (Which honestly seems like a bullshit recipe for employment disaster since we'll not ever be switching to a one-language employment environment)

Java may be the most common AP CompSci language, but why the hell should it be the one you have to have? That's stupid. It's the same sort of logic that says Java should never have been used to begin with.
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3208 on: October 24, 2012, 12:56:51 pm »

I think it may have something to do with Java being more pedagogical than say C++. Most courses around here are based upon Java, but later they let you do some of the C family languages too.

Basically, learn the theoretical knowledge in a pedagogical language before moving up to applying them in other languages.
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3209 on: October 24, 2012, 01:13:32 pm »

How exactly is it more pedagogical?

Because it's bundled with better libraries?

Honestly, the level of obscurity it puts up in front of some fundamental concepts, one could even argue the opposite.

If you mean that it reduces it to more of an algorithmic level without having to worry about the details of, say, data structures and shapes and whatnot, there are other languages that are much better at that than Java.

I mean, I can understand why you would teach Java in for introducing programming to Java - it's an acceptable choice. But I don't understand the opinion that it is exclusively the best language to do so for some reason.
Logged
Pages: 1 ... 212 213 [214] 215 216 ... 796