Skip to content

Conversation

@hardy-ethan
Copy link
Contributor

@hardy-ethan hardy-ethan commented May 6, 2025

The XCode input redirection method used in the tutorial is ~7yrs old. It only allows input redirection of a file hardcoded at compile time.

EECS281 has since moved on to a more advanced (and useful) method that allows arbitrary input redirection, which can be controlled via regular cli (i.e. adding < myInput > myOutput to the command line arguments).

This header is well tested, and is recommended to every EECS281 XCode user. It takes minimally more effort (an extra command to download a header file), and provides a much better experience.


This commit is the start of efforts to base most of the EECS281 setup guides off of the EECS280 setup guides.
(Well, officially based off of them, instead of copy-pasted with small modifications)

@hardy-ethan
Copy link
Contributor Author

Workflow run fails because my fork doesn't have the secret token for PR previews

@awdeorio
Copy link
Contributor

awdeorio commented May 6, 2025

Thanks for helping bring more harmony to the EECS 280 and EECS 281 tool chains!

The updated xcode_redirect() is definitely more flexible. It's also harder to set up and harder to understand what's going on from the student perspective.

In EECS 280, we've moved away from input redirection, instead using input files and command line options/arguments. The current input redirection work-around in the tutorials is now for other courses and completeness only.

Avoiding required input and output redirection has a few nice side-effects:

  • Lower the barrier to using a debugger
  • Out-of-the-box support by all IDEs and debuggers
  • Avoid long messy output when debugging
  • Consistent with typical UNIX programs, which typically do not require stdin/stdout

I wonder if EECS 281 might consider using file input to gain these benefits.

@hardy-ethan hardy-ethan deleted the update-xcode-input-redirection branch August 24, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants