tef posted:object orientation Your logic there makes sense, and does pinpoint what I mean. The book I got even says it's good for people just starting out. However, it goes from Hello World, like I mentioned, to having you use all these functions that were not explained at all, all while designing programs themselves that are trying to do more complicated things instead of just explaining each element one at a time. It makes me feel stupid, but it might just be that they're poor writers. I might try to backtrack and go really slowly, but at least I have an actual class to go by for C++.
|
|
# ? May 23, 2011 15:53 |
|
|
# ? May 16, 2024 03:55 |
|
nielsm posted:Already covered earlier: Both of these necessities of C are considered features rather than bugs by a fairly large number of people, and incidentally you can get Pretty Freakin' Far through flow control and whatnot before you run into the former issue
|
# ? May 23, 2011 18:42 |
|
Otto Skorzeny posted:Both of these necessities of C are considered features rather than bugs by a fairly large number of people, and incidentally you can get Pretty Freakin' Far through flow control and whatnot before you run into the former issue
|
# ? May 23, 2011 18:45 |
|
I think one should start with assembly. Thinking of the computer as a scriptable physical machine helps a lot of people who aren't abstract thinkers by default, and every programmer should know it anyway. It makes stuff such as pointers, stack vs. heap really basic and straightforward. Of all the classes I took in college, the assembly ones were some of the most illuminating.
|
# ? May 23, 2011 18:48 |
|
Feature rather than bug for a first language is what I meant there. There has historically been a large school of thought that a programmer should be cognizant of the fact his program is running on finite hardware from day zero (recall many CS programs started out as outgrowths of electrical engineering departments)
|
# ? May 23, 2011 18:48 |
|
It's also not the mass of cognitive overhead it's often claimed to be though. It could be better, and it would be great to have a C that just assumed the outer scope was main. The nice thing about C for teaching is that you can do a lot once you're over that hump without worrying about a lot of other complexities. I'd much rather explain for (init; condition; increment) than for var in xrange(start, end, step):.
|
# ? May 23, 2011 19:59 |
|
Smugdog Millionaire posted:I think one should start with assembly. Thinking of the computer as a scriptable physical machine helps a lot of people who aren't abstract thinkers by default, and every programmer should know it anyway. It makes stuff such as pointers, stack vs. heap really basic and straightforward. I have to disagree with this. Bluntly, ASM is not relevant for general programming on the desktop in a modern OS and would do more harm than good. Less bluntly, plonking a novice in front of ASM is more likely to scare them than give them insight. It's also going to piss them off (because it takes a seemingly huge amount of effort to get a simple program running, never mind a GUI application) and is going to implant some ideas which, for other languages, are really bad habits (goto, labels, etc) and will have to be beaten out of them later. Many of the concepts they'd learn about they might never need again - if you're writing C# code why on earth would you be thinking about the instruction pointer and processor registers? If a particular individual wants to learn more about the underlying mechanics or get into embedded systems then ASM is a great choice, but for introductory stuff C is as low level as you should ever need to go.
|
# ? May 23, 2011 20:15 |
|
rolleyes posted:ASM is not relevant for general programming on the desktop in a modern OS and would do more harm than good. The purpose of teaching assembly first is not to give students a full four years of programming in the one language they can take to job interviews. rolleyes posted:Many of the concepts they'd learn about they might never need again - if you're writing C# code why on earth would you be thinking about the instruction pointer and processor registers? rolleyes posted:If a particular individual wants to learn more about the underlying mechanics or get into embedded systems then ASM is a great choice, but for introductory stuff C is as low level as you should ever need to go. Any good programmer will want to learn more about the underlying mechanics. We can help them along by starting with the most basic and progressing to more abstract stuff from there. If you're worried about bad habits, have C.S. students take a Lisp and Prolog classes right afterwards or maybe simultaneously.
|
# ? May 23, 2011 21:11 |
|
Would agree that C is a bad starter language. It was the 'first' language I formally learned, as in taught from the ground up by a professor. I had taught myself Pascal and Basic (And Apple Basic! And Atari Basic!) before that so I had a handle on a lot of structures. However the entire makefile process was incredibly unintuitive, and requires you to not only understand the code you're writing (which you probably should), but also now anything you link in that you 'need' (curses.h how I hated you). I didn't 'get' a lot of functional/structural programming logic until I took a Miranda course later, which actually probably isn't too bad of an intro language. I think ASM is about as useful to learn today as punch cards would have been in the 90s (for general purpose programming as opposed to say, embedded processor systems). Yes, simplify the thinking and teach a real appreciation of the granular nature of programming. And then never use it again.
|
# ? May 23, 2011 21:39 |
|
Scaramouche posted:Would agree that C is a bad starter language ... the entire makefile process was incredibly unintuitive, and Yeah it's really easy to make a lovely course with C My first course started in C and they gave us all the boilerplate and started with updating small functions. Well, we "started" with Karel the Robot and moved to C afterwards, but it's not too hard to have an Intro class use C without all those stupid headaches your course was fraught with.
|
# ? May 23, 2011 21:46 |
|
Python is the best teaching language. FACTS. Just kidding...sort of. I've slowly been teaching my completely non-technical wife Python and she's really enjoying it.
|
# ? May 23, 2011 22:04 |
|
Smugdog Millionaire posted:-y stuff Let me try phrasing this differently. ASM is a fine language to learn about the underlying architecture, I just don't think it's the right thing to be diving straight into. To me Prolog falls under the same "not the right thing" heading but for a different reason: generally, people either intuitively get recursion or they have to work really hard to get their head around it. If you start with Prolog you risk alienating 50% of your intake in the first 2 weeks as they're sat there struggling with wrapping their minds around the logic and wondering what the hell they've got themselves into. Here comes the car analogy: Starting with ASM is like teaching someone to drive by building a car. Sure, they'll learn all sorts of things about spark plugs and alternators but, while it'll probably come in handy one day, none of it's strictly necessary to the actual task of driving. I've always found that the style of learning which works best for me is to deconstruct things so maybe it's why I'm so against starting from the absolute bottom up.
|
# ? May 23, 2011 22:25 |
|
I just started learning C today and it seems like the hardest part of the language is finding a compiler for Windows that isn't Visual Studio or bundled up inside a metric tonne of Unixy stuff.
|
# ? May 24, 2011 00:07 |
qntm posted:I just started learning C today and it seems like the hardest part of the language is finding a compiler for Windows that isn't Visual Studio or bundled up inside a metric tonne of Unixy stuff. Grab the Windows SDK from MS, it includes their C/C++ compiler, C# compiler and other build tools, but not Visual Studio. It also includes the MSBuild environment needed to build VC++ 2010 projects, without VC2010.
|
|
# ? May 24, 2011 00:18 |
|
nielsm posted:Grab the Windows SDK from MS, it includes their C/C++ compiler, C# compiler and other build tools, but not Visual Studio. It also includes the MSBuild environment needed to build VC++ 2010 projects, without VC2010. Thanks for this. I was actually speaking rhetorically, I am using tcc by known crazy person Fabrice Ballard. I have no idea whether this compiler has bizarre quirks or lacks performance optimisations but it compiles "Hello world" without issue so it's working for me so far.
|
# ? May 24, 2011 00:56 |
|
Look at the old Borland compilers and DJGCC/DJGPP too I guess, nb. your constraints are kinda weird (I feel the x/y problem might be lurking beneath the surface here but meh)
|
# ? May 24, 2011 04:47 |
|
Smugdog Millionaire posted:I think one should start with assembly. Thinking of the computer as a scriptable physical machine helps a lot of people who aren't abstract thinkers by default, and every programmer should know it anyway. It makes stuff such as pointers, stack vs. heap really basic and straightforward. Beyond the objections other people have had, getting to the raw unabstracted physical machine is more or less impossible these days apart from certain embedded systems. Telling a neophyte programmer otherwise is going to screw with them when they're trying to wrap their heads around what's really happening at that level. If they're developing in user mode the flat memory model and noncooperative multitasking mean what the student sees has nothing to do with the physical hardware. As far as the OS is concerned, a C or ASM program is just like some garbage collected VM that segfaults a lot. Going below that, any CISC processor and especially something like a modern x86 is pretty much a virtual instruction set with a dedicated hardware interpreter. The ISA is just a convenient lie which has more or less identical external behavior on several different microarchitectures. Sure we can say that the processor fetches the instruction at the PC from memory, decodes it and then actually does something like move the value from EAX to EBX. Really it decodes the instructions en masse and sticks them in a reorder buffer from which it executes up to half a dozen operations in any order from that buffer at once using its 100+ real registers. That MOV just changes some physical register file pointers in the reorder buffer.* Since everything we do is on top of some stack of abstractions, any student who's going to become a competent programmer needs to get used to get used to that stack, pronto. People who can't handle abstractions won't get programming beyond the most trivial toy programs until they can. So we start at a level of abstraction that lets them do useful things and then work our way both up and down from there. *On microarchitectures where the PRF and ROB are separate. Ones where they're the same thing do it completely differently.
|
# ? May 24, 2011 06:48 |
|
Was it this thread where someone linked that paper by that guy arguing against taking the von Neumann model for granted?
|
# ? May 24, 2011 08:40 |
|
Gonna assume you mean backus' turing lecture: Can programming be liberated from the von Neumann style? citeseer pdf link
|
# ? May 24, 2011 11:18 |
|
Which simply asserts that Von Neumann style is bad because beta-reduction is simpler than state transitions or something.
|
# ? May 24, 2011 11:35 |
|
1337JiveTurkey posted:Since everything we do is on top of some stack of abstractions, any student who's going to become a competent programmer needs to get used to get used to that stack, pronto. People who can't handle abstractions won't get programming beyond the most trivial toy programs until they can. So we start at a level of abstraction that lets them do useful things and then work our way both up and down from there. Is that how you were taught mathematics? Just jump into the basics of some middling-abstract stuff? Because if you're ever going to be a competent mathematician, you're going to have to get used to a stack of abstractions pronto. Of course not. You learned that if you have one apple and add two apples, you now have three apples. Assembly is the same level of simple concreteness (move the value at X memory location to register Y, add registers Y and Z and put the sum back into Y, etc.) even if it's just another level of abstraction on top of your Intel.
|
# ? May 24, 2011 15:34 |
|
Smugdog Millionaire posted:Is that how you were taught mathematics? Just jump into the basics of some middling-abstract stuff? Because if you're ever going to be a competent mathematician, you're going to have to get used to a stack of abstractions pronto. I don't know if you have a formal education in mathematics but if you don't you would probably be astounded to learn just how far up the stack you have to go from the basic axioms of set theory before you reach "if you have one apple and add two apples, you now have three apples".
|
# ? May 24, 2011 15:44 |
|
qntm posted:I don't know if you have a formal education in mathematics but if you don't you would probably be astounded to learn just how far up the stack you have to go from the basic axioms of set theory before you reach "if you have one apple and add two apples, you now have three apples". What this guy said. There's no general rule that the most basic elements of a system that everything else can be constructed out of are the simplest parts for a human to understand, or the most appropriate parts to begin understanding the rest of the system from. Especially when the system under study can be built on several different bases, for instance understanding a functional programming language as on a lambda calculus basis, a Turing machine basis, or on the basis of what it does on actual hardware. You don't become a car mechanic by studying physical chemistry, a good education in mathematics doesn't start with abstract nonsense, and there's no reason to expect counting cycles in ASM to be a good introduction to programming either. (FWIW, I'm of the school that university students in computer science should be taught in MMIX and Haskell. Maybe some Smalltalk if you're big on OO concepts. If you have a degree in computer science and you can't get up to speed in any common language within at most a week or so of intensive use (I'll give another week for learning C++), tell me where you studied so I can tell everyone to avoid the place. Programming languages are not the hard part of programming.)
|
# ? May 24, 2011 16:16 |
|
Duke of Straylight posted:If you have a degree in computer science and you can't get up to speed in any common language within at most a week or so of intensive use (I'll give another week for learning C++), tell me where you studied so I can tell everyone to avoid the place. Programming languages are not the hard part of programming.) On the other hand, you have large and complex APIs (even before third party frameworks) in the Java and .NET worlds that you will most definitely not master in a week. If you have graduated with 4 years of Haskell, you will be significantly behind your peers in applicable knowledge. Granted, I don't have the exact market share numbers of Haskell, can anyone help me out here?
|
# ? May 24, 2011 17:30 |
|
What do you do when you see a GPL project hosted on Google Code that has been releasing binaries for a while but has never published any code? I emailed the developer but haven't heard anything back from him and I can't find any complaint form to prod Google to do something about it. I wanted to try to make a Linux port of what appears to be a pretty simple Windows program, but I can't do anything at all as it is and he's not even conforming to his own license.
|
# ? May 24, 2011 18:23 |
|
baquerd posted:On the other hand, you have large and complex APIs (even before third party frameworks) in the Java and .NET worlds that you will most definitely not master in a week. If you have graduated with 4 years of Haskell, you will be significantly behind your peers in applicable knowledge. Nobody gets applicable knowledge of APIs from college.
|
# ? May 24, 2011 18:31 |
|
He doesn't have to. The license doesn't apply to the dude who wrote the code, it's about the terms under which he allows you to redistribute it.
|
# ? May 24, 2011 18:32 |
|
Maybe he doesn't have to license the code to himself, but Google Code requires all its projects to be open source.
|
# ? May 24, 2011 18:35 |
|
qntm posted:I don't know if you have a formal education in mathematics but if you don't you would probably be astounded to learn just how far up the stack you have to go from the basic axioms of set theory before you reach "if you have one apple and add two apples, you now have three apples". The lambda calculus forms as powerful a foundation for mathematics as set theory and Church numerals are dead simple. Your move.
|
# ? May 25, 2011 02:18 |
|
Otto Skorzeny posted:The lambda calculus forms as powerful a foundation for mathematics as set theory and Church numerals are dead simple. Your move. try teaching them to first graders.
|
# ? May 25, 2011 02:28 |
|
am I allowed to give the first graders drugs, and if so is acid kosher.
|
# ? May 25, 2011 02:38 |
|
Otto Skorzeny posted:The lambda calculus forms as powerful a foundation for mathematics as set theory and Church numerals are dead simple. Your move. The lambda calculus is logically inconsistent.
|
# ? May 25, 2011 03:32 |
|
Set theory's incomplete
|
# ? May 25, 2011 04:01 |
|
To get this thread back on topic, how about someone comes up with a simple program to decide the argument and then asks for help with it?
|
# ? May 25, 2011 10:24 |
|
I hope somebody here can help me, I've been pulling my hair out over this. Visual Basic by the way. I want to populate a combobox from a Data Table that is getting its data from a SQL server. This is my code: code:
code:
code:
|
# ? May 25, 2011 14:35 |
You should probably normalise that database. Even just going for 1NF should solve your problem. Ideally, your database should be structured like this: code:
You can also make this simpler structure, but it will require you to ensure each school's name is always written exactly the same: code:
If changing the database schema isn't an option I don't think you'll be able to use data-aware controls for the job.
|
|
# ? May 25, 2011 14:55 |
|
nielsm posted:You should probably normalise that database. Even just going for 1NF should solve your problem. Bah, that's so much simpler how did I not think of that . Thanks, I'll go ahead and change the database structure.
|
# ? May 25, 2011 15:00 |
|
Butt Soup Barnes posted:Bah, that's so much simpler how did I not think of that . Now you're aware of it, I'd suggest looking into one of the many database normalisation tutorials knocking around on the web. In most cases you'll want to be targeting 3rd normal form (usually written as 3NF) as it fits the vast majority of database requirements, but work up from the bottom. It shouldn't take you very long, the concept is actually very simple once you see a few examples.
|
# ? May 25, 2011 15:30 |
|
I'm using MATLAB to write a script that can recognize individual "clusters" of color based on shape and color, and count their number. I have a "tf = ismember(imf, P, 'rows');" line that calls up the 1x3 variable "P = impixel(a);", but this P vector has only a strict set of three numbers. I want ismember to look for pixels within a certain range of the P vector, such as plus-or-minus one SD of all the chosen values. How can I make ismember work with a range of values to find pixels that fall within a certain range?
|
# ? May 25, 2011 22:32 |
|
|
# ? May 16, 2024 03:55 |
|
Pollyanna posted:I'm using MATLAB to write a script that can recognize individual "clusters" of color based on shape and color, and count their number. I have a "tf = ismember(imf, P, 'rows');" line that calls up the 1x3 variable "P = impixel(a);", but this P vector has only a strict set of three numbers. I want ismember to look for pixels within a certain range of the P vector, such as plus-or-minus one SD of all the chosen values. How can I make ismember work with a range of values to find pixels that fall within a certain range? ismember is for exact matches only, which makes sense based on the name. Instead, you may want to do something like the following: code:
|
# ? May 25, 2011 22:41 |