OddObserver posted:... Though really, bringing back Pascal might actually not be a horrible idea, either (after adding a string type, of course). Nobody would write ANSI standard Pascal today. Nobody sane, at least. Give the students FreePascal and have it use Object Pascal mode, I think that may even be default now. As far as I remember, you then get a boilerplate like this: code:
But the more sane option is probably Haskell, a Lisp or an ML on first semester, and then Python on second. On third, throw C++ and Java at them simultaneously.
|
|
# ? May 20, 2011 15:45 |
|
|
# ? May 23, 2024 07:51 |
|
Orzo posted:Why? If you really don't know anything about programming, there are certain things you need to understand before method signatures, access modifiers, and argument lists. Have you ever tried to teach any programming to a complete newbie? The entrypoint signature can be overwhelming. Even many introductory books say 'we'll come back to this later, but for now you always need to have this block of code for your program to run.' This is why we teach people to program with simpler languages with less conceptual overhead.
|
# ? May 20, 2011 16:02 |
|
^^ Or should, anyways. Here we start students off on C because there's no money in the budget for the co-op and non-co-op students to take different courses in first year, and there's apparently no demand in the industry for anything but C and Java. I see a lot of students in second year who can program in C badly but who can't really program - they get so bogged down in the overhead of learning C that they don't really learn any of the underlying concepts. There were similar issues when they started with Java. A lot of the profs would rather move first year to Python, but it's never going to happen as long as the people running the co-op program have their heads up their arses. ToxicFrog fucked around with this message at 16:25 on May 20, 2011 |
# ? May 20, 2011 16:22 |
|
Hughlander posted:Didn't Dijkstra have a fairly famous interview where he said basically that when he was in industry he was writing OSes for an instruction set that wasn't fabbed yet and he had to do everything in his head / on pencil, and that's the way you should do it comma drat it? [*] He had a delightful accent, "chiseled" was pronounced "sizzled"
|
# ? May 20, 2011 16:36 |
|
ToxicFrog posted:I see a lot of students in second year who can program in C badly but who can't really program - they get so bogged down in the overhead of learning C that they don't really learn any of the underlying concepts. There were similar issues when they started with Java. The overhead of learning C, or the overhead of complex memory management that was taught to them before they were finished learning for loops?
|
# ? May 20, 2011 16:46 |
|
Hughlander posted:Didn't Dijkstra have a fairly famous interview where he said basically that when he was in industry he was writing OSes for an instruction set that wasn't fabbed yet and he had to do everything in his head / on pencil, and that's the way you should do it comma drat it? I think he talks about something like that in this.
|
# ? May 20, 2011 18:52 |
|
Woz created and debugged by hand the first version of Apple II BASIC before getting actual chips to use, if that's what you're thinking of.
|
# ? May 20, 2011 18:55 |
|
The real horror is that I am disincentivized to fix this.code:
|
# ? May 20, 2011 19:31 |
|
OddObserver posted:That people just starting out would have lots of difficulty getting it. I don't know how familiar you are with SICP, but if you aren't: Its approach to teaching recursion is vastly different from any curriculum I've ever encountered elsewhere and it ends up being pretty intuitive. Zombywuf posted:The overhead of learning C, or the overhead of complex memory management that was taught to them before they were finished learning for loops? C has a shitload of syntax before you touch malloc or even arrays. Hell, even learning how to create a C program is a Thing that takes up a lot more cognitive overhead than "here's a REPL."
|
# ? May 20, 2011 19:59 |
|
fishmech posted:Woz created and debugged by hand the first version of Apple II BASIC before getting actual chips to use, if that's what you're thinking of. I heard he memorized the machinecode for Apple I BASIC, and before the Apple I had a tape drive he would just punch it in from a debug monitor.
|
# ? May 20, 2011 20:34 |
|
Wikipedia says: "It should also be noted that Wozniak did not have any software development tools for the 6502 processor other than an assembly language reference manual, and instead wrote out the software with pen and paper and then hand assembled the instructions into raw machine code for the 6502." and links to http://apple2history.org/history/ah03.html
|
# ? May 20, 2011 20:43 |
|
fishmech posted:Wikipedia says: "It should also be noted that Wozniak did not have any software development tools for the 6502 processor other than an assembly language reference manual, and instead wrote out the software with pen and paper and then hand assembled the instructions into raw machine code for the 6502." and links to http://apple2history.org/history/ah03.html I'm not saying that's not impressive, because it is, but there's a slight difference between writing single-user software for an 8-bit, maybe 2 MHz processor and the multi-user, massively threaded, insanely complex software of today running on the multi-core within-an-order-of-magnitude-of-the-sun's-energy-density behemoths we have now. Even if you could do something like that today, it would be a very, very dumb way to write software.
|
# ? May 20, 2011 21:24 |
|
Mr.Radar posted:But at the same time there are languages like Scheme and Python where you don't need to worry about those things at all. The real horror is teaching Java as a first language. I would've given up on programming if Java or any C variant was my first language. I started on DarkBASIC. I actually did. Not exactly a fantastic language overall, but it was great for sixth grade me because it was really easy to learn and let you dive right in to making games.
|
# ? May 20, 2011 21:35 |
|
Zombywuf posted:The overhead of learning C, or the overhead of complex memory management that was taught to them before they were finished learning for loops? GrumpyDoctor beat me to it. C has a lot of up-front complexity compared to Scheme, Lua, or even Python, and is a lot harder to experiment with - even before you start talking about memory management. This is fine if you already have the fundamentals down, but if you're going into a first-year programming course, you probably don't. The result of this is that the language gets in the way of the learning; you end up with a lot of people who know how to cobble together a program in C by regurgitating individual fragments of code, but don't actually understand what they're doing because they had to spend the entire semester learning C rather than learning how to program.
|
# ? May 20, 2011 21:44 |
|
http://forrst.com/posts/Why_Cant_Programmers_Design_Software-gOg (yes this a serious post by a serious person)
|
# ? May 20, 2011 22:41 |
|
tef posted:http://forrst.com/posts/Why_Cant_Programmers_Design_Software-gOg what's wrong with this, this is the best post
|
# ? May 20, 2011 22:49 |
|
tef posted:yes this a serious post by a serious person nah
|
# ? May 20, 2011 22:50 |
|
Broken Knees Club posted:nah yes
|
# ? May 20, 2011 23:01 |
|
This is your brain on design patterns. Any questions?
|
# ? May 20, 2011 23:10 |
|
drat, really wish I hadn't lost my fizzbuzz implementation in the great blade host crash.
|
# ? May 20, 2011 23:12 |
|
quote:What if I told you that the answer to the FizzBuzz algorithm is only one line of code without any if and it looks like that
|
# ? May 21, 2011 00:05 |
|
I refuse to believe that isn't tongue in cheek.
|
# ? May 21, 2011 00:26 |
|
TasteMyHouse posted:I refuse to believe that isn't tongue in cheek. Sorry, it is totally serious.
|
# ? May 21, 2011 00:40 |
|
tef posted:Sorry, it is totally serious. quote:As with every software engineering problem you don't really see the big picture if you are always in "low level" code. Another reason why you need to think in terms of objects Wow. It really is.
|
# ? May 21, 2011 01:04 |
|
The solution to every problem is to over-engineer the gently caress out of it! Why do it in 9 lines of clear, readable code if you can abstract it into an unreadable monstrosity?
|
# ? May 21, 2011 01:23 |
|
tef posted:Sorry, it is totally serious. Can't be. There's no mention of XML or even a basic Enterprise Service Transmogrifier. The solution obviously won't scale, isn't discoverable, and can't be consumed by all Enterprise users since it lacks an open standard. I propose that we start by forming a committee to draft an open FizzBuzz standard that will provide an open, standards based, alternative to all of these incompatible proprietary stovepipe FizzBuzz implementations that have been plaguing the Enterprise for some time. This standard will usher in a new era for FizzBuzz compatibility both within the SA community and the Enterprise as a whole.
|
# ? May 21, 2011 02:14 |
|
reminds me of that old 'object calisthenics' thing http://binstock.blogspot.com/2008/04/perfecting-oos-small-classes-and-short.html
|
# ? May 21, 2011 02:15 |
|
RitualConfuser posted:Can't be. There's no mention of XML or even a basic Enterprise Service Transmogrifier. The solution obviously won't scale, isn't discoverable, and can't be consumed by all Enterprise users since it lacks an open standard. I propose that we start by forming a committee to draft an open FizzBuzz standard that will provide an open, standards based, alternative to all of these incompatible proprietary stovepipe FizzBuzz implementations that have been plaguing the Enterprise for some time. This standard will usher in a new era for FizzBuzz compatibility both within the SA community and the Enterprise as a whole. no it is totally serious and not tongue in cheek. I wish it was.
|
# ? May 21, 2011 02:24 |
|
If it had XML, it would scale. XML scales like a boss.
|
# ? May 21, 2011 02:38 |
|
Otto Skorzeny posted:If it had XML, it would scale. XML scales like a boss. I will suggest this to him next time I see him
|
# ? May 21, 2011 02:40 |
|
How do you think he'd react to the video? Would Poe's law cause him to run with it?
|
# ? May 21, 2011 02:42 |
|
tef posted:no it is totally serious and not tongue in cheek. I wish it was. That's as serious as a drunk clown playing with a rubber chicken.
|
# ? May 21, 2011 03:25 |
|
tef posted:http://forrst.com/posts/Why_Cant_Programmers_Design_Software-gOg Tell him his answer is incomplete; the fizzbuzz problem is to print the fizzbuzz operation of numbers from 1 to 100, and he can't just punt on the design implications of traversing a range and applying an operation to the members of that range. First off, he's clearly missing a ContiguousIntegerRangeTraversal class (implements ContiguousRangeTraversal implements RangeTraversal implements Sequence) which he can traverse in various directions ( public Enum RangeTraversalDirections{ RangeTraversalForwards, RangeTraversalBackwards}). Are you sure this is serious because I think this would be quite easy to do all day.
|
# ? May 21, 2011 09:47 |
|
dazjw posted:Are you sure this is serious Yes It's a staff pick, too https://twitter.com/qnoid/status/40446929884299264 https://twitter.com/qnoid/status/66450115593904129
|
# ? May 21, 2011 10:48 |
|
He even cheats by using an if statement elsewhere.code:
|
# ? May 21, 2011 14:15 |
|
code:
mjau fucked around with this message at 15:31 on May 21, 2011 |
# ? May 21, 2011 15:28 |
|
Beautiful.
|
# ? May 21, 2011 15:38 |
|
Zombywuf posted:Beautiful. Definitely. Can a C guy break that apart? I assume it's some sort of way to reference the null terminated strings by memory address?
|
# ? May 21, 2011 15:50 |
|
baquerd posted:Definitely. Can a C guy break that apart? I assume it's some sort of way to reference the null terminated strings by memory address? Yeah, it's calculating the offset into the format string based on the loop index. Pretty neat. The trick is that in C, string literal arguments are actually character pointers. The "+(!(i%3)+2*!(i%5))*6" part adds an offset to the pointer. The "!(i%3)" and "!(i%5)" become 0 if there is a remainder, and a 1 if there isn't. (Though I'm not sure if the 1 is guaranteed. Any non-zero value can be used for true.)
|
# ? May 21, 2011 16:07 |
|
|
# ? May 23, 2024 07:51 |
|
Wait, so http://twitter.com/!/forrst/status/40425431857512448 says quote:Staff Pick: Can you write a FizzBuzz program without if/else/switch? http://t.co/RBecdHr which links to http://forrst.com/posts/Why_Cant_Programmers_Design_Software-gOg which says, among a great many other things code:
code:
So I guess the real challenge overcome here was to slightly obfuscate the location of the "if" statement!
|
# ? May 21, 2011 17:18 |