Posted By: Wil | Jan 8th, 2008 @ 10:52 AM
page 2 of 2
Comments: 46 | Views: 7001
Minh
Minh
WOOH! WOOH!
W3bbo wrote:

ScanIAm wrote:Then he really screwed the pooch because he should be able to explain pointers in any language.


Visual Basic.
AddressOf
ScanIAm wrote:


Then he really screwed the pooch because he should be able to explain pointers in any language.

What's worse, Computer Science is barely a science and mostly an art.  What wonderous new science is taking place when you get a CS degree?  Math, mostly, and if you wish to get technical, you can get an EE degree, but the rest of the discussion is implementation of mathmatical theories on data organization.

CS means "I do math & logic on machines", but once you get past the pedantry, you'll realize that CS is a catchall for "I work with computers and I got a degree in it to prove I can understand the fundamentals".


Fixed some of that for you. I agree with your point. In fact, you should be able to explain pointers without referencing any language specifically. If you can't, do you really understand pointers or just an implementation of pointers?

CS is really a catch all, it can be close to CIS (computer information systems) or close to SE. It really depends on what you chose to study. The more web/admin type of classes you take the closer to CIS you get, the more concept based microprocessing, compiler construction, heuristics you take the closer to SE you get. With such a broad spectrum, it's hard to know where someone with CS stands, they could be well knowledge about specific areas but rather ignorant of others. Someone doing compiler construction isn't necessarily going to understand microprocessing or how to administrate a Exchange/SharePoint/Database/Etc server or how to manage a network properly. A good CS grad should be able to rely on their foundation and be able to jump up learning curves in any of the CS related fields. Unfortunately this is often not the case as a lot of people tend to rely solely on being an admin or a programmer or any other specific role.

Personally I think the linguistics of formal languages and heuristics are quite interesting, but I'd rather not get into compiler construction or programming language development.
ScanIAm
ScanIAm
On a scale of 1 to 10, people are stupid.
W3bbo wrote:

ScanIAm wrote: Then he really screwed the pooch because he should be able to explain pointers in any language.


Visual Basic.


Arrays.

ScanIAm
ScanIAm
On a scale of 1 to 10, people are stupid.
Isshou wrote:
Personally I think the linguistics of formal languages and heuristics are quite interesting, but I'd rather not get into compiler construction or programming language development.

Which is why I don't agree with evildictaitor that C++ should be the language used.

Seriously, do web designers need to know anything about memory management?  How about pointers?  Does a DBA really need to know big O notation to get his/her job done?

And, before someone piles on with hundreds of reasons why they need to, remember, that most of them don't, so ipso facto chango, they obviously don't, regardless of your opinion.
Minh
Minh
WOOH! WOOH!
ScanIAm wrote:

W3bbo wrote:
ScanIAm wrote: Then he really screwed the pooch because he should be able to explain pointers in any language.


Visual Basic.


Arrays.



Let's see you do this w/ Arrays! (this is probably bad code, but you get the gist).

public char* GetName(void* chunk)
{
   int type = *((int *) chunk);  // Is this how you de-ref?

   chunk += sizeof(int);

   switch (type)
   {
      case PERSON:
         CPerson* person = chunk;
         return person->Name;
         break;

      case COMPANY:
         CCompany* company = chunk;
         return company->Name;
         break;
   }
}
RichardRudek
RichardRudek
So what do you expect for nothin'... :P
ScanIAm wrote:
Which is why I don't agree with evildictaitor that C++ should be the language used.

Seriously, do web designers need to know anything about memory management?  How about pointers?  Does a DBA really need to know big O notation to get his/her job done?


Ha ha.

I suppose it depends on wether they are the type of people that believe in God or not...  [A]

W3bbo
W3bbo
The Master of Baiters
Minh wrote:
Let's see you do this w/ Arrays! (this is probably bad code, but you get the gist).


Looks like something you'd do with a union.

Try doing those in VB Wink
Well said, Paolo. Although it appears that high-level languages continue to narrow the gap with ever-better performance, and with hardware parallism about to explode, I'm sure will only become more compelling (low-level typically implying destructive updates and tricky pointer gymnastics and high-level the absence)...
vesuvius
vesuvius
Das Glasperlenspiel
evildictaitor wrote:

W3bbo wrote:
This doesn't mean C# is a good replacement though, or a general "case against Java", C# has the same attributes making it bad for teaching Systems engineering.


No. For Computer Science students, C++ (and some C to understand how C++ works) should be the language of choice.

C# and Java are great because they do away with pointers, and thus give the programmer a problem-based rather than implementation based approach to solving problems, but in the real world you need intimate knowledge of how your program will work.

