I struggle to understand technical things in cs? What can I do to improve? Today I wanted implement a deep learning model in openvino. So I went to the page here and started reading. After starting the reading, I struggle to understand things and started to deviate a lot from my objective. For example:

Speeds time-to-market via an easy-to-use library of computer vision
functions and pre-optimized kernels

what are pre-optimized kernels?

Includes optimized calls for computer vision standards including OpenCV*, OpenCL™, and OpenVX*.
What are optimised calls?

Intel® Media SDK  Offers access to hardware accelerated video codecs
and frame processing

what is SDK?

A set of simple console applications demonstrating how to use the
Inference Engine in your applications

what is console appplications,inference engine?

I am not a CS graduate. What can I do to improve, should I take a CS curriculum? Sometimes I exactly don't understand certain things, but I proceed with a rough idea. Am I trying to understand in detail here? I don't know, because I am perfectionist. Else what can I do to improve?
EDIT: The  related answer is quite good. But I wanted to know, how to approach a concept where we need to understand the theory. Sometimes you may need to understand what is happening behind it before implementing it. What can one do in such cases?

Here are two pianists

Lovely lady 1
Lovely lady 2

Do you realize no 2 was once no 1?

Here's an In between  stage

To get a handle on the issue you need
ten thousand hour rule

You can reduce 10,000 hours to 1000 hours and go from world class to normal professional. Perhaps 1000 to 100 and go from professional to modestly proficient.

But even@100 that's about classroom time of two typical university courses.

Put another way musical proficiency takes about 10-15 years of work, medical 5-10.
Computer/software takes 3-4. Maybe you can reduce 3 to 1.

Have you put in that 1 gruelling year of work?


Presenting Mapping Reducibility (for P vs NP) So, I am preparing to teach about P and NP for the first time.  I know that I need to teach about Mapping Reducibility (aka One-to-One Reducibility).  Can anyone recommend a set of algorithms that are easy to use to clearly illustrate the idea?  The algorithms in this first brush with the topic don't, themselves, have to be NP - I just want to show a remapping that is extremely clear in order to impart the concept.

Considering that you teach HS students, many of the reduction examples "off the market" might be conceptually a bit too complex, and can be confusing even for many college students.

I'd suggest that you choose an example between very similar problems, like the (polynomial time) reduction from 4SAT to 3SAT.

So, what are 4SAT and 3SAT? SAT is the Boolean satisfiability problem, or, given a Boolean formula phi, we want to decide if there is a solution to the equation phi = true.

These equations are usually written in conjunctive normal form, or a series of conjunctions of disjunctions, like: "(a or b or c) and (c or d)". When each clause has 3 terms, the problem is called 3SAT. When each clause has 4, it's called 4SAT. Now you might get a sense how one could reduce from 4SAT to 3SAT. One possible reduction (which is extremely simple) is described here on the Math SE.


Ways to imagine a computer program for a student without photographic visualisation People have different modalities in their imaginings. Some imagine things visually, some spatially, some by touch, some by smell, and some other ways.
What if a student claims to not have the ability to imagine things visually or spacial?
The student is fresh, just starting on their journey into programming.
What abstractions can I use to help such a student to develop good cognitive abilities in formulating their intent before they write code?
As clarification: I consider this question pretty agnostic regarding any imperative programming language (although, student has to learn C++, PHP, Java)

This may sidestep the question a bit, but perhaps you can have the student make physical drafts of what they want their program to do at first, kind of like making multiple drafts of essays.
As an undergraduate, I sometimes joked that I used an awful lot of paper for a computer science student. I found that dumping everything from my head or even the problem statement onto pieces of paper (more portable) or a very large whiteboard helped me to organize my thoughts and eventually figure out what I wanted to do for my harder programming assignments as well as the problem sets in my algorithms class. I also did this when I was just starting out in CS and programming, just on a smaller scale and not for very long. This was especially helpful when I was learning about recursion.
I also found this helpful for helping students when I was a TA for the CS department's discrete mathematics course, which was taught in two different styles: paper and pencil, and with a theorem prover language (Lean) (a lot of students felt like it was programming). It especially helped for the latter style, as students sometimes knew what they wanted to do in a proof but couldn't figure out how to express the proof in Lean because they didn't understand how they were supposed to understand the syntax. Based on what some of those students said, I think drawing everything out for them helped them to eventually visualize on their own.
If the student is just starting out with programming, the drafts shouldn't be too complex yet, so hopefully they won't be too taxing and they can be a stepping stone to eventually being able to getting mental images of program structures.


Best online problem-bank style practice site for Python I'm a high school student who has learned Java with the AP Computer Science A curriculum at school. My CS class used the University of Washington's Practice-it site for practicing Java. I was wondering whether there was a similar open-to-public site for practicing Python, but I was unable to find a Python-practice website that matched Practice-it at the scale and quality of the problems. Could anyone provide some suggestions as to which website I could use?
The reason why I want to study Python is because I wish to take an introductory class to deep learning on Coursera that uses Python. But because I only learned Java in high school, I studied Python on my own, and was looking for a website where I could practice writing programs in Python. Also, because I am looking into becoming a data scientist, I am taking the applied data science course provided by UMichigan on Coursera
The most complicated Java program that I wrote was a 321-line long superclass and a corresponding 60-line client code that when executed, produces an interactive four-in-a-row game.

I didn't spend a huge amount of time looking over the practiceit resource you linked, but I glanced at a few problems, and they seemed similar to http://codingbat.com, which has exercises in both Java and Python.


How to phrase questions about spotting design issues in programs I like to give my students questions asking them to find and correct design issues in code. As an example, I gave them the following question:

/**
    This class represents the user-system of the application.
    There must be only one object of this class.
 */
public class UserSystem {
   private Map<String,String> users;// maps user to password

   public UserSystem() {
     users = new HashMap<String, String>();
   }

   public void addUser(String username, String password) {
     users.put(username,password);
   }

   public Boolean isAuthorized(String username, String password) {
     if (!users.containsKey(username))
        return false;
     return users.get(username).equals(password);
   }
}

The question text was something like:

  "The class compiles correctly but has a design problem. What is the design problem? Write a main program that demonstrates it. Use one of the design patterns we used in class to rewrite the class such that the problem is fixed. What design pattern did you use?"

The answer I aimed for was that, since the constructor is public, users of this class might create multiple objects of the class. The solution should be to convert this class into a singleton by making its constructor private (and adding a static member variable INSTANCE).

Indeed, some students got this correctly, but other students answered with all sorts of other design bugs, such as:

The method "addUser" does not check whether the username already exists.
The method "addUser" might be used by unauthorized users to enter their name into the system.
The methods are not synchronized.

etc...

It is true that these issues can be problematic in some cases, however, this depends on the context and the usage of the class. I wanted them to focus on a specific issue which I deliberately wrote in the Javadoc to this class. However, many students probably did not notice this.

MY QUESTION IS: in the future, how can I phrase such questions such that the answers will be more focused?

It is true that these issues can be problematic in some cases, however, this depends on the context and the usage of the class.

The "design problem" that you were hoping they would find also depends on the context and usage of the class. We have no idea whether the users of this class are obeying your JavaDoc. In fact, I could see an argument that your "design problem" is invalid because anybody who violates the JavaDoc is going outside the bounds of your design in the first place! Compare that to the functions with no JavaDoc, and honestly I'm more convinced by your students' answers than I am of your intended answer.

Asking "what is wrong with the design of this class" is too broad. You need to provide more context: perhaps provide the UserSystem class and then another class that uses it incorrectly (by creating a new UserSystem instance for every user, for example), and then ask what the design problem is in that code and how it could be prevented in the future.

If you want a specific answer, you need to ask a specific question. All of the answers your students provided sound perfectly reasonable to me.


How to overcome the TDD/BDD time fallacy I've observed an unusual thing happen when teachers try to introduce Test-Driven Development (TDD) or Behavior-Driven Development (BDD) to their classes. Even though the teachers invariably encourage it and present it as a useful strategy, students come out of the class with mixed feelings or actively opposed to using TDD/BDD in the future.

The reason they give for this is time. And in a way, it makes sense. TDD and BDD have high upfront setup costs in selecting framework (e.g. JUnit or Cucumber), adding test hooks/libraries into the code (your import org.junit.Tests), thinking up test cases for all the various scenarios, and then of course actually writing all the tests themselves.

In industry, this isn't so bad, because tests are essentially infinitely reusable, so the cost of that work can be amortized over months or even years. For a class project though, the entire thing from start to finish is only going to be a handful of weeks long at best. So the students see all of the cost and only a small slice of the benefit.

In short, students sort of pick up on a perverse incentive to not use TDD/BDD because the benefits don't justify the cost. So, how can I convince students that those strategies really are good choices, when simply forcing them to use them and saying "it works better in the real world, I promise" isn't cutting it?

I've seen How to stress the importance of testing code?, but the answer there is just "use TDD." It's not wrong, but it's also not helpful for my particular question.

I believe that the reason why students tend to come out opposed to using TDD/BDD (testing) is because they've been assigned to use it when it isn't necessary. Testing a "Hello World" program is 100% a waste of time. Tests only become useful when you have a reasonably complex program. The way that you can avoid students disliking testing is by not assigning it on projects when it isn't needed.

