Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time-To-First-Hello-World in VSCode #140

Open
expikr opened this issue Oct 3, 2023 · 2 comments
Open

Time-To-First-Hello-World in VSCode #140

expikr opened this issue Oct 3, 2023 · 2 comments

Comments

@expikr
Copy link

expikr commented Oct 3, 2023

Zig's blazing fast compile speed+caching practically enables a REPL-ish workflow in teaching scenarios.

Since the VSCode extension is meant to be the official teach-your-friend-to-code entrypoint, it would be wise to optimize the UX flow for time-to-first-helloworld by adding a button that just does zig run <current file>.

Currently the extension only has build-workspace in its command palette:

image

It makes more sense to have "dummy proof GUI" optimized for beginners working in a per-script basis instead.

Obviously I'm not asking to cater entirely to the noob-usecase to the point of uselessness once you've outgrown it after ten minutes of onboarding.

But from the learning-curve perspective it's kinda pointless to have the only GUI shortcut to be made for people who are probably already well-versed with the terminal and build pipeline to begin with.

Right now the "Zig for dummies" setup I have is to put a zig run shortcut in the SendTo folder like so:

image

image

Perhaps this could also be part of the recommended installation process along with adding to PATH?

@andrewrk
Copy link
Member

andrewrk commented Oct 3, 2023

Moving to https://github.com/ziglang/vscode-zig

@andrewrk andrewrk transferred this issue from ziglang/zig Oct 3, 2023
@expikr
Copy link
Author

expikr commented Oct 3, 2023

Incidentally, would it make sense to open a discussion category oriented towards the pedagogy aspect of Zig?

I see a lot of complaints online about the inadequacy of teaching material, I feel like even if it's not gonna be tackled anytime soon at least we could concentrate the discussion about its pain points in the learning side.

Especially since once you get acquainted with the language more and more, you start to forget the minutiae that are trivial in hindsight but imparts great friction at the start.

In a sense, if you don't document it early, you will unavoidably throw away the ladder from which you had climbed up.

Having a place to keep track of all the little insights and mini-steps you've climbed, no matter how trivial, provides invaluable datapoints for how to write the "proper" learning materials later on.

An example, I've always felt that forcing "Hello world" to be the standard "first line of program you write" is detrimental in showing off what the language could do, I think the following inspires a beginner's imagination much more readily:

const std = @import("std");

pub fn main() void {
    std.debug.print( "{ } plus { } is { }" , .{1, 1, 1+1} );
}

Whereas Hello World examples makes students wonder "why so much song and dance just to print out something I explicitly typed?", this example suggests to the learner the dynamic potential of computation---they can immediately start playing around tweaking the expressions numbers to get outputs automatically.

If they misunderstood the syntax and tweaked the first two arguments of the struct to 2 and 2, upon seeing the output "2 plus 2 is 2" they can immediately spot why it was wrong.

And a second lesson

const std = @import("std");

pub fn main() void {
    const a = 1;
    const b = 1;
    std.debug.print( "{ } plus { } is { }" , .{a, b, a+b} );
}

teaches by demonstration how and why you'd want to parameterize things in certain ways.

I think the core theme of examples in pedagogy is to write them in such a way that invites tinkering without intimidation, and to teach by stimulation rather than by persuasion.

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

No branches or pull requests

2 participants