Physics and maths students should learn C# (or Java or Mathematica), because their subjects generally involve turning a problem into an answer. For CS students, optimisation, systems and driver design and more in-depth understanding of how computer work should absolutely nessessitate the learning of a langauge which doesn't have all of the niceties and safeguards that C# and Java have, even it is less easy.

Not even finished reading this thread but I reciprocate.

People are just too scared of pointers though, its the syntax thats abstruse.
vesuvius wrote:

Not even finished reading this thread but I reciprocate.

People are just too scared of pointers though, its the syntax thats abstruse.


Pointers are nice, quick, easy, and flexible (assuming you understand them at all) until you realize that you're returning to 15 year old code that heavily uses void pointers and never well documented what the expected object was or if the expected object was a pointer to the object or a pointer to the pointer of an object. Quite frankly pointers can reduce readability of code drastically.

Now I do like pointers and there are uses for them, I especially like typed pointers and typesafe pointers. However there is a time and place for things, and quite frankly pointers were overused and were used when nothing better was available.
Do you remember the old fashioned arrays, which were pointers to blocks of memory. You're referencing wouldn't be by index like a[i] it would be more like a[i * sizeof(int)], woe to you if you got the type or size wrong as you'd get back or write the wrong data potentially even overwriting someone else's memory.
Or even worse was this method of iterating through an array:
a += 4; // or whatever other hard-coded size of the object

looking at just that is meaningless, you'd have to realize a is a address in memory and that by adding 4 to it you're advancing what is being addressed by 4 bytes to address the next element of the array.

There's many good reasons to prevent direct access to a memory location, especially in managed code where GC is performed that may move your memory around. It's also useful in preventing malicious attemps at abusing pointers to start reading someone else's data.

C# and Java still have pointers, you just don't have direct access to them like you would in other languages. This concept is convoluted further with variations in termanology. Reference, Pointer, Method, Function, etc serve to differenciate but what is often left behind in teaching it is that connection that Method is equivilent to Function and that Reference is a (protected) Pointer. This is what needs to be addressed by education not saying that learning a specific language as the base language for course work makes students ignorant.
vesuvius
vesuvius
Das Glasperlenspiel
Upon further reflection and ratiocination, the world of software has changed. I trained in C++ and became a proselyte simply because I was more productive in C#.

This debate is about languages from the same family, no consideration has been given to the dynamic languages. It is easy to deride C#, but you have functional constructs baked into the mix, expression trees and lambdas. Those sound pretty mathematical to me.

The principal adjective in this discussion is symbiosis. The relationship between managed and unmanaged is a symbiotic one. Because the foundations of one are from the other, the natural and correct assumption is that one should learn C then C#. Academics Always like to know that a 'common ground' within a subject has been covered. That way everyone is 'singing of the same hymn sheet' so to speak.

Creating an Ajaxified, ASP.NET MVC'd, Silverlighted website takes far more that the knowledge of a single language.

This is the battle the educators are having, their singular complaint is, that people know a bit of everything and not enough of any one thing.

At university, reading Mechanical Engineering, we were all baked together for the first two years. Civil, Electrical, Mechanical, Medical, you then specialized in tthe remainder.

Far be it from me to say, this way or the other.
W3bbo
W3bbo
The Master of Baiters
ScanIAm wrote:
Seriously, do web designers need to know anything about memory management? How about pointers?


Web "designers" are those people who play around in Photoshop. If you're refering to web "developers", then yes, they should know about memory management, or at least about writing performant code. High-availability web applications can put a huge strain on the server, especially when run their own application pools.

And especailly if they're writing ISAPI-based applications, where experience with pointers is required.

Web "designers" often don't have any formal qualifications, browse your local Yellow Pages and you'll see dozens of H.S. dropouts "giving it a go" with their cracked copies of Dreamweaver. They're the reason we still have pathetic websites.

ScanIAm wrote:
Does a DBA really need to know big O notation to get his/her job done?


A resounding "yes", a DBA would write Sprocs and deal with different data manipulation algorithms. When you're working with tables with several million rows the difference between O(Log[ n ]) and O(e^n) is very important.

ScanIAm wrote:
And, before someone piles on with hundreds of reasons why they need to, remember, that most of them don't, so ipso facto chango, they obviously don't, regardless of your opinion.


Where "most of them" are in jobs that aren't deserving of the job title. I picture a DBA as the guy in the IBM server-room/datacentre adverts, not as some guy patching Access MDBs for some 30-employee company as a side for his general role as "the office IT guy".
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
ScanIAm wrote:


