« first day (274 days earlier)      last day (1632 days later) » 

12:13 AM
@Buffy @BenI. I believe the question is so vague because it's an X-Y problem expanded into and X-Z problem. Trying to exceed the designed capabilities of the language in use by creating event-driven routines using control-flow structures, and continuing on with the language for teaching more concepts than it implements. Like trying to use Scratch to write a new compiler or a RDBMS system. Can it be done? Maybe. Should it be done? Probably not.
1 hour later…
1:20 AM
The APCS list has a thread on the use of interfaces and some pitfalls around casting.
It was started by a teacher (possibly inexperienced) and is more like CodeReview than CSEducators but might be of interest.
@Buffy Is it a currently active thread?
Just started. Being distributed to the mailing list.
If it's a place where you are also part of the group, or community, it might be a good place for prospecting. For SE and for CSE.
Yes. That particular group is APCS-A teachers. They have a number of subgroups that you can join independently. You can go visit and/or you can get messages by email. But prospecting is good.
One good way to do it is to answer a query with a link back to CSEducators if we provide a good answer to the question.
We have two questions tagged interface, but 112 that mention them in some way.
Being APCS-based I'm guessing that it's a Java-centric place, yes? And that the interface in question is the Java OO thing-a-majig for adding abstract methods to objects?
1:36 AM
Yes, absolutely.
Somewhere in the cobwebs of my storage room I have a book on Core Java 2, and maybe some install disks from that era. Thus far I've managed to maintain enough sanity to avoid installing any of that, or it's modern kin.
Ancient history. I mostly program Java. Its libraries are useful and extensive. I like Scala a bit better (and it uses java libs also) but haven't yet committed to doing everything there.
So far I've managed to use the modern versions of Perl or PHP for all recent projects. Especially all my website-based activities. C/C++ is most likely what I'll switch to if I need that level of performance.
I wouldn't have the patience anymore for that.
I honestly cannot say why, but I seem to have a serious anti-Java bent in my mentality. Maybe it's the half-interpreted and half-compiled concept?
If it's programming I have the patience for it. If it's useful, that is good too. :D
1:49 AM
Anyway, my pumpkin hour has arrived. The sandman calls. Chat another day.
happy sheep-counting time.
2:45 AM
@GypsySpellweaver I didn't understand this comment any more than I understood his question.
To me it looks like the OP is trying to take the RobotC language and make it do much more than it was designed to do.
And.. He wants to have the program do other things while waiting for an external event to occur, with no predictability if it will occur, let alone when it will occur.
That's an interrupt which the language apparently does not have, so he wants to emulate that behavior using some kind of control structure. He choose an until loop.
that was the X-Y problem, using an until loop instead of a trigger system
Then, without an until loop in the language, he focused on using a while loop to replace the until loop that replaces the interrupts.
Oh, ya, he don't want to confuse his students either. :(
So basically a small hack to get around something the language wasn't designed for?
Yes, only it's at least two levels deep as well. Not knowing the RobotC language, nor his true objective, it could be even worse.
With that much confusion going on, it's nearly impossible to actually write a clear question.
I even VTC's as unclear. Hopefully it won't get any answers, yet, either.
W/o answers, maybe it can be rescued. With answers it might not be possible without invalidating one of the answers.
3:10 AM
I believe I could give him a good answer ... If I knew what he really was trying to do - both with the programming and with the teaching.
3:21 AM
@BenI. He seems to be active, within the past 30 min anyway. I left a comment inviting him here to discuss it.
4:05 AM
Thanks for the willingness to help clarify a question.
4:17 AM
Reading your comments here and on the post, i think it might be a better question to ask if it is worthwhile to teach the while loop rather than using the Natural Language "waitUntilDistanceLessThan(threshold);" command. The language has an equivalent command for distance more than, light less than, light more than, button pushed, etc.
Students are often content to create a program that executes such commands one after another. But I don't feel like they learn much about programming. And they hit a wall if they want the robot to be able to respond to two different kinds of events. So I introduce loops and conditions. In the post, I'm wondering about how to make that work well for them.
4:30 AM
I tried to edit the question, and gave up because I'm unsure of the real question in it. At the moment, I think the issue is how to get the students to understand and use loops and conditions. What the language/robot can and cannot do is only a side issue. Correct?
@BennettBrown BTW, I'm an in-home caregiver, so I may from time-to-time drop out for a few minutes, but I do come back.
4:51 AM
My gut tells me that any loop is best introduced in a manner that exemplifies it's design and syntax. A for loop where the start, stop values are known beforehand, execution-time at least if not coding-time. A foreach loop to walk through a list (array). A while loop when a condition may or may not be true initially, but will eventually be false even if initially true. An until loop when a condition may or may not be true initially, but will eventually be true even if initially false.
The empty loop, of any variety, is nothing more than a sleep, wait, or delay statement - whichever the language has. The infinite loop, of any flavor, is a waste of CPU, and pointless at anything above OS level when a system has some kind of interrupt or trigger system.
I cannot imagine any current language without a sleep variant, so the null loop, if presented at all, should be given as a way to roll your own sleep timer, that's less accurate than the in-built version.
The last code sample of your question shows a way to use the infinite loop to turn the robot into a responsive light. If the light does not turn off when the program ends, there's no point to using the infinite loop. In that loop, rather than turning on the light, and leaving it on forever after, you could make the alert_button toggle the light between states and make it a controlled flasher.
In the question, the empty waiting loop does not allow other code to execute while it's waiting, as the question states. Rather it will block indefinitely, until the condition is met.
OK, I'm talking to myself now. Time to shut up.
5:14 AM
A lot of what you said was helpful to me. Thank you!
Yes!: "any loop is best introduced in a manner that exemplifies it's design and syntax. "
Welcome back
Also, RobotC does have until they just don't tell you about it.
"The empty loop, of any variety, is nothing more than a sleep, wait, or delay statement - whichever the language has. ": The empty loop has the potential for new code to be placed in the loop, a potential the sleep/wait/delay don't have.
@BennettBrown So does a comment, and it take no CPU cycles.
example 1.

