Doram's Programming Class - Discussion

Need programming help? Want to post programming tips? Are you programming a game and want to show it off? That and more here.

Doram's Programming Class - Discussion

Postby Doram » February 2nd, 2017, 7:38 pm

This is the forum discussion thread for my Programming Class. Post any questions questions or comments here if you miss the class, or just otherwise want to discuss something. Discord discussion that is pertinent will be transcribed here.

0010101001010100101010101010100111010011001011010100010001011110100100101010111110011010100110011101110100111101010101010101001001010101010101010101010000111110101001010101010101010101010101001010101010101010101010101010101010101001010101010101010101010010101101001010010101001011011001010101010101010101010101010010101010101010010101010101010
Lesson 1: General Concepts - Discussion

01010101000101010010101110111010111001010010100010001010101010010101010101010101010101010010000101101011011111101010010110110101010010101001010101011101001101010101010101010010001010101111100101010100101010101001010101010101001010101010010101010101010101010101101001010010101010101011110101010101101010100101010101001010101010101010101010010110101001010101001010101010


Link to Today's Materials

Question 1
Now, we'll definitely get into it more in the coming lessons, but does everyone get the general idea of breaking everything down to math? Can you explain it in 2 sentences?

Question 2
Does everyone understand generally how the layers of a computer's systems work? Lay it out for me.

Question 3
Ok, most i/o is really a two way street. Can you tell me how a keyboard can be an output device, in other words, how can the keyboard tell you what a computer is doing right now? How about a Mouse? How can the screen affect input?

Question 4
What other reasons are there, as to why is an interface important? What makes a good interface?

Discord Discussion transcript thus far: show
[6:45 PM] Forgotten: Welp, I don't have many questions regarding that, apart from the fact that I tend to make games with excuse plots (like the old days)
[6:45 PM] Forgotten: So... I wasn't really "telling a story" when I was making video games
[6:46 PM] Nan: Heh
[6:47 PM] Nan: it's a nice first lesson
[6:48 PM] Doram: XD it doesn't have to be a complex story. Mario games have little more in general and still manage to have plot.
[6:49 PM] Nan: Games don't need big stories
[6:49 PM] Nan: especially if you're just starting to make them
[6:49 PM] Forgotten: Well they technically do have a plot because your princess is in another castle
[6:49 PM] Forgotten: But... games like Tetris had literally no plot
[6:49 PM] Doram: In fact, games don't need big stories because half the fun of playing them is making your own story out of the experience.
[6:50 PM] ~Yuri: That's relative to the kind of game you like to play :P
[6:50 PM] ~Yuri: Games like the telltale TWD games are entirely based off of story
[6:51 PM] Forgotten: I'm honestly not a huge fan of story-heavy games so I'm probably never going to make anything with a good plot
[8:56 PM] Venexis: It might be worth highlighting the parellel between input/output and read/write early on too though
[8:56 PM] Venexis: That comes up in a lot of cases, whenever your program needs to refer back to a save file or whatever
[9:30 PM] Venexis: Question: is collaboration considered cheating
[9:32 PM] Doram: No.
[9:32 PM] Nan: ...how the hell can a keyboard be an output device?
[9:33 PM] Nan: I can only think of a couple situations...
[9:33 PM] Venexis: I've kindof got like, one idea but it's not a very good one lmao.
[9:33 PM] Doram: This is not super serious, and not being graded. You want to discuss here, that's fine. I'll transcript to the thread.(edited)
[9:33 PM] Nan: I might as well give this a shot
[9:33 PM] Venexis: And took me way too long to find due to the absence of something I've always taken for granted
[9:33 PM] Venexis: Are PMs here acceptable?
[9:34 PM] Doram: Yes.
[9:34 PM] Venexis: naicu
[9:43 PM] Doram: Also, Ven, as for the read/write stuff, we'll cover streams when the time comes.
[9:43 PM] Doram: We've got a long way to go.
[9:45 PM] Doram: And, don't forget that we're approaching this from the very general stuff first, and different languages treat that VERY differently.
[9:46 PM] Raiyuuni: so I just skimmed through the questions
[9:46 PM] Raiyuuni: I've no idea what to say x_x
[9:49 PM] Doram: Well, take your time, and think about it, and it's perfectly fine if you don't know what to say. Give it a guess, and we can discuss it one way or another. There's no shame in not knowing.
[9:50 PM] Raiyuuni: I'm talking about a level of not knowing that makes Jon Snow seem like a grand maester
[9:50 PM] Raiyuuni: but sure
[9:54 PM] Doram: Well, here's some hints for the I/O question, then. Look at the keyboard (and/or possibly the edge of the laptop) Is there anything there that gives you information about what will happen when you use the keyboard to type something? And, as for the screen, there's something about its relation to how the mouse works that I'm looking for.
9:57 PM] Forgotten: ...I'm still a bit confused regarding layers
[9:57 PM] Forgotten: It's probably something super duper simple
[9:57 PM] NyanTheCat ﴾=^ᴥ^=﴿S: layers?
[9:58 PM] Forgotten: The second question
[9:58 PM] NyanTheCat ﴾=^ᴥ^=﴿S: I'm actually not very sure of what Doram meant either
[9:58 PM] NyanTheCat ﴾=^ᴥ^=﴿S: I just talked about hardware and software
[9:58 PM] NyanTheCat ﴾=^ᴥ^=﴿S: unless he meant like, that one thing for sending data over the internet?
[9:59 PM] NyanTheCat ﴾=^ᴥ^=﴿S: that had layers
[9:59 PM] Forgotten: I may already have the answer for the third question thanks to the hint
[9:59 PM] NyanTheCat ﴾=^ᴥ^=﴿S: but I forgot most of what I learned in IT Essentials somehow
[9:59 PM] Forgotten: I was thinking of something like Hardware > OS > etc something
[10:00 PM] NyanTheCat ﴾=^ᴥ^=﴿S: Doram will tell us how wrong we were later I guess
[10:01 PM] NyanTheCat ﴾=^ᴥ^=﴿S: anyway I'm outta here, good night
[10:01 PM] Forgotten: knight
[10:17 PM] Doram: You're on the right track with the OS...
[10:17 PM] Doram: layers of programming.
[10:21 PM] Venexis: My big issue is that I'm not really sure how much we're allowed to bring in from other sources lmao. Like is prior knowledge okay or should answers be derived specifically from course material
[10:22 PM] Venexis: I'd say don't sweat it tho, it sounded like there'd be a group review sort of thing after? and if nothing else an answer that was totally out of the ballpark could suggest there's merit in focusing on that in a later lecture
[2:56 AM] Doram: XD Yeah. You can look stuff up, and if you already know, I'm not going to fault you. I'm not sure how much is out there that will line up with the way I am doing this, or is free, but you're certainly welcome to try.(edited)
[2:57 AM] Doram: And, yes, I will spend some time discussing this stuff on Friday with everyone.
[6:22 AM] NyanTheCat ﴾=^ᴥ^=﴿S: ohhhhh layers of programming
[6:22 AM] NyanTheCat ﴾=^ᴥ^=﴿S: yeah I got that wrong lol
[6:30 AM] NyanTheCat ﴾=^ᴥ^=﴿S: I'll have to redo that
[6:31 AM] NyanTheCat ﴾=^ᴥ^=﴿S: what are the layers of programming though...
[6:31 AM] NyanTheCat ﴾=^ᴥ^=﴿S: first thing that comes to mind is the Model View Controller model
[6:32 AM] NyanTheCat ﴾=^ᴥ^=﴿S: or input and output?
[6:32 AM] NyanTheCat ﴾=^ᴥ^=﴿S: it must be something super simple and I just can't figure it out
6:51 PM] Forgotten: Ugh, can I just skip the second question because I still can't figure out what to write
[7:51 PM] Doram: Yes.
[7:52 PM] Forgotten: Okay
[9:11 PM] Shad: I can answer the bottom two as best possible without researching, but I'm clueless on the others
[9:11 PM] Shad: >mfw this is the one bit I didn't pay attention to in class last semester
[9:15 PM] Shad: This really isn't an answer to the I/O question, but theoretically you could invert a keyboard to have output in a way that someone could read it, right? Like with the new LED keyboards.
[2:03 AM] joshio0⃣1⃣: (Wonders if doram will go into idioms and metaphors)(edited)
[2:16 AM] joshio0⃣1⃣: (Assumes doram will not talk about how great VisualStudio is)
[2:38 AM] Doram: Not that kind of language. Machine language is the topic at hand, and No, I will not be talking about Visual Studio, as it is not free, and Micro$oft is usually a pain in my buttocks. I specialize in VBA and Access databases professionally, but that does not make me a fan.
[2:39 AM] joshio0⃣1⃣: fair enough.
[2:40 AM] Doram: Also, yes, theoretically, you could add functionality to a physical keyboard to increase the level of feedback, and the question was addressing physical keyboards, but software keyboards, such as the one on your phone, would obviously have MUCH more opportunity for feedback.
[8:33 AM] NyanTheCat ﴾=^ᴥ^=﴿S: @Shad the answer is a lot easier than that :stuck_out_tongue:(edited)
[8:34 AM] NyanTheCat ﴾=^ᴥ^=﴿S: Your ordinary keyboard already has an output
[8:34 AM] NyanTheCat ﴾=^ᴥ^=﴿S: That's my hint
User avatar
Doram
Global Moderator

 
Posts: 1524
Joined: February 22nd, 2010, 7:37 pm
Location: Wherever I'm needed.

