Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Learning C++...
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  NTFS to FAT32 converter? Post :: Post Administrative Control Panel  View next topic  
Author Message
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 31, 2006 7:32 am    Post subject: Reply to topic Reply with quote

SamHughes wrote:
Ekted, why do you hate iostreams?


I don't hate iostreams. I hate any beginner C/C++ instruction that uses ANY sort of encapsulation. The most important things to learn on day 1 are the fundamental concepts of code, data, heap, stack, memory, interpretation, etc. Giving a brand new user crap like:

String s = "Hello world."

or:

cout << "My name is: " << name;

These are doing too much without explaining what is going on. There are those who feel that you should hit the ground running. I say this is how you create a programmer with no clue (ie 95% of programmers). If I taught an intro programming class at a college, the first month would be no coding at all. Create a class full of people who can debug--who understand how things are laid out--who, when they learn coding syntax, can understand what is happening underneath.

This is also the flaw of teaching Java to beginners. There IS no underneath. You learn that you can do things any way you want, and that you don't even have to care about data types and heap, because the Java system does all that for you. If you choose one way of implementation over another, you have no basis for knowing if it's 10x more complex. Java is all "magic" underneath. That's like saying, "Let's not try to understand the Universe; that's God's job." This is a bullshit attitude, and one that programmers should not have ever.
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Wed May 31, 2006 8:50 am    Post subject: Reply to topic Reply with quote

Im not saying youre wrong, or that I even disagree. I think you are being a bit of a purist though.

There are lots of 'programmers' out there who dont know (or care) what the runtime stack is, or why using ++var can be more efficient than var++, but thanks to the tools written by code nazis like yourself, they can write useful software just the same. The downside though, is it also allows for tardos like quan to write malicious piles of shit for a few girl-like giggles.

I guess the learning path can be looked at two ways. Learning to program with a high level language like VB or Java is certainly easy, but it will probably take longer to completely understand whats going on, while learning the low level stuff is harder, but once thats finished, learning the high level structures is nothing more than a translation.


blah, blah, blah... Im tired, and I dont feel like proofreading this stupid post.
_________________
There are 7 user(s) ignoring me right now.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 31, 2006 9:00 am    Post subject: Reply to topic Reply with quote

Cerium wrote:
Learning to program with a high level language like VB or Java is certainly easy, but it will probably take longer to completely understand whats going on...


The point is that if you learn VB or Java or C++ (using iostreams) as your first foray into programming then you will NEVER understand what is going on. You will happily and blindly write mediocre code. When it doesn't work right (or crashes, etc) you will be helpless. You will seek out someone (like me) who will laugh at you. Writing code in VB or Java is like asking someone how to make a hamburger, and them answering, "I go to McDonald's."
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:30
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed May 31, 2006 11:58 am    Post subject: Reply to topic Reply with quote

Ekted wrote:
The point is that if you learn VB or Java or C++ (using iostreams) as your first foray into programming then you will NEVER understand what is going on.


Not true. I started with VB. (Don't worry, I already attempted suicide.) I moved on to C++ with iostreams and... MFC. (Don't worry, I attempted suicide again.) And now I use the standard non-iostream i/o stuff and native Win32 API. It's not a one-way path.

Now, although it would be nice if all programmers knew how ASM works before they know how their high-level language works, I think it just makes it harder. Requiring that is like saying you have to understand quantum mechanics before you can learn standard mechanics. Which is easier for the beginner physics student to learn? Standard mechanics, of course, but I'd like to see the physics course that doesn't go on to teach them quantum.

Likewise, I think an introductory CS course should introduce students to CS with the easy programming, so they get a general idea of what goes on, and then later in the same course they should be taught what's happening behind-the-scenes.

Lol.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 31, 2006 1:55 pm    Post subject: Reply to topic Reply with quote

Funny link. icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Wed May 31, 2006 4:53 pm    Post subject: Reply to topic Reply with quote

Ekted, that ability to debug libraries/programs the user didnt write is generally what weeds out the programmers from the script kiddies (or whatever the hell you want to call them). As long as they recognize and understand their own faults and dont try to claim to be something theyre not, I dont see where the problem is.

People like them make people like you worth that much more money.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 31, 2006 11:09 pm    Post subject: Reply to topic Reply with quote

Cerium wrote:
People like them make people like you worth that much more money.


LOL! But I'd rather have more peers than more money. Knowing that you have to do something all by yourself if you want it to work, when there are 20 other unqualified people around you, sucks. Or knowing that everything they write you are going to have to rewrite.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:32
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Thu Jun 01, 2006 12:14 am    Post subject: Reply to topic Reply with quote

Ekted, as a programmer, do you understand every part of the computer?

Things involved in printing a message to the screen (not comprehensive, just off the top of my head):

