|
Volmarias: seconded. I've used Processing to ease beginners into working with Java, and students typically respond very well to it. It makes it possible to first teach statements and expressions, then functional abstraction and only afterwards begin discussing OOP. Once they have written a number of games and programs in Processing making the transition to Java is generally pretty painless.
|
# ? Oct 6, 2013 16:46 |
|
|
# ? Jun 5, 2024 07:39 |
|
Pollyanna posted:That's partly why the guy brings up a "simple interactive graphical environment" as an alternative to learning about OOP. It's a lot more obvious and provides the abstraction/metaphors that humans need to really understand it. Try Greenfoot or BlueJ.
|
# ? Oct 6, 2013 17:25 |
|
Processing is pretty cool so far, thanks for the tip.Wheany posted:Try Greenfoot or BlueJ. I tried BlueJ, but for some reason it bugs out when I use it. I'll see if Greenfoot is better. Internet Janitor posted:Volmarias: seconded. I've used Processing to ease beginners into working with Java, and students typically respond very well to it. It makes it possible to first teach statements and expressions, then functional abstraction and only afterwards begin discussing OOP. Once they have written a number of games and programs in Processing making the transition to Java is generally pretty painless. Do you have a course guide or example class or something? It'd be really nice to follow something like that.
|
# ? Oct 6, 2013 17:36 |
|
Pollyanna posted:I tried BlueJ, but for some reason it bugs out when I use it. I'll see if Greenfoot is better. Seeing Greenfoot was the thing that made me realize that there is no reason the first Java lesson has to be "public static void main"
|
# ? Oct 6, 2013 17:57 |
|
Pollyanna: I do have my course materials organized with brief step-by-step writeups online. If you were going to dive in you would first want to go through a few of the Processing tutorials to familiarize yourself with the basics I would've covered in the first day.
|
# ? Oct 6, 2013 17:58 |
|
Pollyanna posted:That's partly why the guy brings up a "simple interactive graphical environment" as an alternative to learning about OOP. It's a lot more obvious and provides the abstraction/metaphors that humans need to really understand it. aaaaand another full circle, this time to Smalltalk.
|
# ? Oct 7, 2013 04:50 |
|
php:<? if (pg_num_rows($pg_res) == 1) { $fromcity = pg_result($pg_res, 0, "city"); $fromstate = pg_result($pg_res, 0, "state"); $fromcompany = pg_result($pg_res, 0, "name"); $fromaddress = pg_result($pg_res, 0, "address"); $fromaddress2 = pg_result($pg_res, 0, "address2"); $fromphone = pg_result($pg_res, 0, "phone"); } ?> I don't know what's worse: the fact that we are calling the old version of pg_fetch_result() 6 times instead of doing something sane; the fact that we are using functions that have been deprecated for 10 years; the fact that this function still works.
|
# ? Oct 7, 2013 05:10 |
|
Java code:
|
# ? Oct 7, 2013 15:51 |
|
Zorro KingOfEngland posted:
Clearly a forward-thinker who envisions the world as it should be. (Each month with 30 days with a 5-6 day party week in the middle during in the summer. Northern hemisphere summer.)
|
# ? Oct 7, 2013 16:43 |
|
Pretty sure local summer with the dates being out of sync for half the year would be how it'd be implemented in the real world.
|
# ? Oct 7, 2013 17:16 |
|
Zorro KingOfEngland posted:
Maybe it was software for a Lunation calendar such as was used by the Sumerians, and was just rounding up.
|
# ? Oct 7, 2013 19:16 |
|
Doctor w-rw-rw- posted:aaaaand another full circle, this time to Smalltalk. It makes sense that a GUI framework is the most natural OOP teaching example since arguably OOP was invented specifically to solve the GUI architecture problem. My first job in industry was in Smalltalk and the language rocked pretty hard.
|
# ? Oct 7, 2013 19:23 |
|
quote:A `Timer` is a horizontal strip on the screen with a stripe In what asinine universe is this considered more intuitive than "Car extends Vehicle"?
|
# ? Oct 7, 2013 19:56 |
|
qntm posted:In what asinine universe is this considered more intuitive than "Car extends Vehicle"? In the universe where Car extends Vehicle doesn't explain anything about code reuse, delegation, or polymorphism?
|
# ? Oct 7, 2013 19:58 |
|
Yeah, GUI framework is a good OO example but the one presented in that post is pretty poo poo. Back when I was still in academia, I was fond of the adventure game approach. You had a game engine/service, commands (if a text adventure) rooms, items, a player, monsters, and different subtypes of all these... You could spend an entire class period asking students to contribute to a class design about how all these pieces related to each other and fit together. A lot of good opportunities to talk about reuse, coupling, and cohesion. And it was a lot more fun for them to implement and come up with a story of their own, too.
|
# ? Oct 7, 2013 20:18 |
|
Contrary to popular belief:code:
(There were just under 6 dozen of these in the last check-in. )
|
# ? Oct 7, 2013 22:30 |
|
Protocol7 posted:Contrary to popular belief: Possible explanations: 1. "I was going to fill it in later." 2. "I couldn't figure out what to assert on." 3. "It's better than nothing."
|
# ? Oct 7, 2013 22:44 |
|
qntm posted:In what asinine universe is this considered more intuitive than "Car extends Vehicle"? Yeah, that example honestly suggests 'interface' to me more than it suggests 'inheritance.' e: hey, are you http://c1qfxugcgy0.tumblr.com/ ? Just noticed that your name seemed familiar, and you don't have PMs. Protocol7 posted:Contrary to popular belief: Sounds like they got stuck in during the initial creation of the unit tests (automatically?), and never taken out? Then again, there are people who actually write "if (foo == true)", so... who knows. (a == true and b == false are the two snippets of code that annoy me most in all the world. I hate them and I hate the people that wrote them.)
|
# ? Oct 7, 2013 22:46 |
|
LOOK I AM A TURTLE posted:Possible explanations: Considering the comments on the check in were (abridged) "Added unit tests for data mapping on deserialization" I'm hoping so, because those kinds of tests are kind of important.
|
# ? Oct 7, 2013 22:53 |
|
Those are certainly not as bad as the entirely real a.ToString()!="false".
|
# ? Oct 7, 2013 22:53 |
|
LOOK I AM A TURTLE posted:3. "It's better than nothing." That's true. That Assert failing may be indicative of larger problems, like up being down, day being night, 2nd coming of Jesus kinda stuff.
|
# ? Oct 7, 2013 23:11 |
|
PleasingFungus posted:e: hey, are you http://c1qfxugcgy0.tumblr.com/ ? Just noticed that your name seemed familiar, and you don't have PMs. No, although this person appears to follow me on Twitter.
|
# ? Oct 7, 2013 23:27 |
|
ManoliIsFat posted:That's true. That Assert failing may be indicative of larger problems, like up being down, day being night, 2nd coming of Jesus kinda stuff. Well in 10 days we'll be cursing the bank software authors that pushed these halfassed assumptions into production.
|
# ? Oct 7, 2013 23:32 |
|
PleasingFungus posted:Then again, there are people who actually write "if (foo == true)", so... who knows. You have to do this (I think?) for Nullable<bool> in C# and every time I see one I do a double-take.
|
# ? Oct 7, 2013 23:48 |
|
I've written the equivalent of Assert.IsTrue(true) because the actual test was just that the preceding code ran without throwing any exceptions and the test framework lacked Assert.DoesNotThrow and the runner only listed tests in the UI which actually asserted something.
|
# ? Oct 8, 2013 00:11 |
|
JawnV6 posted:Well in 10 days we'll be cursing the bank software authors that pushed these halfassed assumptions into production. GrumpyDoctor posted:You have to do this (I think?) for Nullable<bool> in C# and every time I see one I do a double-take.
|
# ? Oct 8, 2013 00:22 |
|
Protocol7 posted:Contrary to popular belief: It's a good test if you're testing Assert.isTrue
|
# ? Oct 8, 2013 00:26 |
|
Volmarias posted:It's a good test if you're testing Assert.isTrue. Perhaps Assert.isTrue may be false?!?!?
|
# ? Oct 8, 2013 00:26 |
|
ManoliIsFat posted:Hahaha. "if (x ?? false)" more obviously indicates that you're dealing with a nullable type.
|
# ? Oct 8, 2013 01:11 |
|
Scaevolus posted:"if (x ?? false)" more obviously indicates that you're dealing with a nullable type.
|
# ? Oct 8, 2013 01:15 |
|
ratbert90 posted:Perhaps Assert.isTrue may be false?!?!? Thus the importance of writing automated tests. If someone should change the nature of truth, you shall be the first to know.
|
# ? Oct 8, 2013 01:18 |
|
ManoliIsFat posted:Way classier, thanks for that. I disagree. That looks more confusing to me because I'm used to the null coalescing operator being used to generate a value I care about not just to check a condition. I admit (x == true) isn't much better since it forces you to double-check the type of x to make sure the author wasn't a redundant moron.
|
# ? Oct 8, 2013 01:19 |
|
Monkeyseesaw posted:I disagree. That looks more confusing to me because I'm used to the null coalescing operator being used to generate a value I care about not just to check a condition.
|
# ? Oct 8, 2013 03:03 |
|
PleasingFungus posted:(a == true and b == false are the two snippets of code that annoy me most in all the world. I hate them and I hate the people that wrote them.) Don't forget this classic code:
|
# ? Oct 8, 2013 07:20 |
|
PleasingFungus posted:Then again, there are people who actually write "if (foo == true)", so... who knows. "if (somebool == true)" aids readability and is a reminder of the types as you skim the code, however "if( (x > 3) == true)" implies you are being paid by the character. In either case, it's a stylistic choice as the compiler will produce the same output either way.
|
# ? Oct 8, 2013 08:10 |
|
I recently had to update our unit tests that had become out of date about 2 years ago. I came across these tests. assertTrue(expectedValue == result); Why not just use assertEquals(expectedValue,result);
|
# ? Oct 8, 2013 09:59 |
|
Sometimes I catch myself writing foo == true for some boolean foo, and often it's a sign that the variable really wants to be an enum. (gently caress you, anthropomorphized variable, you have to be a bool.)
|
# ? Oct 8, 2013 10:13 |
|
IMlemon posted:Don't forget this classic code:
e: oh oh this thing too code:
bucketmouse fucked around with this message at 11:28 on Oct 8, 2013 |
# ? Oct 8, 2013 11:23 |
|
Consulting horror: Yesterday, I spent 5 hours on a train to Boston to do a demo for some Microsoft folks (and present the same material at a Microsoft-sponsored event today). I get off the train, head over to MS, and discover that my laptop no longer boots. I'm just happy that my demo VMs are in Azure, not on my laptop. Total disaster averted; I can borrow someone else's laptop or present from my Surface.
|
# ? Oct 8, 2013 12:40 |
|
|
# ? Jun 5, 2024 07:39 |
|
Ithaqua posted:Consulting horror: Yesterday, I spent 5 hours on a train to Boston to do a demo for some Microsoft folks (and present the same material at a Microsoft-sponsored event today). I get off the train, head over to MS, and discover that my laptop no longer boots. I'm paranoid when I go present poo poo at a conference. I keep:
And things I present have to:
When I gave week-long classes teaching Erlang, I'd also just make my own fully workable virtualbox machines, and I'd carry them with virtual box installers around so that people who inevitably came unprepared didn't need to take an hour to get up and running. It's going well most of the time now. MononcQc fucked around with this message at 13:25 on Oct 8, 2013 |
# ? Oct 8, 2013 13:22 |