by Untitled · 16y ago · 0 comments
Firstly, "C" is not a difficult language. When you compare it to the difficulty of say elementary calculus, you will notice that the concepts are simple.
Any person who studied computer science and do not know how a pointer works (or how to represent an access an array with a pointer) is grossly incompetent. C does not hide the basic programming concepts behind a nice IDE which you double click to type your portion of code.
I recently had another problem (with one person who was busy with a Masters degree at a fairly prestigious technology university). The project involved having video updates. I wrote a demonstration that performed the computation in a “while(1)” loop (i.e. fetch frame, do processing, display frame). The person was involved in writing a simple GUI program.
I tried to explain to him that he cannot use a “while (1)” loop in the event handler of the button that should start the event. Even drew nice graphs on a board explaining all about the thread of execution and how event handling usually works (e.g. a loop that handles events and call functions).
After 30 minutes of explanation the person came up with a very bright idea. He said that “Maybe we should set a sleep(1000) command in the loop to give the program time to react”. WTF?
I, for one, enjoy languages (and even frameworks) with sensible defaults, so the normal case is handled for you, but that let you override that default behavior or even drop down into a lower level language when needed.
I understand that the utility of C is low when we are talking about web-applications. But the fact is that the concepts should be known. Everyone who writes event-based programs should at least have a rudimentary idea of how it works.
Maybe so, but such folks exist in droves. C isn't hard, but it looks simpler than it is, and this clever disguise catches a lot of people off guard. And even so, there seems to be a practical difference between understanding C and having the discipline to use it correctly in the midst of a real project.
Compared to other programming languages - most of which are significantly more complex than hammers. My 2 and a half year old daughter knows what a hammer is and has an idea of how to use it. I'm proud that she can point and say "C for cat!", but that's about the extent of her knowledge of the C programming language.
Also, yes, C is a fairly simple language, but that doesn't mean that it's necessarily easy to use compared to other languages, that do nice things like GC.
UPDATE: After rereading it... you guys are actually implmenting the button. Although surely you're not implementing the whole mouse stack... so I'm still confused :-)
So the event handler goes into a while(1) loop instead of starting a new thread/process to do the video processing.
That will lock the GUI and make the app unusable.
One thing to note though, the grad student may not be familiar with a model where UI is on a specific thread. I know some of the past systems I used had the rental model (even WPF had it early on), so maybe, giving him the benefit of the doubt... this is what he was thinking about (and assumed you had acquired all the correct locks in your code)?
I'm beginning to suspect that the willful incompetence on their part is maybe just a scheme of many to get others to do the work. Suspected a bit of professionalism from people who are about to graduate with master degrees.