Cookie
l.m: "For fixing the stuff I break, and for being the best Forum Dad. XOXO <3"

Thumbs Up given: 153 times
Thumbs Up received: 471 times

Re: Doram's Programming Class - Discussion

Postby Doram » February 10th, 2017, 4:42 pm

I didn't expect people to have as much problems with this as they did. Not your fault, it's mine. But it DID get some conversation sparked, which was the point, so let's just get these out there.

Doram's Answers: show
Question 1: Now, we'll definitely get into it more in the coming lessons, but does everyone get the general idea of breaking everything down to math?

A computer is truly nothing more than a glorified calculator. Everything more complicated that you see it do has to go through layers upon layers of programming to put what is never going to be more than ones and zeroes into something that is useful and understandable to us.

Question 2: Does everyone understand generally how the layers of a computer's systems work?

A computer at it's core is, as I said, a bunch of chips for processing math. The first layer on top of that is the operating system. The operating system is designed to run the computer in the barest sense, routing information from all i/o devices back and forth to each other, as well as coordinating the operation of all the associated hardware. That coordination is not just the pure electrical coordination, but also the first visible layer, which comes in two forms: A user interface for the user to control aspects of the system (like system settings to adjust how your mouse responds to you), and a programming interface to allow programs to control the hardware to perform specific tasks (like hooks for the modem on your computer, so that games can use it to connect to the internet for online play).

The next layer on top of that is programming languages that are used to create programs, which give structured and human readable ways to connect to those hooks. Many times you are several layers of programming deep when you are writing a program, especially in web design. The program you are using to write your program, is itself a program, which then uses it's own language to convey what you are asking for to the system below.

The final layer is the specific program you are running (like a web browser or a word processor). This will also have some programming of a kind to it, although very focused and very filtered (such as changing the settings for MS Word like your initials or default margin sizes, or installing Add-ons to your web browser or re-arranging the buttons on the top)

Question 3: Ok, can anyone tell me how a keyboard can be an output device, in other words, how can the keyboard tell you what a computer is doing right now?

The keyboard has a light on it to tell you if the caps lock and number lock are on. And, especially for wireless thing, they will also often have lights on them to tell you about the status of their batteries. The screen also impacts input because the range of coordinates for the mouse position depend on the resolution of the screen.