assembly
the cpu pipeline
the operating system
the complete x86 architecture
the graphics system
the monitor timing parameters
register transfers
register design from descrete logic gates
boolean logic and gate level circuit design
transistors that make up the gates
the semicondutor physics that determine the operation of the transistors
the electromagnetic physics that underlays all electronics
the grand unified theory of everything

And thats just local to the computer. Imagine how complex it gets with networking.

My point is that no matter what, you can't know everything, and when it comes right down to it, you don't need to. Encapsulation is always there, and I think it's better to use it early. I don't need to know how the magnetic particles are arranged on the disk platters to write a program that reads a config file. Things are always going on behind the scenes, and thats not a bad thing. You are a big advocate of not sharing code, which is encapsulation at an extreme.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Thu Jun 01, 2006 8:34 am    Post subject: Reply to topic Reply with quote

You are right. But I believe there is an objective set of knowledge that any programmer should know. That includes:

C (or any other language that translates roughly to ASM)
basic assembly
the operating system API you are using
general x86 architecture (or whatever machine you are on)
organization of code/data/heap/stack in a process
physical/logical data structures
binary/hex, boolean login

And possibly some of what I call Information Theory, although the term is generally used to mean something else. I use it to mean data organization, efficiency, redundancy, and integrity. I suppose it overlaps quite a bit with database concepts, but is not restricted to them.

I have nothing against Java (et al) as a language, per se. It is fantastic for teaching OO concepts and getting something up and running quickly. I am just against using it as a starting point for beginners. It makes you a lazy programmer. Of course, lazy programmers do stupid things in C as well...
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:32
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Thu Jun 01, 2006 12:07 pm    Post subject: Reply to topic Reply with quote

I would agree that that list is indeed helpful to know, but it isn't necessary to program perfectly acceptable applications. A programmer can learn them as needed rather than requiring them beforehand.

There are two reasons that I think Java is a good starting point:
  • I feel that OO design is really important and that the sooner it's learned, the better. Java helps by enforcing parts of OO, and while idiots can still mess it up, most get the idea.
  • Java provides a simple API for creating GUIs, meaning that the programmer can start learning a major part of modern programming early.


The original issue was iostreams doing things behind your back. I would agree that it does these things, but the source is there for anyone that wants to know. As a programmer, I don't care how something works as long as it does in fact work (as a person I do, but that's just curiosity). I also do not believe that learning iostreams first has any impact on learning a printf variant later.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Thu Jun 01, 2006 2:42 pm    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:


These are doing too much without explaining what is going on. There are those who feel that you should hit the ground running. I say this is how you create a programmer with no clue (ie 95% of programmers). If I taught an intro programming class at a college, the first month would be no coding at all. Create a class full of people who can debug--who understand how things are laid out--who, when they learn coding syntax, can understand what is happening underneath.



I would genuinly pay alot of to go to attend class like that. Trying to find a decent c++ course is next to impossible, i think because of the few people acctually can code in c or c++ well, even less want to be paid the mediocre wage to teach it...when they can earn far far more in the marketplace.

Mr Ekted wrote:


This is also the flaw of teaching Java to beginners. There IS no underneath. You learn that you can do things any way you want, and that you don't even have to care about data types and heap, because the Java system does all that for you. If you choose one way of implementation over another, you have no basis for knowing if it's 10x more complex. Java is all "magic" underneath. That's like saying, "Let's not try to understand the Universe; that's God's job." This is a bullshit attitude, and one that programmers should not have ever.


Stangly vb6 (not .net) brings you closer to the operating system on windows than java or c# and many many people say vb developers are newbs, my best vb achievement (so far) was converting a (very poorly coded even by vb standards) ftp client so it was truly multithreaded on vb6 (its easier on vb5). And before people say its impossible to multithread in vb it isnt tongue.gif

But as i started to learn about COM etc etc i started to realise how little i acctually knew about how windows works...If i had coded in java or c#/vb.net i wouldnt even be aware of this...
Back to top
View users profile Send private message Add User to Ignore List
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Thu Jun 01, 2006 10:53 pm    Post subject: Reply to topic Reply with quote

Why would anyone say anything about threadding not being possible in VB? They raved about the possiblity of threading when the 'addressof' keyword was added in VB5.
Not to mention, there were also other objects and .ocx utilities which could provide similar behavior.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Fri Jun 02, 2006 10:01 am    Post subject: Reply to topic Reply with quote

As long as you can call the Windows API--which you can in VB--you can do anything.
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:19
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Fri Jun 02, 2006 10:58 am    Post subject: Reply to topic Reply with quote