A specific way in which you could do this would be by combining all the project you would assign over the year into one larger cumulative project. Eventually, as they're writing code, you can be fairly certain that they'll induce bugs or begin to find manual testing to be a pain. Once that starts happening, you can introduce automated testing to relieve that pain. That way, they'll see testing as a way to save work rather than create more of it.

In addition, I think the issue may be with this part:

  TDD and BDD have high upfront setup costs in ... thinking up test cases for all the various scenarios.

If you are spending time thinking of test scenarios, you're doing TDD wrong. You should never just take time to think of test cases. You should think about how you want each new piece of code to behave, and then testing should be a way of writing down how you want it to behave. That's just good planning, and you should be thinking about that anyways.


What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations? I'd like to introduce my students to Nodes and then require them to implement their own Linked Lists, Queues, and Stacks before showing them that their language (C#) provides implementations of these data structures. I suppose my motivation is that they will 1) understand better how these structures behave; 2) gain general language practice; and 3) appreciate libraries and be more motivated to search for an implementation before writing their own.

Is my motivation valid? What are other reasons to ask them to implement these data structures? Is there any reason NOT to ask them to do this? Would I be wasting my and their time?

There is one aspect not yet mentioned, though the first two answers are excellent.

Libraries usually contain only the most common data structures and those that can be used in some generic way (pun intended, I guess). But there are other data structures that you may need in your work that aren't in the library you have available. The tools you need for building the standard data structures are likely the same (or a subset) as you need for the bespoke data structures. Sometimes you want a specialized version of a data structure to be able to optimize an important algorithm. So being a tool builder is an important skill that isn't exactly the same as that of being a tool user.


Are there any conventions for writing logic statements for combinations of logic gate functions? I am teaching logic gates. I would like to know if anyone knows if there are any conventions for writing combinations of logic gate functions. For example
NOR  gate => NOT (A OR B)
NAND  gate =>  NOT (A AND B)

Would it be acceptable to represent the above functions as
NOR  gate => NOT (A OR B)  as A NOR B
NAND  gate =>  NOT (A AND B) as A NAND B ?