Question 4: What other reasons are there, as to why is an interface important? What makes a good interface?

The interface is the gateway to your program. If your interface is unusable, it doesn't matter how brilliant your engine is, nobody will want to use your program. Usually, if the interface gets in the way of the task at hand, they will give up entirely or go and get some other program that will do it better, to their mind. If you are making money by selling your program, this means you have just lost money.

  • A good interface is intuitive: It is customized to the task at hand, and does work for the user, when that work is predictable.
  • A good interface feels familiar/uses familiar language: There's plenty of history of interfaces out there. If you're designing a video player, you use the symbols that have been in use for decades. There's no need to explain , , . The same goes for a lot of stuff. Know your target industry well, an duse the established language that's there, and your interface will be easy for just about everyone to use.
  • A good interface is visually appealing: I hate to say it, but if it doesn't look good, a portion of your audience will walk away for as shallow a reason as that. It's worth investing at least a little time in.
  • A good interface is responsive: Lag and related latencies of any form are a hindrance to general computing, and while sometimes it's the engine, sometimes it's the interface. Kill that little gremlin before he causes any real trouble.
Ven's Answers: show
Q1: Computers love math, but hate words; humans understand words but maths baffle them. Therefore you need to stick your words through a math-translator if you ever need to ask a computer a favor.

tl;dr: I cheated the sentence count with that semicolon. Teehee~

Q2: Aight so basically you (read: generic human person) type things into your computer in a form more or less comparable to simplified language before running it though a compiler which reduces the human-readable syntax to much more awful machine-readable binary. (Most before this point can be considered the interface level; everything after, engine/logic level.) Then you end up in a freaky twilight zone where binary bits correspond to the state of a transistor, and maths take place through my favorite thing ever, Boolean algebra.

tl;dr: pseudocode --> higher level programming language --> ||THE GREAT SCARY DIVIDE OF DIRECT INTERACTIBILITY|| --> raw binary --> comparative maths on physical circuits. Hella rad stuff yo.(edited)

