シャドーイング練習: Your AI broke the layout. Now what? - 動画で英語スピーキングを学ぶ

レッスンを作成中...
1
The most undervalued skill in front-end development right now has nothing to do with prompting, but instead it has to do with identifying and fixing problems,
2
because every now and then AI is going to get things wrong.
3
Now this doesn't happen every time you prompt something, and it's not that all of the errors are catastrophic, though that definitely can happen from time to time,
4
but when these problems do come up there's two kinds of developers that are out there.
5
There's those that can identify the problem in under a minute and go ahead and fix it relatively quickly, And there's others who spend half an hour reprompting the AI trying to understand what's wrong with it
6
and trying to get it to fix the problem that it created in the first place.
7
And being a CSS person, I see this happen with CSS a lot.
8
So we're going to dive in
9
and look at some of the things you can do with CSS to be able to solve the problems
10
that come up and the types of things you want to be looking at and identifying when things happen.
11
And this is actually a challenge that is in my course, CSS Demystify, that we're going to look at and do together where this is what we want.
12
And there's some problems right now.
13
And so let's jump to full screen mode here and I'm just gonna make the font size bigger.
14
So, you know, for recording purposes, you guys can see what's going on and everything looks okay.
15
In terms of the markup, I don't see anything that would be catastrophically problematic there.
16
But when it comes to CSS layout issues, it's really useful to be able to quickly look at things and go red flag right away.
17
This is a very simple example of the types of things that you might be looking for.
18
But we have like our text is too close to the top over here.
19
We obviously have some overflow, which is the easiest problem.
20
And there's a few other smaller things here that can easily pop up.
21
So the very first thing is just fixed widths and heights.
22
Now, LLMs generally don't do this these days, but it is still one of those things that we want to avoid at all costs.
23
And I always say, if you're going to be setting a size on something, you don't want to set a fixed size, you want to set a constraint.
24
So I'm going to set a max width here.
25
And that means, you know, I'm actually able to get smaller than that.
26
And we can see here it's shrinking and growing instead of being locked in at that size.
27
And for a height, again, you could set a constraint if you need the constraint, it would be a min height, which means like if this was bigger,
28
then it would be able to be bigger.
29
And so like most of the time, height is actually a useless declaration.
30
And this isn't the type of useless declaration that an LLM will generally make.
31
It's usually a person will throw that on there.
32
But if we don't set a height, height auto works.
33
It's fantastic.
34
It works with how the browser wants to work as the content has different amounts of space.
35
It can adjust and grow and shrink and do what it needs to do.
36
But the types of useless declarations that LLMs do do every now
37
and then actually does sneak its head and is what's causing the overflow over here.
38
And if I come and take a look, there's a width 100% right here.
39
And this is what the issue is.
40
And if we take this off, you're going to see it fixes itself.
41
Nice, right?
42
Some eagle-eyed people watching this might be going, Kevin, that wasn't the problem.
43
The problem was that you never declared a box sizing border box, but that's not correct.
44
Even if I put that, let's do it really quickly here, it's going to do a border, not border, box sizing of a border box on here.
45
It's fixed it a little bit, but it's still not completely there.
46
And the reason for that is box sizing border box with 100% plus margin, margins are outside of your border box.
47
It's not included in there.
48
Just like height, a lot of the time the auto works fine.
49
Same thing here.
50
The width of auto works fantastically well, and I don't actually need to declare it width there.
51
So we can get rid of that one.
52
Our layout is almost there.
53
We have the major issue I would say right now is, do I even want margin on here?
54
When you have an element inside, you generally don't want to put margins outside.
55
And this is the type of thing that can sneak in sometimes
56
because you're focused on the one thing that you're writing code for and you go, I need space all around it.
57
But this would probably make more sense if I took this margin off completely to begin with, which now I guess that width 100% wouldn't be an issue if you did have your box sizing.
58
But then coming all the way back up to my card, I would replace that with this padding of the 24 pixels here, which adds it all around.
59
And anytime you need more background, we want to come in with some padding.
60
So quick things that we can identify there.
61
And now the main issue is we have extra space here.
62
We had weird spacing.
63
We still have weird spacing there.
64
And the spacing down here at the bottom is also getting kind of weird as well.
65
Once again, margins start rearing their ugly head.
66
We had collapsing margins going on.
67
Now we actually have extra margins happening.
68
So here on the title where I had this margin top because I needed some extra space that wasn't actually doing anything.
69
I can remove that.
70
And not only can I remove it, I actually want to say that the margin top is zero.
71
We can have a CSS reset here that's getting rid of all of our margins.
72
That would probably be a little bit more standard, but we can see we got rid of that weird space at the top there.
73
And then here I would probably want to come down on the content.
74
And it's not even on the content, it's coming from the paragraph here.
75
So maybe my content, you know, this is where maybe you actually have a star of a margin of zero, and then that gets rid of all of the spacing.
76
And then here we can do a display grid
77
and then a gap of whatever space that we want to have to replace the margin with gaps.
78
There's a few different strategies here.
79
I'm not always a fan of this specific one.
80
There's other ones that I do like.
81
And of course, this is all part of my course, CSS Demystified, where I talk a lot about this.
82
This is part of my Making Sense of Layouts module that's here right now.
83
We have strategies with dealing with margins, which is all about bringing in the different amounts of space, coming in with grid, creating structured ones when we want to do a flex box with grid, all the different things like this.
84
And the whole point of the course is to understand CSS better.
85
This specific module about layouts.
86
I'm doing a new module right now called Writing Resilient CSS
87
which is all about writing CSS that can scale and be maintainable.
88
And it's all about getting you to understand CSS better.
89
So whether you're writing it yourself and you just want to be more efficient and not be fighting with the CSS,
90
or if you are using an LLM or some other AI tool to write CSS for you and other front end stuff, but every now and then there are problems that come up or things to debug,
91
you'll be able to identify the problems easily, quickly, and fix them while you're at it.
92
So if you're interested in that, the link is down below.
93
And with that, I want to say a very big thank you to my enabler of awesome, Johnny, as well as all my other patrons and channel members for their continued support.
94
And of course, until next time, don't forget to make your corner of the internet just a little bit more awesome.

