Homework questions?

Is this site really the place for people to be asking homework questions?


IMO, no. But you can’t escape help vampires either.

I personally am fine with it. If we get a large number of such topics, we can eventually add a “Learning Swift” sub-category, but we don’t need that yet. As far as I’m concerned, we should be embracing and welcoming people who are new to Swift, and helping them learn.

For homework questions specifically, we should refrain from giving actual solutions, but if someone posts a reasonable attempt that shows they are trying, then hints and advice are appropriate.

In fact I would go further, and say that we should *also* accept posts asking for help with Cocoa / UIKit / other frameworks, even third-party frameworks, as long as they are working in Swift. We want to encourage people to use Swift, and help them to learn and improve their skills. It should not matter to us whether the thing they don’t understand comes from the standard library or otherwise.

In other words, I think the “Using Swift” category on this forum is *exactly* the place people should go when they need help using Swift.


The problem with these kinds of questions is they literally don’t help anyone else and have no value in the archives

  1. Write a function that will take the name of an item for purchase and will return the cost of that item. In the body of the function, check to see if the item is in stock by accessing it in the dictionary stock. If it is, return the price of the item by accessing it in the dictionary prices. If the item is out of stock, return nil. Call the function and pass in a String that exists in the dictionaries below. Print the return value.

unless someone is in the same class as the person, no one will learn anything from this.

1 Like

This has been my experience as well. And 7/10 times if it’s someone completely new to programming, when people give vague answers in the hopes that the person will sit down and try and learn from what was said, they’ll just copy-paste any tidbit of code that may have been posted and then come back and say, “this didn’t work, what do I do now?”

Maybe I’m ranting a bit from years of supporting multiple open-source libraries and being in programming forums, but this has been my experience


There’s a lot of good thinking about homework questions at the Stack Overflow Meta site.