Q3: I just want to say that this question stumped me real good because my computer HAS NO NUMLOCK OR CAPS LIGHT for real who designs a computer without these things. But then I got to thinking about how Chau used his numpad enter for certain games and I was like, oh yeah doesn't that break if numlock is on? And then I remembered a long-distant age when I could immediately pinpoint the problem when my computer said to check my caps lock when my password didn't work, and realized that lights (and therefore the keyboard they're part of) can be used as output tools to inform the user of things like that.

Mice, pretty much the same thing. I remembered Chau had posted a mouse online that lit up to correspond with things you told it to like internal CPU temperature 'n' stuff. Also mine is wireless and flashes blue at me when the batteries are getting low, which is never really passed on to my computer (except arguably in cases where batteries being dead result in a complete lack of cursor movement, heh) so therefore it's also output.

Not really sure what you're expecting for screens. Only thing I can think of (apart from the obvious lack of visuals when your screen is off making the effectiveness of mouse movements or keyboard shortcuts much harder to evaluate) is screensavers. Usually a mouse or keyboard input just clears the screensaver instead of doing its intended function.

tl;dr: I could not have done this without Chau. Thanks Chau you're a real cool kid.(edited)

Q4: An interface is useful as it is essentially the maths-translator from Q1. It provides (at the barest level) a method for humans to type in a recognizable format what they want the computer to do. Not only is code creation easier, it's also easier to troubleshoot without the total loss of sanity [citation needed] that would result from attempting to fix a bug in a straight up string of ones and zeroes. Higher level interfaces can provide more complex functions (something like the Assembly language has only a handful of very basic functions, but a higher level language like Python may allow the use of a more complicated elseif function without requiring the user to write it entirely from basic functions), may attempt to troubleshoot for you, and can result in more "standardized" code by ensuring (through larger functions) that smaller sub-functions happen certain ways.

tl;dr: Words cannot express how much I hate troubleshooting code. Anything that makes it easier is okay by me.(edited)
Nan's Answers: show
1. What a computer's processor largely does is run math operations. Pretty much every process involves variables and values that are worked with, every pixel on the screen has numbers that represent many different things. Every character you write down has a value assigned to it, everything is numbers that are crunched down to binary then fed to the processor so it can turn them into information that's useful and understandable to the user afterwards.

Short version: Every value and variable involved in computer processes, every input and output, can be reduced to numbers.

2. Hardware-wise, a computer is made out of a motherboard to which many things are connected, like the CPU (Central Processing Unit), the Hard Drive, RAM cards, graphics cards, proper ventilation, chips, power supply thingy, the ROM, all the peripheral connections and many other things I can't remember that are nicely collected into a case. The computer also comes with a monitor for output and a keyboard and mouse/touchpad/whatever for input. Many other peripherals can be used.

Software-wise you got the BIOS, the Operating System and the various programs and apps and stuff, information and various variables and values and other data. I don't remember everything from my IT Essentials course.

3. A keyboard can tell you if you got Caps Lock On, Numpad Lock On or Scroll Lock On. A mouse can light up to tell you it's on, if it's wireless it can show you how much battery it has left. The screen's information can make you input things differently or tell you that information is wrong.

4. Short version, interface is important because the average user is dumb and attracted to shiny things. An interface has to be convenient for the user, easy to understand, display all important information, and be easy to interact with. Being aesthetically pleasing is also relatively important, the colors of the interface have to be easy on the user's eyes. To design the interface one must take the needs of the user into account first and foremost.
Forgotten's answers: show
Forgotten: Hey, sorry for the late answers. I was unsure about sending them since they probably sounded dumb...

1: Because math is pretty much what computers do/understand? Like storing variables, adding to those variables, comparing them to other variables and then following instructions according to those variables/numbers (like if/else)?

2: I couldn't figure this out...

3: If the keyboard can be an "output device" I'm thinking it's because I can tell when caps/num lock is currently enabled, or when the keyboard layout has been changed (although the latter will require me to actually type).
As for the screen and mouse, because I can't move the cursor beyond the edges of the screen?

4: Well I'm just kinda assuming "interface" here refers to user interfaces such as software. Like, a graphical user interface is important because I can't interact without it.
Yuri's Answers: show
Q1: By methods of mathematical operations, we can command a computer to do anything, since math is the language we use to measure and count everything in our world as well. By making a computer follow that language, it can, after more or less amounts of equations, do what you want it to do, no matter what it is, because literally everything can be broken down into math.

Q2: I'm not sure of how to word this, but I grasped the concept. For what I caught, the Engine and the Interface are two layers, dependent of one another, and within the interface there are two layers: That of the programmer, and that of the user, which is the "exterior" one, and what displays the final result.

Q3: For the keyboard, I suppose the light that appears on the keys when you press number lock or scroll lock are indicators of what's happening on the computer. Touchscreens are both input and output devices too. For the mouse though, I actually have no idea.

Q4: An interface must be able to communicate what the programmer wants to do to the machine, so it can perform that action. For it to be good, it must be able to translate the most amount of commands possible.
OJ's Answers: show
[Q1]
Math is the (raw) language of science, and science is the method by which we account for actions and interactions that take place in the universe. Ergo, to interface with machines and control/produce artificial actions and interactions, we work backwards, although we obviously can't start with an abstract concept like pure mathematics, so we cheat by making use of electrical signals, and build up from there into binary logic, then move on to more complex structures, and this is a massive runon sentence.

[Q2]
Humans played with semiconductors and found out that they do cool stuff that let us control the flow of electricity based on certain inputs.

Then we made transistors and logic gates out of them, allowing us to interpret binary electrical signals (essentially on/off pulses) and send them to outputs--the basis of combinational logic.

Then we started using the power of delays and logic gates to make flip-flops and latches--the building blocks of sequential logic--and the first computer memory was born, allowing binary data to be stored electronically.

From those were created processing units of increasing complexity, which are capable of performing various operations that are input from some user-specified program. Programs were first physical objects, as punchcards to represent binary signals in the form of Holes and Absences Of Holes. It would later start to be permanently stored as read-only memory (ROM). Eventually, we started to store these programs themselves virtually and temporarily on hard disks (using magnetic data storage), with input interfaces like keyboards (and an output interface in the form of a digital light display, pixels turning on or off) letting the operator punch (haha) in their own machine code, which would be interpreted by the CPU.

Then another layer of abstraction was added with the development of programming languages, though they were first very low-level like Assembly. Still, it was leaps and bounds better than binary punch cards or machine code, because it was closer to the ideal goal--speaking in natural human language to the computer, and having it respond appropriately. Higher levels of programming languages were built off of this as their own sort of programs, in the forms of compilers and interpreters. At the same time, portable data storage was becoming a thing in the form of floppy disks, another magnetized data storage device like hard disks. And i/o devices grew more advanced, as monitors started using multicolored pixel displays, and Graphical User Interfaces were developed for use with keyboards, and then computer mice to operate them even more conveniently. But computer programming languages were still only a locally usable thing, or at least only usable by computers of the same model...

...so Operating Systems became a thing, a general-purpose abstraction of all of these things. And cross-platform languages were born, using a single standard form of a programming language across all OSes, which would be processed all the way down to that specific machine's version of machine code, and then transmitted into electrical signals.

There's also other specific components I didn't touch on like RAM, motherboards, sound/video cards, network interface controllers, etc... and that's probably because I don't entirely understand how they work or fit into the timeline in a way that I can neatly put them into my messy attempt at a summary. But the gist of it, as articulated by Von Neumann, is that input devices transfer data to the computer. The computer has a central processing unit, containing a control unit and an arithmetic/logic unit, which processes the input and passes data between itself and a separate memory unit (sometimes including portable devices like floppy disks, optical disks, flash drives, SD cards...), and ultimately to output devices.

This was probably a bit more historical of an answer than necessary but the idea is that once the core of an engine is built, the engine can be expanded (in terms of processing power and capability; ideally they'll keep shrinking in physical size, a la Moore's Law, though quantum mechanics might limit that), and an interface can be built on top of it to make the engine more user-friendly. And then we can use more abstract, natural interfaces to interface with those interfaces...

Neat.

[Q3]
A lot of keyboards have lights on them for toggle buttons (num lock, caps lock, scroll lock), which is the main way they can output information. More advanced ones might have customizable backlights, or other displays that can, well, display data. I know for a while when I was a kid my dad had this cool keyboard with a miniature monochrome screen built into it that would display the time and computer volume and stuff. If you have a really fancy keyboard, it might be able to vibrate or play audio or something, iunno. Keyboards can also have extra input keys, though basing software heavily off of inputs from anything nonstandard is probably a bad idea, because you can't expect users to have the specific hardware that you have.

Mice--same idea. More buttons on the sides are often used for more inputs (like back/forward buttons), and a lot of them light up for various reasons now. Woohoo.

Screens usually have buttons for the power toggle, brightness/contrast adjustments, and often other display settings. Sometimes they also have built-in webcams and microphones, especially on laptops. Sometimes input can be processed automatically, like how a lot of smartphones can detect changes in lighting with a camera or other light sensor and auto-adjust their brightness. The advent of touchscreens (the physics of which are hella rad but going into detail about the various types would probably be preaching to the choir here) is another way by which input can be processed through screens, basically averting the need for a mouse or keyboard on portable devices, and functioning as a convenience on tablets and touchscreen laptops/monitors.

[Q4]
Mostly you'll get a lot of user complaints (or worse, just a lack of users) if your interface isn't functional, so good interface design is really crucial for marketing purposes. This is probably why the Art part of the STEAM acronym has started being stressed lately in education, because it encompasses the realm of design, which is really important if you want your stuff to go anywhere at all. Interfaces should feel natural and easy and repsonsive to use, not clunky, not laggy, not finicky, not unresponsive, not uncomfortable, not (insert any adjective you've seen in a negative review of a product before).


Answer Discussion on Discord: show
[8:01 PM] joshio01: Everybody got it mostly right!
[8:01 PM] joshio01: horay!
[8:02 PM] Doram: XD
[8:02 PM] joshio01: (more than I can say for my programming class)
[8:02 PM] Doram: I'm not gonna tell you this stuff is wrong, because we're talking about very general stuff that you can interpret a bunch of different ways.
[8:03 PM] Doram: And when the time comes, the computer will tell you something's wrong by resloutely refusing to work.
[8:03 PM] ~Yuri: I didn't quite understand what you meant by interface, so I guess that interferred on my answer
[8:03 PM] ~Yuri: I think I get it now at least :P
[8:04 PM] joshio01: so...what do we discuss now?
[8:05 PM] Forgotten: I didn't even answer the second question
[8:05 PM] Doram: Well, you've read all the answers, do you have questions now?
[8:05 PM] Forgotten: At least I think I was pretty close for the first and third questions
[8:05 PM] Forgotten: Not yet
[8:05 PM] joshio01: I like ven's answers.
[8:06 PM] joshio01: the rest are too sensible.
[8:08 PM] joshio01: so...what's our next topic doram?
[8:09 PM] joshio01: is it bits?
[8:09 PM] Venexis: I'm required to like my answers too by default
[8:09 PM] joshio01: is it more UI stuff?
[8:11 PM] Forgotten: tfw I have the shortest answers
[8:11 PM] Forgotten: I was originally going for longer answers but they felt too lengthy in my opinion
[8:12 PM] ~Yuri: Actually, this prize goes to me Forg :3
[8:12 PM] Doram: Next up is getting into language general concepts, and I'm not quite done with it. Language Metastructure and Pseudocode
[8:12 PM] ~Yuri: Actually, not
[8:12 PM] Forgotten: But... yours were longer
[8:12 PM] ~Yuri: I take the silver medal on that
[8:12 PM] Venexis: Are you going by word count or absolute length though
[8:13 PM] ~Yuri: Both
[8:13 PM] Forgotten: Probably both
[8:13 PM] Doram: Forgotten is the only one that got what I was suggesting with the screen in question 3, though.
[8:13 PM] Venexis: oh yeah the first line is not an answer on yours, Forgotten, heh
[8:13 PM] Forgotten: Didn't everyone else get the thing about caps lock too
[8:14 PM] Forgotten: Oh, the screen
[8:14 PM] ~Yuri: Well, I'll give myself a half point on the screen one :P
[8:14 PM] Doram: Yes, even Ven, who was apparently handicapped.
[8:14 PM] Venexis: Very nearly didn't because seriously, not a single light on my keyboard lmao
[8:14 PM] ~Yuri: My keyboard also has no lights
[8:14 PM] ~Yuri: I know that some do though
[8:15 PM] Venexis: Screen resolution is good tho, never would've thought of that ever because you can't even really change the default res on a monitor that's already as small as possible
[8:15 PM] joshio01: I was thinking of the caps lock buttons.
[8:15 PM] joshio01: like ven
[8:16 PM] Forgotten: Caps lock was the first thing that came to mind but it sounded unlikely to me until the hints were posted
[8:16 PM] Doram: Well, yes. The caps lock was right, but I also asked about mice and screens.
[8:16 PM] Venexis: Still had to doubletake 'cuz I'd always assumed each pixel was just mapped one to one with coordinate position and that the not being able to move off screen was a result of an inability to have negative coordinates instead of like, any fancy communication with the mouse
[8:16 PM] ~Yuri: I was actually going to go with a really... different answer that had nothing to do with anything
[8:16 PM] Venexis: Oooh, what was it <3
[8:17 PM] ~Yuri: That the actual indication was the sounds made by the keys and the clicking of the mouse
[8:17 PM] ~Yuri: But that didn't indicate anything of what was happening in the computer at all
[8:17 PM] ~Yuri: I was seriously considering leaving that one blank
[8:17 PM] Venexis: Mmmm tactile feedback
[8:17 PM] Doram: Well, ultimately, the screen thing is a conversation between the mouse drivers and the screen drivers that determines how to interpret signals coming from the mouse.
[8:18 PM] Venexis: What if you can tell if there's something stuck under your key (meaning lack of letters appearing on the monitor) by the absence of a satisfying depression and/or click
[8:18 PM] Doram: Stupid breadcrumbs...
[8:18 PM] Venexis: random crumb best output device by proxy
[8:19 PM] Forgotten: My second answer to that was the changing of the keyboard layout, but on second thought that requires user input first
[8:19 PM] Doram: Well, the capslock requires user input too.
[8:20 PM] joshio01: everything does.
[8:20 PM] Doram: But the point is that if you don't remember what the last thing you did was, it will be telling you, and that flow of information out of the thing is what I was talking about.
[8:20 PM] joshio01: unless you forgot to turn your computer on.
[8:20 PM] Forgotten: But there's an indicator on some keyboards that tell you caps lock is on
[8:20 PM] Venexis: The light is just a state indicator though. For all intents and purposes the fact that the light exists (and presumably functions correctly) the necessity of user input to change the state is irrelevant- the light tells you what state it's in all the time.
[8:20 PM] Forgotten: Nothing tells you about the layout
[8:21 PM] Doram: Well, programming the keyboard was brought up, and I agreed that software keyboards are a horse of a different color.(edited)
[8:22 PM] NyanTheCat ﴾=^ᴥ^=﴿S: I got the keyboard output idea pretty fast
[8:22 PM] Doram: They RELY on changing the look of the thing, from caps to symbols, to whatever, all in the same space, with the same format.
[8:22 PM] Forgotten: I did briefly think about the cursor speed for the mouse, though ultimately that's still the screen showing that
[8:23 PM] Doram: I have also seen keyboards and mice that will have flashing lights that pulse to music, or otherwise can be changed around in different patterns.
[8:24 PM] Doram: And, actually, yes, Forgotten. That's another conversation between the mouse drivers and the screen drivers.
[8:24 PM] joshio01: my keyboard can light up.
[8:24 PM] Doram: And, like I said, I was looking for how the screen can affect input, and the cursor speed is another good exmaple of that.
[8:25 PM] Doram: The cursor speed is meaningless without information about the screen.
[8:27 PM] Doram: If you wanted to really push the concept, you could also talk about drop down boxes and radio buttons, that are differentiated mostly by how they look.
[8:28 PM] Venexis: What if you hook your mouse up to a car battery, and write a program that, whenever you touch the borders of your screen, sends the sheer might of said battery into two electrodes on the mouse buttons
[8:28 PM] Venexis: so like 12 volts but
[8:32 PM] Doram: Anyways, the point of all this is to get you thinking about all the different ways this stuff can communicate, to give you inspiration for interfaces and ideas about how computers can communicate with us.
[8:34 PM] Venexis: I learned that:
[8:35 PM] Venexis: -my scope of interface was way too small
[8:35 PM] Venexis: -I definitely hate troubleshooting code
[8:35 PM] Venexis: -this is all hella rad
[8:50 PM] Doram: Ok, I got stuff cropping up that needs my attention. I'm calling this done.
[8:51 PM] Doram: If anybody has any further comments or questions, they can post here or in the thread. We'll start lesson two at the beginning of next week.(edited)
Martin Luther King Jr. wrote:Man must evolve, for all human conflict, a method which rejects revenge, aggression, and retaliation.
The foundation of such a method is love.
More words from a wise man on activism, terrorism, violence, and peace
User avatar
Doram
Global Moderator

 
Posts: 1524
Joined: February 22nd, 2010, 7:37 pm
Location: Wherever I'm needed.

Cookie
l.m: "For fixing the stuff I break, and for being the best Forum Dad. XOXO <3"

Thumbs Up given: 153 times
Thumbs Up received: 471 times

Re: Doram's Programming Class - Discussion

Postby Doram » February 17th, 2017, 4:03 pm

0010101001010100101010101010100111010011001011010100010001011110100100101010111110011010100110011101110100111101010101010101001001010101010101010101010000111110101001010101010101010101010101001010101010101010101010101010101010101001010101010101010101010010101101001010010101001011011001010101010101010101010101010010101010101010010101010101010
Lesson 2:
Language Metastructure and Pseudocode
Discussion

01010101000101010010101110111010111001010010100010001010101010010101010101010101010101010010000101101011011111101010010110110101010010101001010101011101001101010101010101010010001010101111100101010100101010101001010101010101001010101010010101010101010101010101101001010010101010101011110101010101101010100101010101001010101010101010101010010110101001010101001010101010


Part 1: Universal Features of Programming Languages


Link to Today's Materials

Question 1
How would you decide if the string "Hello" was greater than the number 3?

Question 2
What would be the difference between testing for a condition at the beginning of a loop and testing at the end of the loop?

Question 3
What kind of tasks would be best for a branch structure like if-then-else, and which tasks would be best for a loop like for-next or do-while?

Discord Discussion Transcript thus far: show
February 17th, 2017
[7:10 PM] Forgotten: Hmm, I don't think it was possible to compare strings to numbers, well at least not in GML
[7:11 PM] Ven: you could probably take the 3 as a string and then evaluate length
[7:11 PM] Ven: or convert every character in the respective string into hex or something and sum
[7:11 PM] Forgotten: Unless comparing the length to the number, or the ASCII numbers of the individual letters is a solution but I doubt(edited)
[7:11 PM] Ven: I should probably not be saying words hee
[7:12 PM] Forgotten: Well in the latter case it's definitely larger than 3
[7:13 PM] Ven: all in all I think these are easier than the last batch, haha
[7:15 PM] Doram: Harder text, easier questions?
[7:15 PM] Doram: Also, if you have any questions about this, bring it.
[7:15 PM] Ven: I think easier overall, lul, but maybe because these are less objective
[7:16 PM] Ven: things that don't have definite answers bother me only slightly less than things that don't have answers. :p
[7:19 PM] Forgotten: I might be able to answer the third question, I'm not entirely sure about the first question apart from the two possible answers already mentioned above
[7:21 PM] Doram: Well, there are a number of ways to approach Q1. I suppose it depends on what's more important to your process.
[9:06 AM] Doram: also, good news. I know exactly what to program as the result of this class.
[9:07 AM] Doram: Something to calculate Runouw Survivor/Hunger Games posts.(edited)
[9:09 AM] Doram: We'll all program something separately, show it to each other and discuss, and put the best parts of each together into the final product.
February 20th, 2017
[9:01 AM] Nan: Am I gonna have to learn Visual Basic for this?
[9:13 AM] OranjuGlad2BMyValentine: I severely doubt doram would want to teach something that impractical
[9:13 AM] OranjuGlad2BMyValentine: iirc he's planning on javascript, but something like python would be good too
[5:37 PM] joshio01: ^
[5:38 PM] joshio01: wait what?
[5:38 PM] joshio01: he's not gonna teach it, but visual basic is actually pretty good.
[5:39 PM] Nan: :joy:
[5:57 PM] OranjuGlad2BMyValentine: Oh my sweet summer child
[10:29 PM] Doram: A ) I know Visual Basic (specifically VBA as applied to MS Access Databases, though regular VB wouldn't be a stretch), JavaScript, a decent amount of Java, and a fair amount of PHP. With time, I can figure just about anything else out.
[10:29 PM] Doram: B ) The PLAN was to teach JavaScript, mostly because it requires NOTHING in terms of install and playtesting.
[10:30 PM] Doram: Now, once we're done with JS, if people want to learn some VB I can do that as well, but that will be bonus.
February 23th, 2017
[10:22 PM] joshio01: I heard that computers only work in radians for angles. why is that?
[10:23 PM] joshio01: @Doram ?
[10:25 PM] joshio01: (bet it's because of dumb calculus stuff)
[10:28 PM] KABOOM: I think it's like the difference between Celsius and Fahrenheit, or metric vs imperial
[10:43 PM] Doram: http://math.stackexchange.com/questions ... n-calculus
Why do we require radians in calculus?
I think this is just something I've grown used to but can't remember any proof. When differentiating and integrating with trigonometric functions, we require angles to be taken in radians. Why doe...
[10:44 PM] Doram: TL;DR It's because degrees are made-up, and radians are a direct mathematical progression of definition from the radius.
[11:13 PM] Doram: Direct equations will get you in and out of radians quickly, but you have to do extra work to translate into degrees.
[11:19 PM] Oranjui: Radians are natural units (based on circle proportions), degrees are arbitrary manmade units (base 360? wtf)
[11:20 PM] Oranjui: You can't even properly compare it to something like Celsius/fahrenheit or metric/imperial, since all of those are arbitrary manmade systems too
[11:22 PM] Oranjui: A radian quantity is a pure number, an exact proportion of how much of a circle you've rotated relative to a reference point. Degrees measure the same thing but attach a completely arbitrary scale
[11:23 PM] Oranjui: It might be closer to something like the metric system vs Planck units
[1:21 AM] Ven: also unrelated but radians, like fractions, are just good. As compared to every alternative, which is ♥♥♥♥.
[1:29 AM] joshio01: (decimals aren't ♥♥♥♥)
[1:29 AM] joshio01: (unless you're talking about 99.9999999999999999999999999999% of numbers)
[7:41 AM] Oranjui: decimals are just approximations
[11:34 AM] Doram: .9999repeating = 1. Yes, equals. Yes, it's been proven, mathematically, through several different equations. Universal truth. Math is fuzzy.
[1:10 PM] Ven: unfortunately I just can't be assed to write like, 0.3[insert infinity more 3's here] partly because there is no sheet of paper in the universe big enough to do so even a single time and mostly because I just really hate anything longer than the easily mathed 1/3
[1:11 PM] Ven: fractions are the complete package. I'd wife them.
Martin Luther King Jr. wrote:Man must evolve, for all human conflict, a method which rejects revenge, aggression, and retaliation.
The foundation of such a method is love.
More words from a wise man on activism, terrorism, violence, and peace
User avatar
Doram
Global Moderator

 
Posts: 1524
Joined: February 22nd, 2010, 7:37 pm
Location: Wherever I'm needed.

Cookie
l.m: "For fixing the stuff I break, and for being the best Forum Dad. XOXO <3"

Thumbs Up given: 153 times
Thumbs Up received: 471 times

Re: Doram's Programming Class - Discussion

Postby Doram » February 27th, 2017, 12:29 pm

Well, not many people could get answers submitted this time, but we might as well discuss what we've got.

Doram's Answers: show
Question 1: How would you decide if the string "Hello" was greater than the number 3?
It was discussed briefly in the thread, a couple of ways, but my list is this:
  • Compare the number to the hexadecimal or other numeric equivalent of the first character in the string.
  • Compare the number to the hexadecimal or other numeric equivalent of the sum of all characters in the string.
  • Compare the string converted length of the number to the length of the string, either by converting 3 to "3" ("Hello" is longer and therefore bigger) or 3 to "three" ("Hello" is the same number of characters and equal). (Or, if you really want to get esoteric, convert 3 to "three", and then figure out which comes first alphabetically - H comes before T.)

Question 2: What would be the difference between testing for a condition at the beginning of a loop and testing at the end of the loop?
Short answer: Testing at the end makes sure that the loop is executed once.
Long answer: It's the difference between asking "Do I have to do this at all (and maybe repeat)?" and asking "I know I'm going to do this once, but should I do it again?". To put it in other words, it is the difference between it being ok to have zero outputs - test at the beginning, or you NEEDING at least one output - test at the end. Testing for the comparison at the beginning of the loop makes it skip the loop entirely when it fails. Testing the condition at the end of the loop, merely stops repeating when it fails, after completing it at least once.

Question 3: What kind of tasks would be best for a branch structure like if-then-else, and which tasks would be best for a loop like for-next or do-while?
The two are very different structures meant for different kinds of situations. Branches like if-then give your code the chance to decide to do different things depending on input or environment. Loops like for-next give your code the chance to repeat a process when it is dealing with a group of similar situations, like processing a bunch of variables in an array. The truest difference is whether you know the situations will be similar or not. If you walk down a hallway and have to decide to turn left or right, you have no idea what each hallway holds or connects to when you make the choice. (Sneaking mission - if there is noise coming down hall from one direction and not the other, go down the quiet hallway.) But if you are walking down the rows of a library picking a book to read, you know that you will be making a bunch of practically identical decisions about similar things. (Do I want to read this book - Yes/No? No. Next book. Do I want to read THIS book - Yes/No? Yes. Take book out, leave library.)
Forgotten's Answers: show
1: I'm not sure how you'd compare a string to a number unless the string contains numbers, but I can think of several possible ways and they all involve some kind of conversion. Maybe comparing the length of "Hello", which is 5, to 3? Or converting each individual letters in a string to an ASCII number, so "H" in "Hello" is 72, "e" is 101, and so on, and then comparing those numbers (either one of the individual letters or the sum of all letters) to the number 3.

2: Suppose this is referring to the condition tests in "while" and "do" loops respectively (at least that's how Game Maker separates the two). The only real difference I see here is that the code is always executed at least once if the test is done at the end of the loop ("do" loop in GML).

3: I use if-else statements for pretty much everything else that doesn't require a loop. Things that I do need a loop for includes the basic stuff like counting, or setting up an array (where every variable gets the same value) without having to literally initialize every variable in it.
...or to let the computer pick a random value continuously until it picks one that is allowed, such as picking a random character without picking one who's not unlocked yet.
Ven's Answers: show
1) The easiest solution I can think of for this would be to have a chunk of code that rigorously defines the objective superiority of one data type over any other. You could artificially create any arbitrary hierarchy of "data type importance" and then run a simple comparison test to match them up in accordance with that. Alternate methods might include converting all variables to strings and then comparing character length (Hello would win), breaking down every individual character into a numerical ASCII counterpart and then summing (Hello also wins), etc. That's all I can think of, not counting the various methods of representing individual characters that you could sum.

2) The outcome of the test may be altered by the function of the loop. If a block of code is configured to add 1 to the main character's health points for (maxHP-currentHP) iterations, a test for whether the main character can withstand an axe strike dealing 30 damage may result in a game over before the loop but only a slight inconvenience afterward. I somehow feel like I'm missing a big point here... but can't for the life of me figure out what.

3) If-else functions are best for cases where sequence is important, or for handling extraneous cases. If you want to know if your main character will take damage in a battle, you might want to consider IF he has any armour equipped, then (if the previous condition was false) if he's drank any defence potions, ELSE, he takes damage. They are also good for catching errors... if the program is working fine, continue; else, toss a big ol' error. Do-while functions are better for cases where an action needs to be done a certain number of times, without regard for sequence. For example, if your main character drinks a defence potion, the game might grant a 2x buff to defence (DO), but only WHILE the character has taken fewer than three turns since quaffing it, without giving any thought to whether or not he's wearing armour.
Martin Luther King Jr. wrote:Man must evolve, for all human conflict, a method which rejects revenge, aggression, and retaliation.
The foundation of such a method is love.
More words from a wise man on activism, terrorism, violence, and peace
User avatar
Doram
Global Moderator

 
Posts: 1524
Joined: February 22nd, 2010, 7:37 pm
Location: Wherever I'm needed.

Cookie
l.m: "For fixing the stuff I break, and for being the best Forum Dad. XOXO <3"

Thumbs Up given: 153 times
Thumbs Up received: 471 times

Re: Doram's Programming Class - Discussion

Postby Doram » March 6th, 2017, 11:16 am

0010101001010100101010101010100111010011001011010100010001011110100100101010111110011010100110011101110100111101010101010101001001010101010101010101010000111110101001010101010101010101010101001010101010101010101010101010101010101001010101010101010101010010101101001010010101001011011001010101010101010101010101010010101010101010010101010101010
Lesson 2:
Language Metastructure and Pseudocode
Discussion

01010101000101010010101110111010111001010010100010001010101010010101010101010101010101010010000101101011011111101010010110110101010010101001010101011101001101010101010101010010001010101111100101010100101010101001010101010101001010101010010101010101010101010101101001010010101010101011110101010101101010100101010101001010101010101010101010010110101001010101001010101010


Part 2: Types of Programming Languages


Link to Today's Materials

Question 1
When would it be better to use more primitive languages over more complex ones (such as a Procedural one versus one designed for Object Oriented or Event Driven approach)?

Question 2
What other situations can you imagine that would work well with just Server Side code?

Question 3
What other situations can you imagine that would need a combination of both Server Side and Client Side code?

Question 4
Have you come across any good websites that teach people to program (aside from the 3 I linked in the text)?

Discord Discussion Transcript thus far: show
Martin Luther King Jr. wrote:Man must evolve, for all human conflict, a method which rejects revenge, aggression, and retaliation.
The foundation of such a method is love.
More words from a wise man on activism, terrorism, violence, and peace
User avatar
Doram
Global Moderator

 
Posts: 1524
Joined: February 22nd, 2010, 7:37 pm
Location: Wherever I'm needed.

Cookie
l.m: "For fixing the stuff I break, and for being the best Forum Dad. XOXO <3"

Thumbs Up given: 153 times
Thumbs Up received: 471 times

Re: Doram's Programming Class - Discussion

Postby Doram » June 29th, 2017, 9:54 pm

0010101001010100101010101010100111010011001011010100010001011110100100101010111110011010100110011101110100111101010101010101001001010101010101010101010000111110101001010101010101010101010101001010101010101010101010101010101010101001010101010101010101010010101101001010010101001011011001010101010101010101010101010010101010101010010101010101010
Lesson 2:
Language Metastructure and Pseudocode
Discussion

01010101000101010010101110111010111001010010100010001010101010010101010101010101010101010010000101101011011111101010010110110101010010101001010101011101001101010101010101010010001010101111100101010100101010101001010101010101001010101010010101010101010101010101101001010010101010101011110101010101101010100101010101001010101010101010101010010110101001010101001010101010


Part 3: Pseudocode


Link to Today's Materials

Question 1
What kind of structures did you notice in the pseudocode that we ended up with?

Question 2
What kind of variables and such would you suggest to make this more code-like? Could you make the logic more efficient in any parts?

Question 3
Did you find the flaw in my pseudocode? It WILL fail at one point. Where and why?
Martin Luther King Jr. wrote:Man must evolve, for all human conflict, a method which rejects revenge, aggression, and retaliation.
The foundation of such a method is love.
More words from a wise man on activism, terrorism, violence, and peace
User avatar
Doram
Global Moderator

 
Posts: 1524
Joined: February 22nd, 2010, 7:37 pm
Location: Wherever I'm needed.

Cookie
l.m: "For fixing the stuff I break, and for being the best Forum Dad. XOXO <3"

Thumbs Up given: 153 times
Thumbs Up received: 471 times


Return to Programming