Seriously, do web designers need to know anything about memory management?  How about pointers?  Does a DBA really need to know big O notation to get his/her job done?


No. I would say that a DBA and a web-designer do not need C++ or knowledge of pointers. But I would say that a computer science graduate should know about pointers.

Your analogy is like saying a physics student who goes on to be an accountant shouldn't be taught dynamical flow, because it's not relevant in his/her final job. How about if s/he becomes a PE teacher?

Computer Science should give a strong introduction to computing in all its forms. Computer Science graduates should have an overview of various systems, an overview of how an operating system works, an overview of a functional language, an object orientated language, they should have maths to a higher standard than A level standard, and they must have a high proficiency in at least one language such as C#, VB, Java etc.

The problem is that pointers are glossed over, and badly taught. In fairness they're not massively easy to learn or use, and it takes real practise to get to know them. It's not something I'd want to be learning while building a real-world for-sale app, and it's definitely something I'd expect a CS grad to be able to do.

It's not that C++ is nessisary, it's just that knowledge of pointers is (as it teaches the graduate about how the system works - that's what degrees are for) and allows them to use them at a later stage when presented with a language such as C++ or C because that's the language their employer uses on their product.
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
PaoloM wrote:

evildictaitor wrote:...or coding for the "real world" (big apps, compilers, OSes, research, games etc).

Actually, for coding "in the real world" , Java and C# are just about perfect, considering that the vast majority of code around is in applications that do not need extreme perf or fancy hardware interfaces.

For each line of Linux or NT kernel, there are hundreds of payroll, accounting, inventory, CMM, custom line of business app, etc etc... and those kind of applications are the main target of powerful and "safe" framework and languages (like Java or .NET/VB/C#)


I apologise, and I shall rephrase.

evildictaitor wrote:...or coding for a significant portion of the "real world" (big apps, compilers, OSes, research, games etc).

If we exclude apps such as web-design, the superficial VB of Office and WScript and the (typically small) apps written in managed code, we're left with the big companies with the multi-thousand lines of commercial app that actively employ CS grads for.

These include (but arn't limited to) Apple, Microsoft, IBM, Sun Systems, and the NSA (and presumably related services).

They also include the open source collaborations Open Office, the GNU/Linux kernel and the GCC compiler collection.

It's worth noting that a C++ programmer can pick up C# in a couple of hours. It takes a C# programmer somewhat more time to understand and use C++ code. (This is a good thing for C#, but not all apps are written in C#)
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
Minh wrote:

W3bbo wrote: 
ScanIAm wrote: Then he really screwed the pooch because he should be able to explain pointers in any language.


Visual Basic.
AddressOf

That's for function pointers only. Tongue Out
Personally I have had to do my share of assembly programming on microcontrollers, buring EPROMs, etc, so I have done some pretty low level stuff.

But, what many people seem to forget is that the problems we need to solve as programmers are becoming more and more complex.  No longer can we spend time counting CPU clock cycles for a particular routine and fiddling with assembly instructions because that would mean we are going to ship our product only in 20+ years from now.

Because of this exponential increase in complexity, the programming languages are becoming more and more abstract.   Yes it is sad that it is turning into a black box affair but that is life.  Even so, the type of problems you can solve with modern languages requires a different type of skill than stepping through assembly instructions.  You can do good as well as bad programming in any language.  Personally I'd like to spend the time figuring out/implementing the best algorithm for a particular problem instead of hunting down obscure memory leaks (thank you very much for that, managed languages)

So, my opinion is that knowing about low-level concepts is good (like pointers etc), but it is not an absolute requirement.  Instead I'd prefer if programmers knew how to write good code in their chosen specialty.  That by itself is quite a lot to master.
Minh
Minh
WOOH! WOOH!
Sven Groot wrote:

Minh wrote:
W3bbo wrote: 
ScanIAm wrote: Then he really screwed the pooch because he should be able to explain pointers in any language.


Visual Basic.
AddressOf

That's for function pointers only.
Doh! It's been a while

I do not think it's Java's fault or C#'s fault or any (specific) language faults. I think the problem lies more in the method of teaching.

I do not agree that CS have to be taught in term of C++ only. Or, that the first language to be learnt have to be C++. The reason is that C++ is too complex and obscured that it easily distract students on the subject of their study. Take 'pointer' as an example. What is a 'pointer'? Of course for all of you who are well versed and have backgrounds in computers and memory can easily answer this questions. But, ask me 10 years ago and I'll answer you something like 'when you have a type with an asterisk beside it' answer. The problem is for beginners is that a type (mostly for beginners this means the 'basic' types) is something that is taken for granted. A type is 'something that must be there and always there from the beginning of time' as-of a keyword. So, if you tried to introduce me into a concept called pointer, I'd just assumed that it's a new type of something that capable to point to a specific type. And that int* and long* are separate types of pointer. As you can see, I had no notion of memory and whatsoever. I did not know that int* and long* actually contains memory address. Even if I've heard of it, I did not understand what 'contains memory address' means.

So you see, explaining concepts of even the simplest purest form of programming like imperative programming, structural programming, objects, methods, are overly complicated by the requirements of using pointers in C++. Trees, Lists, Maps, Queues are also favorite subjects in CS and I do not believe that students have to understand pointers to understand them. It will only distracts them from the subject.

But, I do not want to rule that teaching pointers and C++ is out of the question. They do need to understand it at some point. However, the need to understand these underlaying concepts are more and more deemed unneeded. The computer industries are now beginning to shift towards garbage collections that does not need pointers stuffs. Java, VB.Net and C# are some of those mainstream languages.

I agree with aka, there are a lot of programmers right now, but not so many who understand software architects or designs. And those kind of breed are what we need for the future.

Mu suggestion on the problem, how about if CS teachers stop teaching students how to use 'libraries' and teach CS instead?

BTW, IMO teaching pointers concept are easier to be done using assembly and computer memory concept first, and then you can go to C++ if you wish. AND, I do think 'pointer' is a very vague name and very confusing for beginners.

evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
It's not that I think C++ is per se a great idea. But it is ubiquitously used in industry, and it contains pretty much everything without full blown garbage collection.

Some people here have stated that CS students won't nessisarilly have to program in terms of pointers when they graduate, and I applaud that, but this does not mean that they should not be taught. Pointers are an abstract concept, but are fundamentally the way that a computer "thinks" about a program, even when they are completely abstracted away from the programmer.

Other people have mentioned that pointers are an unwanted and unnessiary abstraction when thinking about trees or lists etc, and I would agree with them. C++ does not need to be the only language taught in university, and I would encourage universities to teach Java, C#, VB, Haskell etc, which do not expose pointers to the programmer for such parts of their course.

Another example is Turing Machines. Turing Machines are entirely unnessisary for pretty much everything since I got my degree, but you don't go to University to learn for a career, you go to learn the subject, and the subject's roots lie partly with Turing Machines.

Computer Science graduates must come out of University with an understanding of how computers work, not just being able to work computers. They should know what a computer is (hardware, digitial electronics), how it works (brief overview of assembly and/or C, pointers) application development (Java, C#, C++ etc), functional languages (Haskell, ML, F# etc) as well as operating systems, which should include both an example of a proprietary Operating system (almost certainly Windows, but possibly Unix) and GNU/Linux (kernel).

The purpose of a CS degree is not to make you proficient at your future career. It is to give you an understanding of how computers work, which will help you program for them in a less direct way. Proficiency at coding comes from years of practise, and a CS degree cannot do that, and attempting to do so will always fail.
DoomBringer
DoomBringer
Doom!
It doesn't matter what language they learn, students need to understand how the machine is working and so on.  C is just close enough to low level that you start learning some understanding of the mapping from high to low.
You guys are absolutely right. And I have no objections. What I don't agree is the premise that the first language you have to learn is C++. Knowing the inner workings and the underlayings of how computer 'think' should be, IMO, be thaught in the intermediete or advance level. But how deep should we go? Do we have to encourage or enforce students to have the same understandings as we do with computer memory? E.g, how function calls works, how local variables works, why function return values? how objects implemented? how object methods implemented, and so on and so on... These are all subjects of CS. And dwelling on those subjects should not be a goal, or else we'll never have enough time.

To my understanding, schools and formal educations only gave us the tools. The tools for us to pursue what interests us the most. It came so unfortunate for us in the old days, because the only tool we have was only punch cards and a cruel programming environment. So, we have to grasp the underlaying concept if we want to be succesful. Not so much, with the condition nowadays. Compiler can be thought of (almost) fool-proof in translating high level code to assembly. Thus diminishing the need for deep knowledge in computer inner workings early in curriculum. Instead, as software gets bloated another problem appears, organizing codes. And that's where design and architecture came to be. So, as CS becomes shallower and shallower on discussing a subject, it became more and more broader as a subject. People who have interests in a particular technology or concept should take a specialization course on that.. where you can learn all you want on that subject only. ANd that brings us back to the main subject, that I do not agree C++ as a first language to introduce. Because of the overly complex nature and its easy to get your children sidetracked with that.
page 2 of 2
Comments: 46 | Views: 7001
Microsoft Communities