このレッスンで学ぶこと

このビデオを通して、フロントエンド開発者がAIが引き起こすレイアウト問題を解決する方法を学びながら、英語のリスニングとスピーキング力を向上させましょう。特に、技術的な用語の発音や会話の流れを把握し、shadowing(シャドーイング)の練習で自然な発音とリズムを身につけます。IELTSスピーキング対策にも役立つ、実践的な英語表現をマスターできます。

重要な語彙とフレーズ

  • front-end development(フロントエンド開発): ウェブサイトの見た目や操作性を担当する分野
  • prompting(プロンプティング): AIに指示を出すこと
  • CSS layout(CSSレイアウト): CSSでウェブページの要素を配置すること
  • overflow(オーバーフロー): 要素が指定された領域からはみ出す現象
  • box sizing(ボックスサイジング): 要素の幅と高さの計算方法を指定するCSSプロパティ

シャドーイングの練習コツ

このビデオのスピードは中程度で、話し手の口調は親しみやすく説明的です。英語の発音を良くするために、まずはビデオを10秒ずつ止めながら、同じリズムとイントネーションで繰り返し言ってみましょう。「fixed widths and heights」のような技術用語は、発音を確認しながら、自然につなげることが重要です。shadow speechの練習では、話し手のポーズや強調する部分を真似ることで、会話の流れを理解しやすくなります。また、shadowing siteを利用して、自分の発音と原音を比較しながら修正することもおすすめです。少しずつ慣れてきたら、ビデオを止めずに追従するようにしましょう。この練習はIELTSスピーキング対策にも最適で、スピードと正確性を同時に鍛えることができます。

この動画の文法

話し手がよく使っている文型を、動画の実際の表現とともに紹介します。

文型動画での表現
関係詞節 who / which + 節 — 人や物について情報を加えるoverflow, which is · height, which means · margins, which is
受動態 be + 過去分詞 — 誰がするかより、何が起きるかに焦点を当てるis just fixed · being locked

シャドーイングとは?英語上達に効果的な理由

シャドーイング(Shadowing)は、もともとプロの通訳者養成プログラムで開発された言語学習法で、多言語習得者として知られるDr. Alexander Arguelles によって広く普及されました。方法はシンプルですが非常に効果的:ネイティブスピーカーの英語を聞きながら、1〜2秒の遅延で声に出してすぐに繰り返す——まるで「影(shadow)」のように話者を追いかけます。文法ドリルや受動的なリスニングと異なり、シャドーイングは脳と口の筋肉が同時にリアルタイムで英語を処理・再現することを強制します。研究により、発音精度、抑揚、リズム、連音、リスニング力、そして会話の流暢さが大幅に向上することが確認されています。IELTSスピーキング対策や自然な英語コミュニケーションを目指す方に特におすすめです。

シャドーイングのやり方: ステップ別の完全ガイドを読む →