the windows API sucks. ok I said it
Write((HANDLE)FD_STDOUT, (LPSTR)"hello world", (DWORD)11, 0, 0, CHARSET_ASCII, NULL, 0, 0, 0, WINNT_32, NULL, (SecurityContext*)NULL, 0, 0, DO_NOTHING_ON_ERROR, NULL, 0, 0, 0);

98% of the time it's not STL or wrappers or even C++ causing a program to run like crap (not even if it's an STL wrapper written in C++), it's poor design or a poor use of whatever tools you chose to use. As you said before, lazy programmers do stupid things in C, even though you can't pass objects on the stack like in C++. A programmer who knows the concepts you mentioned isn't going to fall into obvious traps with C++ or Java, but he may increase speed of development while decreasing bugs. I'd pick STL's linked list class over a C equivalent any day; the effect on performance is negligable and I'll never forget the free the memory.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Fri Jun 02, 2006 12:43 pm    Post subject: Reply to topic Reply with quote

Bak wrote:
...even though you can't pass objects on the stack like in C++...


This is one of the most horrible things about C++. Not that you CAN, but just that people who can, WILL.

Code: Show/Hide
String Function (String s)
{
String ret;

// do something

return (ret);
}


Do you know how incredibly stupid this type of code is? Do you know how incredibly inefficient is it?

Calling the funciton creates a new copy of the string (alloc). Another string is created on the stack and manipulated (alloc). When it is returned by the function, yet another copy has to be made so that the stack can be cleaned up (alloc). And then when the assignment is made with the functions return value, if the new string is longer than the old one, another alloc occurs. Using wrappers like this because you are lazy is stupid!
Back to top
View users profile Send private message Add User to Ignore List
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 249
Location: Greenwich
Offline

PostPosted: Fri Jun 02, 2006 7:40 pm    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
The point is that if you learn VB or Java or C++ (using iostreams) as your first foray into programming then you will NEVER understand what is going on.


Why do you make blatantly incorrect statements like this?
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Fri Jun 02, 2006 11:35 pm    Post subject: Reply to topic Reply with quote

SamHughes wrote:
Why do you make blatantly incorrect statements like this?


Explain to me then, for example, how you would learn about what kind of memory allocation Java does when you do: int i = 1;
Back to top
View users profile Send private message Add User to Ignore List
Cerium
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Sat Jun 03, 2006 12:34 am    Post subject: Reply to topic Reply with quote

First, the JVM allocates 15mb of memory, then, the value 1 is stored in 16 random bytes (for encryption!).

When your program reads the data stored in i, the JVM detonates 18 tons of C4 located near the core of the planet, killing all humanity.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:31
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sat Jun 03, 2006 2:15 am    Post subject: Reply to topic Reply with quote

Dude, I gotta learn Java then.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:32
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jun 03, 2006 8:31 am    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
[..]



Explain to me then, for example, how you would learn about what kind of memory allocation Java does when you do: int i = 1;


Explain why you need to know. It's useless info unless you're a JVM programmer.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:30
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Jun 03, 2006 9:50 am    Post subject: Reply to topic Reply with quote

It's like global warming. Humans basically had no clue what they were doing for ages, and now it's all come crashing down. Now I know the same sort of thing isn't going to happen in computer programming, but it's the principle.

I can totally sympathize with Ekted (as I'm sure you all know). How many of you find the absolutely cheapest place to buy gasoline around you, even if the difference is a couple cents? I do, despite the fact that I'll gladly spend 6871 cents on a new CPU. It's all about the value of things. Using huge amounts of resources is fine as long as I'm benefiting it. Using huge amouts of resources on, say, a string parsing routine is crap.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Jun 03, 2006 9:52 am    Post subject: Reply to topic Reply with quote

Dr Brain wrote:
Explain why you need to know.


Thank you for proving my point.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:32
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jun 03, 2006 10:03 am    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
[..]



Thank you for proving my point.


In Java, there is no user accessable memory, so it does a programmer 0 good to know the internals of the JVM. Doesn't even help for debugging.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 249
Location: Greenwich
Offline

PostPosted: Sat Jun 03, 2006 10:37 am    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
Explain to me then, for example, how you would learn about what kind of memory allocation Java does when you do: int i = 1;


You could either learn assembly language later on, or you could just use a little bit of logic on what type of datastructure you would use to represent the stack of procedure calls and their variables, if you were writing an implementation or compiler of Java.
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Jun 03, 2006 3:19 pm    Post subject: Reply to topic Reply with quote

SamHughes wrote:
You could either learn assembly language later on...


Exactly. Learning Java doesn't get you 1 inch down the road to fundamental knowledge. So you will always have to "start from scratch" if you will even EVER try after learning to write cheap and dirty apps.
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 74 page(s) served in previous 5 minutes.

phpBB Created this page in 0.113975 seconds : 49 queries executed (41.9%): GZIP compression disabled