Really stuck in a rut...

Pages: 12
While I have been learning java in leaps and bounds since finishing the semester in Dec, I seem to really be struggling with C++. In java I haven't really learned any new concepts or anything but have developed into understanding and using collections, swing, and javafx.(and really there's still soooooo much more to go in terms of learning new classes in java)
In C++ I have learned.... hmmm nothing really I mostly have learned what not to do when it comes to bad practices, but as far as learning more of the language really all I can advance into is pointers. I understand the idea behind pointers and reference, de-reference operators etc. But I'm having trouble understanding why you need to use them, or more specifically I can't think of examples for myself to try.

I have been barred from learning STL, only allowed to use the STD, due to backwards compatability with C.

So I can learn about structs but I have avoided it due to not knowing the difference between C and C++ structs and even if we're going there. I guess I could learn poloymorphism, but then how much polymorphism is there in C ?

I don't know, I'm having real trouble understanding the logic my teacher uses, why ban us from using certain things, I enrolled to learn object oriented programming, java/c++ yet I'm being taught by a relic who is only teaching us certain things but not others. I really don't understand the restriction when we could just go away at the end of the course and learn C for ourselves if we wanted to.

cry :(
It sounds to me like you're either a) being taught C, b) being taught C++ by someone who only knows C (not necessarily their fault), or c) being taught C++ by someone who learnt it in the 80s.

The STL is part of the standard library, by the way. Being "only" allowed to use "the STD" is not a restriction at all.
Yea well because I don't really know C, well I probably do but haven't looked at it. I just feel more confused than anything. I mean there's no string, no classes in C so the restriction on STL just doesn't seem justified, I guess I will find out in a few weeks anyway, but In the meantime I feel like I've just been bashing my head against a wall for the last 2 months in regard to C++.

Yea my teacher is brilliant so I've been told by many many people. He grew up coding punch-cards however literally, he was a teacher back when punch-cards were the only way to write code, and the students had to book the computer a week in advance, show up on time place all their cards through the computer and if they had a compile error then they had to go back, redo it and then rebook the computer for another week. So everything had to be precise and exact.

But yea he was definitely an 80's coder, well maybe 70's... Loves Unix everything, and will only swear by VI and the 'sh' prompt. not VIM or 'bash', vim is evil because some unix servers(relics) don't have vim only VI and same deal with bash.

I'm annoyed but I guess I have no choice but to trust his judgment, however difficult it makes my learning experience. I would have thought learning programming was hard enough to begin with...

why don't you think it's a restriction ? I mean just about every code sample I have posted has been followed by a "Why aren't you using Vectors and templates???"...
Last edited on
closed account (z05DSL3A)
I have been barred from learning STL, only allowed to use the STD, due to backwards compatability with C.

Are you talking out the C++ standard library or the C standard library? Has he just asked you not to use STL or has he said don't use classes?
No the thing I don't get is we have been using std::string, classes etc, things that aren't in C.
But he has turned around and asked us not to learn any STL with his reasoning being he is teaching us only the basics of C++ so we can be backward compatible with C. To me this makes no sense, I know C has cstring and workarounds, but AFAIK no classes...

So everything in std C++ is fine just no STL.
Last edited on
Ew, C backwards compatibility. I respect the idea of programming code that can be used in both, but in general, shouldn't that be an afterthought once a program has been created, and not a plan to build by?
I'd say that you should just learn it anyway. Maybe not use it in class but learn it to be sure. And why is your teacher forbidding C++ code anyway? Ask him, see what he actually thinks. Maybe he'll bring up a good reason I'm not thinking of.
Anyway, it's too bad that you have these limitations. Templates are so cool.
AFAIC, vector and those other "not allowed" classes are in the std namespace. As for "being backward compatible" that's stupid IMO, since C++ is suited for basically everything C is (and more). There is almost no reason to use C when you can use C++

http://www2.research.att.com/~bs/bs_faq.html#C-is-better
Ok good to know I'm not whinging for nothing :P

I'm pretty sure we learn QT this semester too, I don't get how that's going to be useful without templates. Most of the QT tutorial was using templates i checked it out a few weeks ago, so fun fun fun.... sigh*

I think I'm just going to have to learn STL anyway behind his back, at the least so the QT examples make sense.
Last edited on
I'm pretty sure we learn QT this semester too
Uh-huh. So you're being taught to write code that compiles in C, while using std::string and classes and a C++ library. Yeah, that makes perfect sense.

There is almost no reason to use C when you can use C++
What about writing libraries usable by any compiler? Name mangling et cetera.
What about writing libraries usable by any compiler? Name mangling et cetera.


That's why I said almost. There are situations where you would want to use C.
closed account (z05DSL3A)
So everything in std C++ is fine just no STL.

I can understand not using STL, it means that you will have to do more work and therefore learn more rather than glueing bits together.

The whole backwards compatibility thing sounds like someone has got the wrong end of the stick.
Uh-huh. So you're being taught to write code that compiles in C, while using std::string and classes and a C++ library. Yeah, that makes perfect sense.


non-standard library at that but.... Duh, it works on Linux!

Anyway, nite nite.... 3am zZZzzZz
Last edited on
Hmm... maybe this guy should go back to his punched cards and machine code; this doesn't make sense.

I stand by my decision to teach myself.
chrisname+1
selfteach is the most fun way.
The internet is the best teacher.
And Google is the key to that internet! (Right?)
What, you want me to say the WWW? 'Cause that's not strictly correct. I could get information off of IRC, or through FTP. Those have nothing to do with the WWW.
Don't we mean interweb?
Wow, we've gone off the topic of gcampton's c backwards compatibility thing... it appears to be my fault.
Last edited on
closed account (z05DSL3A)
but the internet doesn't teach anything...
Well that would mean this site teaches nothing and that would be a contradiction...
Pages: 12