example 2.
while (sensorValue[distanceSensor]>500) {

Those are different in that you can place new code in the curlybraces.
I don't get what you mean that a comment has the potential for new code to be placed there.
For the students' sake, use either version one, or version two with something in it already. Not an empty one (waiting for new code)
5:22 AM
OK, so that's what I suggest in the treatment proposed in the OP. But I don't find it to be a very good one.
You can start with waitUntil.... and then add that "Now, while waiting we can also do thisFunction if we replace


while (sensorValue[distanceSensor]>500 {
using the //empty loop filler is the confusing part. Even to a pair of veteran programmers here on the site. How much more confusing to students?
It was interesting today to hear what they had to say when I asked, why is this called a "while loop"?
Most said it was looping over the decision. A few thought the brackets were the important part.
That sounds like the language's block structure hasn't been completely absorbed yet.
That's why showing loops in their `natural` state first rises to the top.
    while (theAnswer != 5) {
This is not a CS class. We are 4 days into 10 days of a unit with the robots. This was day 3 with RobotC and they haven't necessarily programmed elsewhere.
What's the course objective, then?
With only 10 days to work with, and likely zero significant programming exposure, it might be too much to even worry about adding in extra input abilities while waiting on the condition to be true.
5:37 AM
The school district calls it "applied tech"; the national PLTW program is "gateway to technology." The objectives include awareness/excitement about career paths, professional skills (present, collaborate, document),
3d modeling (Inventor or Creo), reinforcement of math and science a la length scaling, area and volume calculations, understanding forces and force/motion concepts, forces in planes and rockets, societal sources and uses of energy, climate change, electricity (P=Et, P=IV, use of a multimeter, power supply, breadboard), and introduction to automation and robotics including programming.
Multi-tasking for the robot seems to be going beyond the objectives, and risks loosing rather than motivating the students
It is a simple cube robot, keep it's functionality simple too.
Maybe. Or maybe it's not that hard to write a while loop for the until condition and then they've learned a useful programming contruct instead of a b;ack box "waitUntilDistanceSensorLessThan()" function in someone's proprietary library.
The multitasking only comes up from things the students want to (are motivated to) make their robot do.
I would bypass the Natural Language stuff, and go with the base RobotC system, yes.
Well, that requires an empty while loop...
Not empty, make it blink the led every second.
5:42 AM
I want to test code with an until statement in it. Why did you decide you thought there was an until?
until (ready) {} is just syntactic sugar for while (! ready) {}
until (stopped) {} is just syntactic sugar for while (moving) {}
I don't think the compiler accepts it. Did you see otherwise? Not that it matters, I agree.
And, in the case of the tail-test version, RobotC also has do {} while (condition)
The compiler won't accept until but the human brain can reverse the test to make it a while
5:45 AM
I'm off. Thanks!
1 hour later…
7:09 AM
10 messages moved to Blag Devs
@thesecretmaster Are "drive-by" comments welcome?
In re: blag?
Unless there's good reason to do otherwise, stick with MySQL
a blog for something moderated by a community is, naturally, at the scrutiny of said community
For those reading: the discussion is the choice of DB for a blog.
Or should I switch rooms?
7:16 AM
@GypsySpellweaver Agreed, however I'd like not to limit us
MySQL is pretty standard
@GypsySpellweaver No... that room (as I see it) is for the development of the blog, and not for tech choices, which are pre-dev
This room is general discussion... this fits here
I think it'd be best to move over there, to avoid spamming the folks who aren't interested
ah. Hadn't thought of that.
@ItamarG3 and I are restarting this whole blog idea! If you have thoughts/questions/concerns ping one of us in blag devs.
7:28 AM
I'm doing the server bit first
4 hours later…
11:43 AM
Wow! It's been a long time since it took me >20 minutes to catch up on the site after waking up in the morning. Lots of stuff going on.
I'm glad the blog is coming back.
And I'm glad that someone understood what Bennett was after
4 hours later…
4:01 PM
@BennettBrown I posted some comments for you on the RobotC question - the point of which is that the use of scaffolding for this environment may be very handy - especially given the time constraints
@GypsySpellweaver the name of the method is misleading. The robot is not 'waiting' it is moving. A better name would be travelUntilDistanceSensorLessThan(500). Or better yet travelTo( distanceThreshold )
@BennettBrown @GypsySpellweaver Also check the api - I am almost certain there will be support for interrupting your running program. Like an off or pause button on a remote.
4:33 PM
As I often do, I've added a rather different answer to the RobotC question.
3 hours later…
7:48 PM
That polymorphism question on the AP list would've been great on our site.
8:14 PM
More like a code review, tho.
It wasn't really polymorphism either. Just junk code.
But it was about how to visualize!
off topic: At your HS are the guards armed?
Appalling concept
can you link the Poly Q.
And re: visualization: the example we discussed earlier re: isTraversable() for GF tiles is a good visualization, I think. So say my students...
8:41 PM
How about you, @MrBradley, does your school require armed guards?
no . not aware of any candian school that does
Maybe I should re-adopt my Canadian heritage.
One of my ancestors is Zacharie Cloutier. Another is Jean Guyon.
I like it. :)
Hmmm. The question, or my ancestry?
the country. ;)
8:48 PM
Ah yes. Cold as it might be.
Cloutier was one of the first European immigrants to North America.
Zacharie Cloutier (c. 1590 – September 17, 1677) was a French carpenter who, in 1634, immigrated to New France in the first wave of the Percheron Immigration from the former province of Perche, to an area that, today, is part of Quebec, Canada. He settled in Beauport and founded one of the foremost families of Quebec. == Early life == Many sources state that Zacharie Cloutier was born about 1590 in the parish of Saint-Jean-Baptiste, Mortagne-au-Perche, France. Cloutier was one of several children of Denis Cloutier and his first wife Renée Brière. The notary Mathurin Roussel of Mortagne ca...
@BenI. I am teaching AP CS P this year and cannot see the CS A. I have requested access. Can you provide a brief summary?
@Buffy its not that cold in my part of the country. Similar to NJ/Boston
@MrBradley Do you have an account at the apcs community site?
You should be able to connect to the APCS-A group if so.
If you can login to the site, click on the Discussions tab near the top to join other discussions than the ones you currently have.
@Buffy they are processing my membership now.
ok. should be fine, then.
I am working on a GUI arc for CS A. Starting with a simple GUITerminal app
works like your standard console but in a GUI window
Related but tangential, our students are playing with GUI Remote control apps for KJR
taking a break for late lunch
9:06 PM

« first day (274 days earlier)      last day (1632 days later) »