You ask whether your proposed representation would be acceptable. Offhand, I would be cautious about infix notation for these negative operators.
In English, A NOR B would be expressed as "neither A nor B". A NAND B would be expressed as "not A and B". Often, intensifiers will also be prefixed to emphasise a NAND or NOR case and clarify the scope of the negative, such as "not both A and B", or "not any of A or B".
In both cases, the negative is introduced first in English, before the list of items, which accords more closely with the structure of the representations you are trying to replace - NOT(A OR B) etc..
Even on a technical front, I'm not familiar with a programming language that has NOR or NAND infix operators.
If you must contract these expressions or use the name of the operator, I would suggest NOR(A,B) and NAND(A,B).
Another problem is when there are more than two inputs. Unlike AND and OR, NAND and NOR are not associative, whereas "nor" in English has the same meaning and associative property as "or" (it's the introducing word "neither" which applies negation to the whole set, after they have been ORed together).
So NOT(A OR B OR C) corresponds to the English "neither A nor B nor C" (i.e. none of the set is true), but that is not the same as A NOR B NOR C (the meaning of which I can't mentally parse into English, and I'd have to sit down and write out a truth table to be sure).
Nand, of course, does not exist as an English word, but A NAND B NAND C is equally different from "not A and B and C" in English (i.e. not all of the set is true) and from NOT(A AND B AND C) formally.


Book recommendation on human "computers" I am looking for books on computers, in a now special sense:
https://www.lexico.com/en/definition/computer
noun

1 An electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program.
‘The laws were designed to prosecute people who hack into computers and steal information.’

1.1 A person who makes calculations, especially with a calculating machine.

Once I have read an article that in 1950, obviously the second meaning existed only in the Oxford Advanced Dictionary.
Now, do you know a good book on these people before the advent of electronic computers. using pen and paper?

It is not clear to me what exactly OP is looking for, but one relevant book is: David Alan Grier, "When Computers Were Human", Princeton University Press 2005. The author served for several years as editor in chief of the IEEE Annals of the History of Computing. He was inspired to work on the book when he learned that his grandmother had graduated with a degree in mathematics in 1921 and that some of her fellow female graduates went to work as human computers. The book covers about two centuries between the 1760s and the 1960s.
In June 2005 Grier gave a lively hour-long presentation at the Computer History Museum also entitled "When Computers Were Human", a video recording of which is available on YouTube.
One large early project, directed by Gaspard Riche de Prony, that ran from about 1790 to 1801 is described in I. Grattan-Guiness, "Work for the Hairdressers: The Production of de Prony’s Logarithmic and Trigonometric Tables", Annals of the History of Computing, Vol. 12, No. 3, Jul. 1990, pp. 177-185. The title makes reference to the following fascinating detail:

These calculations were done by the third section, a large team of between 60 and 80 assistants. Many of these workers were unemployed hairdressers: one of the most hated symbols of the ancien regime was the hairstyles of the aristocracy, and the obligatory reduction of coiffure “as the geometers say, to its most simplest expression” left the hairdressing trade in a severe state
of recession. Thus these artists were converted into elementary arithmeticians, executing only additions and subtractions.

A key personality in the final phase of the history of projects involving human computers was the mathematician Gertrude Blanch (1897-1996), described in David Alan Grier, "Gertrude Blanch of the Mathematical Tables Project", IEEE Annals of the History of Computing, Vol. 19, No. 4, Oct.-Dec. 1997, pp. 18-27, as follows:

Gertrude Blanch can be viewed as either the last and most important leader of human computers or one of the first numerical analysts for electronic computers. From 1938 to 1948, she was the technical director of the Mathematical Tables Project, the largest and most sophisticated of the human computing groups.

I originally came across Gertrude Blanch as author of the paper "Numerical evaluation of continued fractions", SIAM Review, Vol. 6, No. 4, Oct 1964, pp. 383-421.


Balance between teaching and projects in a club I've been thinking of starting a programming club - I know some people who would be interested and I think it would be a fun thing to do. This club would probably meet once or twice a week for a couple of hours and would have upper middle schoolers and early highschoolers (so maybe 13 - 16, somewhere in there). I'm in the same age bracket.

Part of the fun is just working with other people on projects of your choosing, but it would also be nice to spend some time sharing knowledge - some members might want to talk about their project and what they learned doing it, others might want to talk about a particularly useful feature of a language, etc.

Some ideas I'm considering:

One day a week is for learning and sharing, another day is for programming. Advantage - 50-50 split, people would learn a lot. Disadvantage: kind of annoying for people who want to consistently work on a project.
Have the club start with a couple of days coming up with project ideas and forming groups to work on it, work on the projects for about a month or a set length of time, and then spend a couple of days sharing. Advantage - lots of time programming, people get to share their work. Disadvantage - not really a space for people talking about non-project related things.
A mix of the above - #2, but when someone wants to talk about something really cool they've learned/discovered, some period of time is set up where everyone can learn about it.

How should time be split between these two activities so everyone has a good time but people still have an opportunity to share what they're working on? Would one of the above approaches work well, or would a different approach work better?

I am currently a co-leader of a programming/FIRST club at my high school, and for us the key has been project based learning. We are always working on something. It might not be relevant to our upcoming competition, but we always contextualize lessons in terms of what we're working on. That way everyone stays interested in the current project and sees the utility in the lesson being taught.


Explain to someone that programming isn't just all "if"s and "else"s I have a friend who, in his mind, has the wrong image about programming. Whenever I mention that programming is fun and that one can enjoy it very much especially if they like solving problems (both math and algorithm related), he stares at me and repeats "if this then do this.. what's so hard or fun about writing that?" and that's just annoying. It is as if one would say "ah well, maths.. 1+1 = 2 there u go!".

Is there a way I can make him paint a better picture in his mind regarding this field?

About 10 years ago when he was younger, he did try basic programming and that's what I believe he is basing his judgement on.

(Not sure if this is the right place to post this but let's see... )

Obviously your friend is using a bit of hyperbole, and in truth, however annoyed you may be by his blithe dismissal of our entire field, he may not be open to being persuaded.  You may have to resign yourself to not "winning" this argument.  From what you've written, this is what I suspect is the real answer.

For what it's worth, he's not, strictly speaking, wrong.  Data storage and branching are a huge portion of what computers actually do.

But if you still want to attempt to capture him, you might point him towards image recognition.  Sure, it's "if this then do this" in theory, but two different images of birds will share not a single pixel in common, so how do you teach a machine that can only look at one pixel at a time to identify one?

  "Computer Science is no more about computers than astronomy is about telescopes." -misattributed to Edsger Dijkstra

Of course, even if he concedes the complexity of the problem, that's still a ways away from seeing the joy in trying to solve it. I'm not sure there's truly a way from here to there if he's not interested in taking an honest look.


What is a good teaching example/application for jagged arrays (2d arrays with irregular row lengths)? We are teaching an AP CS class and the topic of 2d-arrays is coming up. There are plenty of cool and approachable sample applications for standard rectanglular arrays - matrix math, MIDI music, sudoku, connect-4, game-of-life, etc....

However, it's hard to think of examples for 2d-arrays with non-uniform row lengths, aka "jagged" or "ragged" arrays. Here's a simple example:

{{1,2,3},
 {4,5},
 {6,7,8,9}
}

The ideal example would be simple or common enough for students to have the intuition for the task, but interesting enough to see how irregular-sized rows can be useful and even natural in certain situations.

Some ideas we've already floated but am not yet convinced I love: Pascal's triangle/Plinko, graphs represented with adjacency lists.

Addendum: Many good ideas so far. One clarification - I would love examples that would NOT be better implemented as an array of lists; adjacency lists for graphs, for example, are likely better that way.

Hmm, here are a few ideas:

Calculating student GPA where the grades are all stored in an array of arrays, and the different semesters have different numbers of courses.
Make a lookup table of prime factors.
Consider an array of arrays of paths to hike, and local maximum / local minimum elevations passed along the way. Since there will be a different number of local maxima/minima along the way, the array will naturally be jagged.  Figure out which hiking path involves the least climbing.
Same as above, but now instead store the elevation every x number of meters.  Since the hiking paths are somewhat different lengths, the array will naturally be jagged.  Determine which path has the lowest average slope for a hiker who has difficulty with hills.
(More advanced than AP, probably) Many Sudoku variants often suggest jagged arrays.

Also, for what it's worth, if you organize your midi-like events by time, it's actually ragged.  Different numbers of notes are played (or stop playing) at different times.  If you play a triad, you will have three events.  If you play a triad at the same time as you stop playing a previous melodic note, you now have four events.


Toy Databases for Class Examples/Homeworks I am familiar with the Northwind database and Chinook database as good toy databases for allowing students to practice writing queries. Are there other databases in a similar vein that are available? I want something with a sensible real-world data model and enough data to be interesting.

In particular, I'm interested in databases that can be downloaded/built from a set of SQL statements in a script - building the tables, adding the foreign key relationships, inserting the data, etc. That way, students can add data under the constraints of the database (e.g., foreign keys). Thus, I am looking for databases that are downloadable in formats compatible with major RDBMS implementations (e.g., MS SQL Server, MySQL, SQLite). This differentiates this question from the previous question regarding datasets, which focuses on flat files, or databases available as flat file.

I stil think this is basically a duplicate of this question: Good datasets for intro CS courses?

You're asking for a database of interesting data. The other question is asking about interesting data. The only thing you need to do to get from the answers in that question to the answers to your question is to write a little bit of processing code that outputs the data in a format that's compatible with a database.

In other words, you're going to have to massage the data. This might require writing a program that calls an API to get data, and then outputs that data to .sql files or more basic .csv files or something. Then the students would take those files and work with them to create their databases.

I think as soon as you accept the fact that you're going to have to massage the data, you'll open yourself up to a lot of cool data sets. I think restricting yourself to data that's already in the exact format you need is very limiting, and isn't how things work in the real world. In the real world, data is always in the wrong format. You always have to convert it to something you can use.

Stop looking for data in the format you want it in. Start looking for interesting data, and then figure out how to get it in the format you want it in.


How to make someone enjoy programming if they don't like the products they make? Background
I have a friend who loves applied math and physics, but hates programming. She is learning python right now because she thinks it's helpful in getting a math-related job, and her mom forces her to learn programming despite how much she hates it. I suggested to not go into a career that involves doing things she hates, but she said that she likes her career decision. It's just the programming part of it that she doesn't like. She also said she never had a choice because of the expectation from her family and the necessity of programming in math-related careers.
Problem
I feel really sad for her. Knowing that she has no choices, I tried helping her enjoy programming, so that even though she still has to program, she wouldn't find it boring.
What I have tried
This question is similar to How to teach a person to enjoy programming? But it is different because my friend doesn't like the things she made. People in the other question suggested that it is the products that make programming enjoyable. But she is saying that she doesn't like the products either. She would rather solve problems by hands than to have a program that solves problems for her, because she thinks using programs to solve problems feels like cheating, and prefers to solve problems in a more elegant algebraic way.
I also got her to make some simple programs that do simple tasks like counting the significant digits, and rewriting numbers in scientific notations, but she couldn't see any real-life applications of them.
What I'm looking for

Some physics or math projects with real-life applications that she can make with python. (She likes university-level physics and math, but is still a beginner in python)
Any other ways that can make her not hate programming
Maybe some things to say to let her know the fun parts of programming

I don't normally answer questions that I've voted to close, but I'll make an exception here. I think your quest is doomed. Sorry.

I also think that pressing is just going to make it worse. Perhaps you can impress that on the mother.

One can be successful in applied math or physics without programming. It is a helpful tool, but not essential for everything. She can be a success without it, most likely.

But, the time will, perhaps, come when she needs to use programming to solve some problem that really drives her interest. That is the time that you might be of help, but not now. It is now just a distraction. Wait for the need to become obvious to her.

In Tai Chi we learn to be soft in our actions and movements. But that doesn't mean they are ineffective.


Should teachers enforce standardization of spacing and braces? On open source projects and industry teams, there are often detailed style guides about how many spaces should be used for indents, line continuation, etc., and whether braces should go on their own line. While I have my preferences (such as spaces around binary operators), I acknowledge they are somewhat arbitrary. Should I require students to follow a standard for assignments and team projects (perhaps conventions of their own choosing), or should I ignore these as trivialities?

Of course, I would enforce more important conventions, such as proper indentation, appropriate naming, etc.

Our two deities are clarity and efficiency.

Standardization makes a great deal of sense in industry, where large numbers of programmers may work with the same lines of code and must be able to make sense of each others' choices. However, I don't see value in enforcing particular style guides in an educational setting.

Different companies can require different norms.  If your students eventually enter the industry, a style guide is easy to read through if they can code, and is irrelevant if they can't.

When I teach my kids to worry about indentation, vertical spacing, variable names, etc, I teach them to always use this question as their foundation and their guiding star: "what does this choice communicate?"

That is honestly already quite a lot to tackle, and I have found that my kids really do start working quite hard and thinking quite deeply about how to make sure that every line of code is as clean and clear as it can be.

If my students can learn to scale this mountain, why would I ask for 4 spaces in place of a tab?


In self-teaching, how can I move from basic tutorials to more complex work? I'm currently learning SQL (specifically T-SQL) and focusing on searching databases, not building/editing them. This is pretty much the first language I'm learning, so I don't have a CS background to draw on.

I've worked through the tutorials at Code Academy and SQLBolt. They gave me a great foundation into the basics but when I look at actual SQL searches in the database I'm using, they're much more complex than the ones in these tutorials and use query terminology that's never introduced, to the point that I'm somewhat overwhelmed and confused by just looking at them.

Part of this is related to how simplistic the examples are in the tutorials and part is because the database I'm looking at is huge. Dozens of tables, some with 20+ columns each and lots of ways to compare the information.

The difficulty I'm having is that proficiency seems to require knowing what searches are "easy" with no actual experience... and then finding out what is even possible to simplify the search I'm trying to write.

Considering the complexity of the database I'm using and my current skill level, how can I ease into more complex searches while still finding the results I need from the information?

Some notes:

I do have people who are willing to help me as needed but I'm concerned about bothering them too much with stuff that should have been simple for me to solve on my own, particularly as they are quite busy. How can I determine what's simple and what's complex?
Another part of this is that talking with someone isn't a great way for me to learn, as I quickly forget what they've said, so I don't retain the information. I want to learn what they're telling me, not just have it redone "correctly" for me. The tutorials have been good because they give me the chance to actually write the searches myself.

The short of it

There are three techniques that should serve you well in this, and future, endeavors to learn practical application of complex subjects:

Apply it,
Dissect it,
RTFM

The long of it (tl;dr)

Apply it

Install a database manager on your own computer. (Your personal home computer by choice, but a work computer is possible if the learning is sanctioned and supported by the supervisor.) It does not need to be the same system you have at work, or the same one you want to eventually "know." There are quirks to every DBMS, yet they mostly try to follow the SQL standards.

If a local install of a server with T-SQL is not possible, a good choice, in my personal opinion, is MySQL. MySQL has a developer and user community that is often helpful. The manuals, for many versions, is available online, or downloadable for local use. The manual includes explicit statements of how MySQL deviates from ANSI/ISO SQL standards. Having those differences delineated allows you to know what to watch for when developing advanced statements yourself. (There are serious syntax differences between ANSI SQL and T-SQL, but the logic behind what you do is what you need to learn more than the syntax, it seems.)

Take what you know about the SQL so far and rework old projects you've done using your new SQL knowledge.

The size of the old projects can grow as you work through them, but isn't all that important. It also doesn't have to be a project that requires a database, only that it could use a database. It's the long way around, and usually not needed, but a database can hold configuration information and initial state values. Doing so can even increase the re-usability of the original code. Since it is a project you've already done, the algorithm and program logic is something you already have a handle on, and applying the new knowledge to the old problem lets you focus on the new knowledge.

If you don't have any old code-based projects of your own, which is likely in you case, then you can still use an old "problem" from elsewhere. You don't need to have a program that uses the data, since learning the C# or Perl is not the objective, only the SQL. (Often the DBA has very limited skills in other languages, but is excellent at the SQL for their system.)

Dissect it

Obtain real code from existing projects that use the SQL that you want to learn. Read the code and learn to follow what the original coder has done. Try to figure out other ways it could have been done, and then figure out why they choose the method they did.

Next, look for things that might change in either the dataset or the use the data is put to. Figure out how to rework the existing code to accommodation those changes.

Next, develop the requirements for a new dataset to apply to a new problem. If it's useful in your work environment, that can be a plus for later, but it could equally be useful at home. (Movies: plots, actors, directors, awards, reviews, and your collection could make a useful project.)

As a part of "dissecting" what you want to use, learning to use a different system, such as MySQL or Oracle's database, can help by highlighting the differences and similarities. Looking behind the syntax to what the DBMS "does" to fulfill commands can help you make more efficient use of the commands.

RTFM (Read The Fine Manual)

In this case, the Manual includes any community that has developed around the server you're using. If you have installed one DBMS at home and another at work, then you have two communities to draw from. You can also use some SE communities in your learning. [dba.se] is one that you might find helpful, as well as the usual ones for developers.

Often, in the manual proper, or the community around the system, there are tips, tricks, and warnings that can make significant improvements in your understanding of the system once you can fathom the how and why of the given tips, etc.

The short of it (redux)

Take what you know, practice it, explore other uses, and practice some more.


What is the best layout for a Middle School computer lab? My school director has given me the opportunity to redesign the layout of our school's IT lab to better suit my classes.  Currently the computers are in the "inverted U" layout listed here so that I can monitor students' monitors but not their faces.

I find that this makes classroom management difficult (I teach grades 6-9).  Students frequently get distracted by what is on their neighbors' computers, and every student can see every other student's monitor without much effort.  It also makes individual work like quizzes/exams basically impossible.  If I have to make an announcement I am making it to the backs of students' heads.  Students have to turn their whole chairs around (we don't have office chairs) to pay attention to a lesson, which means they can't comfortably take notes on what I am saying or what I write on the board.

I'm currently debating with myself between three layouts:

computers in clusters of four (the four-leaf clover layout from the link above)
computers in rows such that students face the front of the room and monitors face the back, like this (I would then teach from the front, and when students had work time I would move to the back to monitor the screens)
computers in four rows: one row against each side wall (students facing the walls), two rows together in a center island (students facing each other), such that I would have an oblique view of the monitors from the front of the room and students would have to rotate about 90 degrees to face forward.

The features that should guide your classroom layout are visibility, accessibility, and distractibility — maximizing the first two, and minimizing the third.

Visibility is simple: every student should be able to face forward easily with unobstructed view, and I should be able to see every student's face.

Accessibility, here, means that I should be able to get to every student quickly, and that students should be able to work with each other when I assign pair-programming tasks or ask them to discuss a question with neighbors.

Those first two considerations already rule out front- or rear-facing rows, and some cluster arrangements as well.

Regarding distractibility: From years of teaching and observing other teachers, I take as an axiom that lecturing to students who are looking at computer screens is an effectively pure waste of time. This has corollaries:

Screens should be less than about 120° from facing the front of the room — ruling out rear-facing screens.
Lectures should be short and focused.

At this point I should give some context about my classes:

The first cue I teach the students is "screens off!", and I say this whenever I need to address the class as a whole. (If I'm interrupting work, I first give an advance warning so they can find a stopping point and save their work.)
I ask students to bring a notepad and writing tools, for drawing or taking notes while their monitor is off.
I aim to limit lecture time to ten-minute chunks at most, punctuated with pair discussions.

Because I have the students turn off their monitors, my lectures must require either no handwritten note-taking, or minimal note-taking (which then requires me to give some explicit instruction on how to take notes).

Now, I have taught in labs with traditional rows (students facing forward, monitors back), clusters, and variations on the "inverted U" design you're talking about. Currently my lab is set up with student workstations all along the left and right walls, so that students are all facing the wall while working, and the computers are all facing inwards — very much like the last option you described, only without a central island (because the room is too small for one). This is my preferred layout.

So, I would endorse the last option you suggested, of computers along the side walls, with an optional cluster of side-facing machines in the center of the room.


Student not understanding explanation the 1st, 2nd... and 8th time I am working for a company, and a target for this year is to increase the level of CS knowledge among the staff.
The company does mostly engineering stuff so the people come from an engineering background, they might have some knowledge of programming, such as what is a variable, control flow, etc. but classes are virgin territory. That is kind of the average level there.
Me and a few others with knowledge (formal CS background, working in the AI team of the company) were assigned to increase the level of knowledge in the office. Basically each mentor was assigned a handful of mentees and the mentor decided what to teach and what exercises to give etc. to improve the algorithmic thinking and C++ competency.
I paired up with a colleague and we pooled our mentees. For some people it worked great. People went from variable names like a, b, ok, x and thousands of lines of copy-pasted code in main() to actually nice variable names, class hierarchies with abstract classes/interfaces, clean code to the point where (almost) no comments were needed, etc.
I tend to think that we are doing something right, especially since my colleague and I also teach at our university (which is among the top3 in the country), create training materials, held multiple training sessions on different subjects, regularly mentor interns with great success and also did volunteer work tutoring middle school children in introductory programming, with parents at the end asking us to continue the tutoring for money. So we are not exactly new to teaching, and our experiences seem to indicate that we are not bad at it either.
However I have a student that doesn't seem to grasp some concepts at all even after multiple (>5) explanations using different methods and analogies. Will also forget basic techniques in the span of hours.
For example he needs a copy of a vector<int> (C++). He will do the old song and dance:
vector<int> copy;
for (int i = 0; i < my_vec.size(); i++)
    copy.push_back(my_vec[i]);

We told him several times and explained why it was better, faster, prettier to just do:
vector<int> copy = my_vec;

He always forgot to do this for his homework until we made his homework to clean up his code and implement a single utility function.
He cleaned up the code, then in that utility function went right back to the for method. And when we pointed this out it took a couple of minutes and helping questions for him to realize what he did wrong.
Another example is that as a first project the mentees have to implement a basic Hill Climbing algorithm.  This project has been given in June. We have people who will begin implementing Genetic Algorithms this week and it won't even be hard for them. People who have started from variable names like a, b, ok, x and thousands of lines of copy-pasted code in main().
Without precise instructions he's barely able to create functions like with 1-2 rounds of review "you get a vector of vectors as an argument. compute f on each of the vectors and return the index of the first vector where the value of f is above some threshold x".
The hill climbing algorithm was explained exactly 7 times to him in different ways, with both me and my colleague actually spending time to come up with new analogies. Every time this mentee will enthusiastically say that this time he understood better than all the other times and then do something like just compute the best neighbor of the starting point and return that neighbor, and then name the function firstImprovement.
The problem is that this person does not appear disinterested. When we explain things he nods and looks like he is concentrating and that makes us try again and again because it looks like he's trying too, but the issues above have been a thing for months. On a problem as simple as Hill Climbing.
Has anyone ever had such experiences? Any advice? Or any other site where this question would be appropriate?

Maybe you are stressing things of minor importance. You gave us two examples.
vector<int> copy;
for (int i = 0; i < my_vec.size(); i++)
    copy.push_back(my_vec[i]);

sure is lengthy, and probably also a bit slower than the C++ expert version of
vector<int> copy = my_vec;

But it does its job and is readable (while e.g. to me as a Java guy, I'd struggle to remember that the assignment operator here does a copy of the data structure). And, regarding performance, we all know that in at least 90% of all cases, it doesn't matter. And if it matters, I'd search for a solution where the vector doesn't have to be copied at all.
Regarding Hill Climbing: During 40 years of software development, I rarely ever needed hill climbing, and I've been working in algorithm-sensitive areas. So, unless your students' jobs need things like hill climbing regularly, think of exercises better matching their everyday needs.
To summarize it: You're not preparing that guy for a PhD in computer science (which most probably isn't needed for his job and out of scope for him as well), but giving him some tools to improve the software engineering aspects of his work.
With this guy, I'd switch from a fixed curriculum to practical reviews of production code, concentrating on readability, robustness and structure, looking at code written by different developers. If he struggles there as well, then have a nice, deep talk with him.
EDIT, as requested by OP
Regarding the "nice, deep talk": If that guy really struggles hard with basic concepts of software engineering, then he'll probably never catch up with the others. That mindset of specifically-structured thinking is not given to everybody. So, he should understand that his talents might be somewhere else.
He can choose whether he wants to pursue his career as a software engineer, with the risk of always staying behind all the others. Or he can find a different role in the team where his talents shine. It might be he is good at understanding the customers' way of thinking, or at hardware development and interfacing, or UI design, or management, or quality assurance, or whatever. Software development teams need so many roles besides coding, there might well be tasks where he can shine.
That's what I'd talk about with him. You should try to make this a positive experience for him. Maybe you already observed some of his talents, so you can suggest some migration path. For that talk, interpersonal skills are most important.


latest Book (2018/19) for Computer Science for Grade 2 to 8 students I am currently looking for what book to use/adapt for the 2019-2020 school year for students Grade 2 to 8 ICGSE or CBSE or other pattern.

Since you are asking about a wide range of ages, let me suggest that no single book is likely to do the job for you.

Instead, let me suggest a web site CS Unplugged which uses non computer resources to teach simple concepts of CS, including Computational Thinking.

The main idea is that many things, including toys, can give youngsters appropriate metaphors that will bring them to a mindset that helps them later learn things more formally.

You can also do an online search for Computational Thinking, which will reveal a large number of resources, some (not all) of which will be appropriate for you.

I wouldn't try at this level, to focus very much on computer programming, though Scratch is directed at youngsters.


What ethical practices do students (as potential software engineers) need to be trained in? The kinds of things that people with technical training can do have societal impacts, both for good and evil. Programmers are building the future. One future nightmare is Skynet.

Many problems in the world have been caused by scientific hubris as well as the Fallacy of the Last Move, a concept from Game Theory as it applies to Arms Control and other strategic thinking.

Unbound technologists, especially if amoral, can be very dangerous to the earth and its inhabitants.

So, it seems that future Software Developers need some training in ethical concerns. What, to you are the most important issues and where in the curriculum should they be taught?

Note that ethical issues can be simple or complex. Even something as simple a accepting buggy software can have ethical implications and such lessons can be taught in early courses.

At the other end of the scale is the question of how much a person owes to their employer vs to humanity as a whole.

What essential ethical practices do students need to be trained in?
What are effective ways of integrating ethics into the curriculum?
What are the first steps a teacher should take in integrating ethics into the curriculum?

A general discussion of Computer Ethics is: https://plato.stanford.edu/entries/ethics-computer/

I'm going to begin by quoting Ken Thompson's Turing Award Lecture "Reflections on Trusting Trust" (link).

  To what extent should one trust a statement that a program is free of
  Trojan horses? Perhaps it is more important to trust the people who
  wrote the software.

In my mind the first and most foundational lesson to impart is this: software, computers, technology -- these things are more about people than about code. There is a trust from the end-user, whoever that user may be, that must not be violated. Users are not means to an end; they are the end. The code is the means.

I am reminded of the Second Formulation of Kant's Categorical Imperative:

  Act in such a way that you treat humanity, whether in your own person
  or in the person of any other, never merely as a means to an end, but
  always at the same time as an end.

In terms of integrating ethics, the way to start in my mind is discussion. Early and often. Share news stories. Discuss implications of new apps students download. The first 12 minutes of this CS50 lecture cover the the Volkswagen/EPA scandal from 2015 and mention Ken Thompson's lecture. It is essential that awareness is built right from the beginning that software is everywhere and there needs to be an ethical code to guide that development. In my mind, while I wouldn't consider myself Kantian, I do think his point about means and ends is essential.

The AP Computer Science A curriculum outlines the following requirements under the major topics of the course:

  VI. Computing in Context

  An awareness of the ethical and social implications of computing
  systems is necessary for the study of computer science. These topics
  need not be covered in detail, but should be considered throughout the
  course.

  A. System reliability

  B. Privacy

  C. Legal issues and intellectual property

  D. Social and ethical ramifications of computer use

Similarly, in AP CS Principles, students, as a part of the Explore Task, have this on their rubric for the assessment:

  Analyzing Data and Information: Identifies one storage, privacy,
  OR security concern. Explains how the concern is related to the
  computing innovation.

The moral of the story here is that ethics must be discussed with students as soon as possible whether it is a high school AP course or an introductory computer science course at a university.

This idea of trust must be imparted to students, and it must be emphasized that the world of software engineering and computer science in general is not in a moral vacuum. It does no good to address a particular issue, say data privacy, without first contextualizing it within a larger ethical system, one that sees each user as an end, not a means, and as someone who is placing trust in you the developer.


Services-centered design I am having some difficulties to find free access documentation, lecture notes, scientific papers, or books, on a course I have to give. Course topic is "Services-centered design".
Course objectives are:

Use advanced design techniques applicable to large service oriented software systems.
Apply advanced design techniques for a specific system.
Evaluate design decisions.

Course content is:
Concepts
Development cycle and life cycle (service oriented)
Principles of service-oriented application development
Templates
Protocols and standards
Approaches and implementation
Thank you in advance for any help.

I finally found out that the right keywords for what I was looking for, given the course objectives and the course content are:

Service-oriented software engineering
Service-driven software
engineering
Service-oriented software architecture
Service-driven software architecture
Services-centered software architecture design, ...


What is a good analogy for the Object Oriented paradigm? What is the most effective analogy that you have used or have thought of to teach the object oriented paradigm? Hopefully the analogy can translate well to inheritance as well, and includes the concepts of instance methods, class methods and properties. Even better would be if it also includes the concept of singleton classes.

A similar question exists on Stack Overflow. I would like to duplicate it here because on Stack Overflow it was closed an "Not Constructive."

It also exists on Software Engineering, where is not closed but it has historical lock. This means that "it is not considered a good, on-topic question for this site." Again, it should be re-asked here.

I've got to jump in here and talk about my experience having to help a former boss understand why the project he wanted to do wasn't possible in the time available. It came down to incompatible data types and he just couldn't see why I couldn't convert from one to the other (he wanted to do real-time motion capture using an XBox Kinect to animate a 3D mesh of the circulatory system and thought this was easy).

Ben I.'s answer touches on this too, but I can add to it.  He says this:

  The objects keeps track of some kind of information (instance variables), can be interacted with only in specified ways (interface), have setters (switch/button) and a getters (lights, your eyes).

There's more to it than that.  In this electrical engineering paradigm (which should be familiar to most), a light switch that has two states is the most basic example.

It has output: bool isOn()
It has a method of supplying input: toggle()
Underneath it has an implementation of what toggle() does and how that affects the return value of isOn()

Buttons can also be described in this manner:

It has output: bool isOn()
It has a method of supplying input: push()
Underneath it has an implementation which differs from Switch slightly: after push() is called the output is true for a short duration, then automatically returns to false. That is, the user must continue to interact with the button in order for the output to be true.

A knob also has similar features, although different types are involved:

It has output: float getValue()
It has input: twistTo(float v)
Underneath it has an implementation

But here's where it gets interesting:

What happens if we define an object that implements both Knob and Button? We should expect the following description:

It has output: float getValue(),bool isOn()
It has input: twistTo(float v)
Underneath it has an implementation
After input is supplied, isOn() becomes true, then after a duration becomes false again. In order to keep isOn() returning true forever, we must continue interacting with the object.

What do we end up with?

We can twist it to set the value, which turns the output on and displays the value. Then after a duration defined by that value it turns itself off again. As the homeowner we don't care how it was implemented only that they can interact with it in a certain way (defined by those interfaces) to get the desired behavior.

And yes, I'd present that to students in that manner. Describe the simple items (button, toggle, knob, timer) and then ask the students to figure out what happens when two of them are combined. The epiphany moment when it clicks will do wonders. That's the difference between being told and being taught.

You can expand on this analogy quite far, as well: Three-way switches, time-locks, missile launch confirmation (you need to press two buttons at the same time), sliders, gauges...

And then...you can get to events. Instead of treating the wires in the analogy as hard links in code (while(switch.isOn()) { ... }), you can treat them as events: when the switch changes state, that update propagates to all objects listening for it and they handle the state change as their implementation dictates (switch.addListener(this.doWhenToggled)).

The classic "cats are felines, felines are mammals, mammals are animals" hierarchy only gets you so far and provides a very poor and rigid understanding of Object Oriented Programming that causes new programmers to tend towards Do-Everything Objects (where do float planes fit in the "boat extend vehicle, plane extends vehicle" hierarchy? Clearly the only solution is to make all vehicles drive, fly, and float and just disable the ones we don't need!) rather than through a composition of interfaces (say, FloatPlane extends BaseAircraft implements IWaterCraft).

I know that sort of thinking messed me up for a number of years. Heck, I'm still recovering from it: I still can't read inline lambda expressions natively, I have to decompose them, and it often takes me several minutes. Same thing goes for creating interfaces, I often have to go the "cats are felines" road until I hit a spot where I realize "I want to use this code on both cats AND cars" because they both share some property that doesn't exist in the common class (and shouldn't) and I have to refactor.

Of course, refactoring is a good thing. Give your students a powerful IDE and teach them how to use the refactoring tools. Eclipse is the god of these , offering an astounding fourteen different options, including "Extract Interface" and "Use base type where possible."  Even if they make a mistake, now they know how to fix it in moments rather than hours. No one wants to (and no one will) spend hours fixing an inheritance problem that can be solved by a quick copy and paste; "code duplication, meh, never hurt me."


How to introduce Kotlin in a Programming Languages course I'm teaching an upper-division college Programming Languages course, in which students have learned some Scheme, Haskell, and Go. Students' strongest language is Java, which we use in most of our courses. I have a free 75-minute lecture period. Any recommendations how to use that time? I can have the students bring their laptops.

My reasons for wanting to introduce Kotlin are:

Showing how the functional programming has been added onto an imperative object-oriented language they know well.
Showing them how Kotlin uses a stripped down version of Java's syntax without losing expressiveness.
Augmenting what they are learning in another class of mine, in which they are learning to program Android in Java. (That's why I chose Kotlin rather than Scala.)

I think the answer to that depends on how you're structuring the course overall, and what Kotlin brings to the teaching of those ideas.  I know of three distinct approaches to an upper-division PL course:  the "paradigms" curriculum (à la Sebesta's book), the "interperter/design space" curriculum (EOPL, Scott's "Programming Language Pragmatics", Louden, Turbak/Gifford/Sheldon, etc.), and the hybrid theory/implementation curricula (less common and few things in print: the Racket team, Norman Ramsey's adaptation-in-progress of Samuael Kamin's book).

Do any of these describe what you're doing with your course?  What is it that Kotlin brings to the class that is not already represented by the other three functional languages your students have learned?


Are there any lists of concepts in a re computer science? Are there any list of concepts re computer science? I'm a uni student with gaps of time in study due to illness and I want to revise things, but because of reduced course loads and weird ordering due to illness. I'm not sure what I remember or not. And looking for tutors online they only seem to tutor in one thing.
I'm not sure what I should prioritize or what order to revise in - so I know what to work on with a tutor or which area to start? I've done a intro Python course, Java course re bigger project, HCI, linear algebra, Discrete Maths, Multivariate Calculus, Algorithms, Computer Systems course with small amount of C, Stats course, Information Systems (SQL and DB Design, 2nd year one on internals like B+ index and other stuff, Big Data). I've also done 2 specific Bionformatics courses and Biology related courses re Bioinformatics stuff.
Plus I've gone on websites like HackerRank or codingame or codecombat or exercism. I know there's edX and coursera.
Probably wrong place to ask, but I wish I could have a checklist, because current approach of doing things on websites is not helping me. Oh, when I did these courses I got results in the top 2 grading scale categories, but because of time...

Look at the list of courses offered at the undergraduate and master's level at your own university and a couple of others. The course titles should give you a pretty good idea of the range of things.
The list of courses you say you've had may be a bit focused on applications, rather than theory, and on maths rather than CS. I'm not seeing Operating Systems or Compilers and Language Principles, for example.
Any single university's catalogue should be pretty close to covering it, but might miss one or two things. Look at two or three online. Some will even provide a syllabus if you can find the professors that normally teach the courses.


How can I build up the understanding of a project? As a student my instructor gave me a scenario and a title and I have to work on that as a project. I searched a lot about these and watch videos , read blogs but didn't get a well defined answer. I have to understand the basic idea and working of that scenario and have to built up a project on that. But I am confused in getting the basic requirements and objectives of that scenario title based. Please if anyone can help me that how can I understand easily that title and get all points clearly?
The given title is 'Online School Monitoring System'.
Thanks in advance

I think it would be improper to give you advice on the content of your project. Your professor assigned it so that you would learn something and you will learn more by doing that part yourself.

However, I think you are making a mistake by assuming that after the original instruction from your professor you can't go back for more advice. But if you just ask for help you may get less than you need. Again, that is because the professor wants you to do the work.

I suggest you do this. Before you actually start the project, write up a detailed proposal for what you think you should do based on the studying you have already done. "This is what I understand. This is what I propose to do." Use your own judgement about what are the best steps to take. You may be correct or not. Doing it will help you refine your ideas, of course.

Then, show that to your professor and ask for advice on it. If you make it clear that you have "done your homework" you are likely to get better advice. If you can do this in a face to face conversation you will also get to ask some questions about what you still see as gaps.

It isn't necessary to go from point A to point Z without any intermediate steps.  And it isn't precisely correct to ask others to fill in those steps.


What are some good real-life examples of pipelining, latency, and throughput? The textbook Computer Organization and Design by Hennessy and Patterson uses a laundry analogy for pipelining, with different stages for:

washing
drying
folding
putting away

The analogy is a good one for college students (my audience), although the latter two stages are a little questionable.

Latency, of course, is the time for a single load to go through all 4 stages, while throughput is the rate at which loads are completed. Without pipelining or parallelism, throughput is the reciprocal of latency.

I'd like to present additional analogies that might be helpful to my students in understanding latency and throughput. I thought of comparing the latency for one student to go through college (4 years) with the rate at which the college graduates students (many per year) but realize there's parallelism in a college (multiple students in each year) in addition to pipelining (beginning to teach new students before old students have graduated).

What are some good analogies for pipelining and the relationship between throughput and latency?

Production lines in factories, eg. for assembling cars.

In theory, a single person could assemble a whole car from scratch. But they would need to memorize a lot of different steps and it would be hard for them to find an ideal working mode. For example, they might need very different clothes and tools for assembling the engine and painting the body. What is worse, the only way of speeding up production is assembling cars in parallel. Parallelising tasks this way does not scale well in the real world (eg. think of the logistics for getting the parts to every worker as you keep growing the number of parallel workers). In software and hardware design this also applies: (Task-)Parallelism introduces significant additional complexities into a system, so we can't blindly rely on it for scaling up indefinitely.

What factories do instead is, they break the assembly process down into distinct steps and then have each worker specialize in a specific step. This allows them to quickly learn how to complete that singular step as efficiently as possible.

In software and hardware design this is also true: Finding the most efficient design for a single, self-contained step is way easier than optimizing a big system that does everything.

Now, breaking your assembly line into its parts has its caveats: You introduce additional overhead by eg. having to move the car from one assembly station to the next. So a single car might in the end still take longer to move through the assembly line than if one person did the assembly all by themselves. But we can compensate for that by making use of the fact that the steps are independent: As soon as the first car leaves my assembly station, I immediately start working on the next one, even though the previous car still has to reach the end of the assembly line before it's completed. The latency is the total time it takes for a car to pass through the complete assembly line. Throughput is how many cars the assembly line can complete per hour. Once the pipeline is full, this is determined by the time of the slowest assembly step - the clock rate of the line.

The challenge in designing such a system is to find the sweet spot for how much work we can fit into a single step. If a single step gets too big, it again gets difficult to optimize. If it gets too small, the overhead of managing the line might be bigger than the actual work required for the assembly. But we also need to ensure that all tasks are about the same size: If a worker is able to complete a task significantly quicker than the clock rate, they will be forced to idle for the rest of their time until the next car is delivered to their station. All of this applies 1:1 to software/hardware design.

Now, in our production line scenario we have a pretty ideal situation, as the different cars can all be assembled in isolation. If someone makes a mistake in assembling car A, that affects only car A but none of the others (unless the mistake somehow forces you to stop the complete production line). In hardware or software this is often untrue. For instance, deciding whether you take a branch in a CPU instruction pipeline often depends on the result of a previous operation. However, if that operation has not reached the end of the pipeline yet, we might not have that information available. So we have to delay the execution of the branch until that information becomes available (stall the pipeline). If we have a lot of those dependencies (often referred to as hazards), we might lose all our pipeline parallelism again and our throughput approaches the latency of the pipeline.


First programming Language : C or Python? These days everybody is learning Python. I remember when we first started programming we were taught C Language. As a teacher which language should be taught first these days, C Language or Python?

The question is actually more complex than it might  appear, and really the answer can depend on the context. For example, at what age are the students when they are first taught to program? Is this in Primary School, High School or part of an undergraduate programme? The answer might be different in each case.
It also depends on the purpose of teaching the initial programming language (IPL). Is the purpose to lead towards a practical skill (vocational programming), or is it to enable the teaching of some knowledge of algorithms (pedagogic programming), is it to enable the functioning of some devices (engineering programming) or is it to prepare students for further study? Each of these questions could lead to a different language as an IPL.
For a very early age start of programming one does not have to worry about employment or future curricula so something engaging is important, so tools such as MIT Scratch have a role. For later childhood Python fills a nice niche, particularly as it can run on a wide variety of inexpensive  platforms (such as Arduino's, Raspberry Pi and so forth) which  provides accessibility and make it within the reach of the classroom and individual students.
Conversely, if one is looking at an undergraduate IPL then it may depend on which degree programme is being considered. Is it a degree in Computer Science, Engineering, Biology, Chemistry or Physics? One would then need to take into account what graduate employers might be looking for and tailor to that market.
Python might have value in some of these programs but the students would also have to learn other languages at some point. For example, Computer Scientists would need a wider experience that would embrace C#, C++ (among others). Electronic Engineers might need C, but Computer Scientists less so. Biologists might need R, Chemists and Physicists might still  need Fortran!
However, I would say that I might never recommend C as an IPL, and would start at C++ even for the most hardened Electrical Engineer. I only show Computer Science students C in specific contexts (like working with flex and bison)!
One thing I say to my students in the course where I look at Languages is that there is no one best language. The choice of language for any particular situation is so very context dependent on resources available, skills available, the purpose of the programming and the end goal of the task, and for an IPL that advice still holds true.


What are the benefits/uses of a SMART Board in CS education (or are there none)? A few years back I taught in a lab equipped with a SMART Board.  I typically only used it as a regular whiteboard and the only benefit I could identify was that I didn't finish every lesson with ink on my fingers from absentmindedly erasing the odd illegible letter here and there.

On the downside, it was something of an attractive nuisance for the kids with shorter attention spans, and writing on it was less precise and natural than writing with an ink marker.  On balance I would probably have gotten rid of it, given the choice.

Now I am being offered the chance to have a SMART Board installed in my lab.  I can't think of how it could really be useful in teaching CS but then I am a bit of a Luddite when it comes to ed tech in general.

My curriculum focuses on web design (HTML/CSS/JS) and I am looking at bringing in Scratch and/or Python.

So am I wrong about it just being a fancy, overpriced wall hanging?  Are there actual uses or benefits of a SMART Board in teaching CS that I'm just not seeing?  How have you used SMART Boards in your classes?

I've been in rooms with smartboards that aren't dry erase marker safe which means if the smartboard goes down the board space is lost.

I've never used a smartboard but think I get the most bang for the buck with a projector onto a whiteboard. We can project sites, code, etc and also annotate by writing on the board directly (although the annotations can't easily be saved other than by taking a picture).


First Time Learning Non-Linear Data Structures I'm looking for effective strategies and projects for introducing non-linear data structures to students.  I currently teach linked lists, stacks, and then introduce binary trees.  A lot of students struggle with the idea that an entire structure is stored in one variable and is not in any particular order (other than infix, prefix etc).  The other thing I notice is weak recursion skills tend to spell doom when first trying to learn these data structures and their operations.  What are some ways for a struggling student to practice recursion in a meaningful way (projects or tools)?  What are some good accompanying algorithms for trees, and eventually self balancing binary trees?
The course focuses on C and is aimed at advanced high school students.

I'm not sure this qualifies as an actual answer, but let me suggest that you give yourself a course in Structural Induction. Perhaps you already know of this, of course. But the main idea is that the processing of a data structure (the method invocations) matches the structure of the data itself.
Thus, for a binary tree, a method processing an internal node (or the root) will make (recursive) calls to the two child nodes, with the recursion ending at a leaf. This is actually how a recursive descent compiler works, with the processing (parsing) exactly following the structure of the language as defined in a (LL) grammar.
One important lesson that you have to teach is that a recursion can do "work" both on the winding phase (before the recursive calls) or after (when they return). That is easily demonstrated with the following code (pseudocode) snippet:
Global s <- 0;
Fun recur x {
    If x > 0 {
        Print x; // winding phase
        recur x - 1;
        s <- s + x;
        Print x; // unwinding phase
    } Else {
        Println;
    }
    return s;
}

Translate that to your favorite language and see what it outputs for a call like recur 10.
For a tree structure that means that you can recurse (twice) before you process the current node, thus having the results of the two recursions available. This is often called "bottom-up" processing. OR, you can work top-down by computing something in the current node and passing it down with the two recursive calls. Bottom-up processing can be used to construct a tree, for example as is often done in optimizing compilers.
As proof of a "deeper" understanding of recursion. Ask the students to write a linear running time function to copy a list. A quadratic function is easy, but linear running time is a bit harder.

To teach the winding v unwinding idea I often used a matryoshka. Imagine that you have an unpainted matryoshka (which I do), and you want to "paint" it. You can either "apply colors" before the recursion of "paint" or after, stopping at the innermost doll. You can talk about how messy your fingers get if you do all of the "apply colors" operations on the winding phase, since you have to open a freshly painted doll. A bit weirder, though it demonstrates the point, is that you can "apply colors" to one half on the winding phase and to the other half on the unwinding phase.
As a bridge from linear to tree-like structures, imagine a matryoshka that has two "inner" dolls instead of one for each intermediate doll.


How to explain what code is to my parents? I am an engineering student in computer science and recently my parents asked me to explain a bit what I do, which is their way of asking "What is coding?".

They have no idea of what coding is, what languages are, lines of codes etc, and I wanted to explain briefly how it all works. I wanted to explain what a programming language is and how it is used to write algorithms, make computations... To me it seems very logical that the interpreter reads lines of code from top to bottom, understanding the statements of a particular language.

I can't find the right words and nice examples to help them understand globally how it works.

How can I explain this idea to them?

Coding is like writing a recipe for the computer to follow so that it solves your problem. The computer "reads" each step, and follows it, eventually reaching a solution. Some programs are better than others, just like some recipes are better than others - they are faster, they produce a better result, etc. Programmers aren't really the cooks, though - the computer itself produces the result. The programmers are more like the cookbook authors, producing the recipes (programs) for the computer to follow.

Now, I don't know about you, but I've followed a recipe before, and there have been times where I've been left wondering, "Have I put in 2 or 3 cups of flour?" or having mixed in an extra couple of chocolate chips (quite by accident, of course). A computer doesn't have these problems. It can make your "recipe" much more swiftly and accurately than you can. However, this gives you no excuse for providing the wrong recipe. No amount of accuracy will make brussels sprouts into ice cream, unfortunately.

Lastly, @dckuehn brings up a great point. No analogy is perfect, and this one is no exception (heheh). Whereas, in a recipe, you really try hard not to vary the input so as not to vary the output, most programs take different kinds of input and produce different kinds of output, according to the same rule. Sort of like you can put a bunch of different cookies in the oven to bake them - not the same input, not the same output, but a fairly similar process inbetween.


How do I teach git to a teenager I like Git, or at least the idea of it. However I can not get my head around how to use it. Therefore I would not like to teach it.

(This question is about learning to use Git. Not about comparing it to other revision control systems.)

I have used a range of revision control systems: SCCS, ClearCase, RCS, CVS, and Subversion. I then tried to learn Git. In reading the manuals I got a full understanding of its internals. I even managed to use it, but after a few days I would forget how to use it. The interface seems unintuitive. I then adopted Mercurial (hg) — a similar, but easier to use revision control tool.

I have noticed that Git is very popular, and maybe superior to Mercurial (internally, if not from a usability point of view). And am therefore thinking of giving it another go.

What can I do to make this journey easier for me?

What good user interfaces should I adopt?

I am not interested in proprietary tools; All tools should be Free Software / Open Source. They need to be available for GNU/Linux and Microsoft Windows (I have to use the latter at work).

Who are the learners?

Myself (a software engineer > 20 years experience of revision control systems).
My pupils (age 11 to 18), if I find it easy enough to learn my self.

My preference for user interfaces are

Unix (GNU/Linux) command line.
Unix (GNU/Linux) GUI.
Microsoft's Windows GUI.
Microsoft's command line.

So it is important, for me, to have a good command line tool, on my GNU/Linux machine. And important to have a good, and the same, GUI on GNU/Linux and Microsoft Windows.

My goals

To use the tool to store the history of my, and pupils, projects.
To be able to look at past history.
To be able to revert to past state.
To merge and resolve conflicts.
To never think, that live would be easier without it.

I am not against command-line usage (it is my favourite way to use the computer), I am against cryptic, hard to remember commands, that have surprising results.

I highly recommend this tutorial: http://learngitbranching.js.org/

It uses a visual representation of the internal state combined with actual commands in a sandbox environment along with a step by step walk-through that I found really helpful in wrapping my head around what each command actually did when I was new to Git.


The order of questions on examinations I am almost painfully aware of the importance of examinations as a way to create emotionally important memory-recall events, and therefore their vital importance in learning itself.  Within the examination itself, however, I usually place the questions in an order that optimizes page-layout; I want to give the students enough space, but otherwise use the fewest pages possible.

However, it occurs to me that this may not be optimal.  Is there any research (or does anyone have experience) that supports the idea that the order of question on an examination can impact pedagogic efficacy?

Exam question order is known to influence performance via confidence and self-efficacy. Put easy questions at the beginning, hard questions at the end, and group questions together if they pertain to the same topic. Difficulty should be inherent in the question itself rather than in the test taker getting oriented to the topic, question, and answer choices. Example set of recommendation, though the following link pertains to surveying rather than assessment. https://www.socialresearchmethods.net/kb/quesplac.php

I can't find the reference at the moment, but if I recall the details, a not infrequently cited example is that demographic questions accompanied a common college entrance test. Placing the questions at the end rather than at the beginning eliminated the gender difference previously observed.


What are the pedagogical methods for teaching programming? This is a very objective question. I want to know what are the methods for teaching programing?

I'll provide a parallel example to make this clearer in case this causes any confusion.

I have Portuguese as a native language and I teach English here in my country (therefore I'm an English teacher).

In English teaching there are 3 main methods (over simplified below) of teaching used here.

  Method: Communicative Approach. Author: Noah Chomsky et al. -> Where you expose the student to a simple exercise and words and how to use them and then explains what happened and follow to more advanced exercises based on what is contained in the lesson (or to what you just explained). {It can be done starting with the mother language and then moving to the language one desires to learn as you progress in the classes, or classes can be taught entirely in
  the second language with a special care with the words used for beginners.}

  Method: NLP (Neuro Linguistics Programmming). Author: Various -> You expose the student to a simple set of words translated, for instance verbs, and asks  them to translate from their mother language to the language they are learning. Moving on to vocabulary and so on. On each lesson stacking how to use the verbs, vocabulary, expressions and some grammar (usually in this order).

  Method: Immersion. Author: Krassner et al -> The student is taught, much like Communicative Approach but classes are done fully in the language and in a place where the person lives a routine with the language. To learn English (or any other language as a matter of fact) like this, according to the method, one would have to live in an English speaking country.

=========================================================================
Edit:
I believe this line is causing a bit of a confusion

I did not meant that Learning a human language is the same as learning a programming language. I'm just saying that, in English language teaching we have methods to do that, as listed above. Does CS have one (or many)?

Continuation of the original text:

-> Part I believe is causing confusion:

So above I believed to have expressed what I meant with "What are the pedagogical methods for teaching programming?" Making a parallel with Teaching English as a Second Language in order to __illustrate__.

I think from here things were well understood.
Why do I ask this? And what answers I don't expect seeing.

What I see is that people usually say; "In this site, there is a very good teacher, or resources for learning how to code. You can use it." As a way to mirror that, to teach someone or a group how to code instead of pointing to a (or various) method(s)

That is not my question. It is very clear. What are the methods for teaching programming?

====!And not; What are the methods for learning how to code?!========

I hope this can help me, because I haven't really found an answer to this. Or at least not as explicit and detailed as I see in other areas of the teaching world.

I don't need a detailed explanation but if you wish to provide something more elaborated I will be thankful. Nevertheless the method(s) is(are) just fine and what I'm looking for.

Have a great day.

Note: Originally asked in -> https://stackoverflow.com/questions/50586854/what-are-the-pedagogical-methods-for-teaching-programming?noredirect=1#comment88194521_50586854

I'm not sure this is what you are looking for, but from personal experience (and probably in no way 'official' educational paths) :

I gave each approach a name in order to be able to seperate them in case users want to discuss them.

Frontal Theory: Speak in-class about constructs and syntax, students code at home (exercises).
Collaborative: students and teacher code together in-class
Guide-and-Release: Introduce them to the topic of coding in-class, then let them complete online-courses (there are lots of websites which provide virtual classrooms with a "control" function for the teacher observing the students' progress.)
Project based: Each student / group of students decide in the beginning what kind of software (scale is up to them/teacher) they want to write / rebuild (e.g. a blogging site / a tic tac toe game in the command console). The teacher helps students research what is necessary for it, how to approach it. Learning progress happens throughout the development.

@Project based: example for the tic tac toe game: we need input, output, a way to store values, loops. Then start with researching&learning how input/output works in the chosen language. Gradually build up knowledge until the game can be implemented. (Probably my favorite approach, as it focuses on learning how to analzye/break down a problem, solve small instances one at a time and then put components / partial solutions together -  which is coding at its core in my opinion)

Edit: Removed the following approach from above, as it is rather a didactical approach and not on the same "educational level" the previously mentioned - but for completeness, here you go:

Free Style: Students learn by themselves in-class, the teacher is only available as a "helping hand" if problems come up. (No solution on a silver platter, but rather giving points on where a solution can be found - stackoverflow, documentations etc.)


Criteria for admission to AP CS courses in high school The question is simple and direct here: what objective criteria are helpful* in admitting students to AP CS courses?

(By "helpful," I mean criteria that have some worth as indicator of future success in the course.)

Some context might help. Where I teach, there is no computer science pre-requisite to AP CS Principles, and when there was only AP CS A, there was not for that either. For most of my students, their first CS class is indeed an AP-level course.

Absent of this background, it is hard to predict what objective factors (I stress "objective" here for a reason) will help indicate how a student might perform at the AP level in CS. This is also crucial because all AP courses I've ever taken or taught have required applications due to both the rigorous nature of the course and the need to whittle down an applicant pool that is larger than the number of available spots in the course.

I have a couple theories of my own based on a few years of admitting students using several factors, but I will wait to self-answer until others share their practices.

Note:

Good answers need to include not only what the criteria used is, but also evidence - either in research or local practice - that supports the correlation between the chosen criteria and the eventual success, or lack thereof, of the students in AP CS courses (or, at a minimum reasonably advanced high school level CS courses).

I don't have criteria with evidence that are indicators of success, but I have some I use that can indicate the lack thereof.

At my school, although we are not allowed to specify prerequisites for our courses, the other programming teacher and I "vet" prospective programming students using data from students' literacy and math history (the two of us combined teach VB.NET, C#, SAS, and AP CS A).  The literacy and math scores come from the prior year's end-of-course tests.  This data is made available in an interface provided by, I believe, Pearson Education.  For each student we can see something like the following:

Where the colors/shapes mean the following:

We have found that Red or Yellow in math and/or Red in literacy are accurate predictors of a student who will struggle in programming.  Just looking at the data from last semester, when I taught programming I (VB.NET), the only C's and D's I had in the course were the students who had Red or Yellow math scores or Red literacy scores.

Every semester when we go through our rosters (we are doing it right now for next fall), if we encounter a student who has signed up for a programming course who does not have a strong math or literacy foundation, we first approach their counselor, show them our prior semesters' data, and talk to them about the student's chances of success.  The counselor will then talk to the student, and maybe the parents.  Sometimes the student will choose to take something other than programming.  Sometimes the student will want to take programming anyway, and that is fine.  We just want the student (and parent(s)) to be aware that, if they want to be successful in programming, considering their history, they may have to work extra hard or get extra help.

While this process we go through may smack of "profiling", our goal is to help every student be as successful as they can be.

Note that the converse, a student who has all "Green" data, is not necessarily an indicator that they won't struggle.  There are, obviously, other factors, many not quantifiable until you get to know the student:  motivation, maturity, perserverence, and hard work.


Making induction meaningful I've been teaching inductive proofs of code correctness to high school students for three years now, and the instruction has steadily improved.  Many of the students come in not having done inductive proofs in math yet, so it takes some time to teach this.

As of this year, the large majority of my students are writing virtually 100% correct proofs for algorithms that they have never seen before.  However, this takes a large amount of class time (many weeks), and it has become a box-ticking exercise that the students are not excited by.  This is certainly not what I want.

Here are a list of some of my personal favorite takeaways from this unit:

You are proving an infinite number of things using a finite amount of ink.
We normally conceptualize our variables as just that: variable.  But really, they are a cascading series of constants, and the reality is that the runtime program goes sliding through these constants. We can designate these constants using subscripts.  If you have a for loop in which i increments from 0 to 50, $i_0$ is always 0, and $i_1$ is always 1.  They're not truly variable.  It's a subtle distinction, but I find it beautiful, and I also believe that it is a nice lead-in to that aspect of functional programming.
We can make real guarantees about code in the first place.

This list has been thus-far unconvincing to my students.  I need to make this unit more exciting.  How do I demonstrate to my students that this is both interesting and beautiful?

Since you are doing this in the context of code correctness, one incentive is to tell student that in some cases, you have to prove code, not test it. Anything critical (pick up your example, nuclear plant command system, plane autopilot, …) requires the highest level of confidence. Tests are always going to be partial. They will test 1, 10, 1000 possible inputs but that's it. You need to show that your program behaves well for all possible input.

Since many programs work by splitting their large input into smaller cases, proofs by induction are a good fit. It also gives a high degree of confidence since often, the structure of the proof will follow the program step by step (while a proof by contradiction would only be remotely related to the code).

You can also show that often, a proof by induction will give you an actual program. The basic toy example is the one of the Tower of Hanoi (where you have three pegs and N discs). The proof of the theorem stating "it takes 2^N moves" is actually the recursive algorithm that implements the moves (and you can make an animated version of the algorithm in JS or something to make it visual).

Another example is quicksort. Give the code of quicksort. The (strong) induction proof of correctness has the exact same structure has the code.
You can use several divide and conquer algorithms for this (Binary search also works very well AND is really cool because you can also show another issue with proof of code : Most 'student' implementation of binary search are buggy, since they tend to write middle = (left + right)/2 which will overflow for large arrays (where left+right > max_int). This bug was present in the Java standard library. So you also have to talk about the mathematical model of the program (used for proofs, where you have potentially infinite memory, Natural numbers) and the program (fixed size integer, limited, memory, …).


How to make term reports, easy to do (and secondly effective, and accurate) In my school, we have to produce a report for each pupil each term. These reports have a grade for behaviour, attitude to learning (so far so good), and predicted grade.

When I was at University studying to be a teacher, we learnt that summative feedback leads to poorer outcomes and formative feedback leads to good outcomes. (See Carol Dweck's TED talk for an introduction on this.) I even read one study that shows that summative feedback undoes the good of formative feedback.

Therefore, I want to find a way to do this, that:

Is accurate (though not necessarily precise)
Does not disturb the kids from learning too much
And, more importantly, is quick and requires little effort

I've always admired the Swiss' education system of teaching kids where they rarely have examinations, but rather through constructive assignments and homeworks to teach students. At a conference I've attended, I heard a quick introduction on gamification of education and I am trying this out with some students.

Here is what I proposed:
Assesments (excluding exams and final project, due to curriculum and school board constraints) have unlimited re-tests, limited to once a week.
0.5 credit is awarded for 50%+ and 1.0 credit is awarded for 80%+
At the end of the term, their number of credit earned is divded by total number of credits for a "term work" grade worth x% of their final mark
The goal here is for students to not worry about a 50, 60, 70, 80, 90 or 100, but rather track their progress through completion of content. I believe the unlimited retries gives incentive for students who are falling behind to realize early and catch up immediately, rather than later. This is to avoid the mentality of giving up because it is "too late" or "wait for next test".
 To some degree, I believe in the innate competitive nature of CS students transferred from love for gaming

I believe this method (with modification to suit your needs) meets what you are looking for.
Accurate enough to give a % mark because you track progression. Although I foresee multiple 100% with this method
Does not disturb students because they are well aware of their progress, and know they can make improvements rather than blankly stare at an unfortunate poor test 1
Quick and low effort - I just use an excel macro and export to show my class after each week their progress