Pratica di Shadowing: Your AI broke the layout. Now what? - Impara a parlare inglese con i video

Creazione lezione...
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.

Perché praticare il parlato con questo video?

Imparare l'inglese con YouTube è un modo efficace per immergerti in contesti reali, e questo video è perfetto per la pratica di conversazione in inglese. Il speaker usa un linguaggio tecnico ma accessibile, con frasi concise e esempi concreti, ideali per esercitare l'attenzione e la ripetizione (o shadowing). Attraverso la discussione su problemi di layout CSS, impari non solo vocaboli specifici del settore, ma anche come spiegare passaggi complessi in modo chiaro: una skill fondamentale per chi vuole comunicare in inglese in contesti professionali o accademici.

Grammatica e espressioni nel contesto

Analizziamo alcune strutture chiave del video:

  • "There's those that can identify...": L'uso di "there's" con plurali è una caratteristica colloquiale comune. In inglese, spesso si usa "there's" invece di "there are" per semplificare il flusso, anche se grammaticalmente "there are" è corretto. Nota come il speaker lo usa per mantenere una conversazione fluida.
  • "This is what the issue is": La struttura "this is what..." è utile per definire o spiegare un concetto. È una forma più naturale di dire "questo è il problema" e si usa spesso in discussioni tecniche o esplicative.
  • "Even if I put that, let's do it really quickly here...": "Even if" introduce una condizione, mentre "let's do it" è un invito diretto. Combinati, creano un tono collaborativo, tipico di video tutorial. Imparare a usare questi modi di esprimersi aiuta a interagire in modo più naturale in situazioni di lavoro o studio.

Trappole di pronuncia comuni

Migliorare la pronuncia inglese richiede attenzione a dettagli come l'accento e la lunghezza delle vocali. Ecco alcuni punti da notare nel video:

  • "catastrophic": La pronuncia corretta è /ˌkætəˈstrɒfɪk/, ma spesso gli italiani tendono a accentare la seconda sillaba invece della terza. Ascolta come il speaker mette l'accento su "stro" per dare alla parola il suo tono giusto.
  • "constraint": La "ai" in "constraint" si pronuncia /eɪ/, non /aɪ/. Molti commettono l'errore di dire "con-straint" (come "train"), ma la corretta è "con-streint".
  • "overflow": La "o" iniziale è corta (/ˈəʊvəfləʊ/ in inglese britannico, /ˈoʊvərfloʊ/ in americano). Evita di allungarla troppo, altrimenti la parola perde la sua sonorità tipica.

Per esercitarti, prova il shadowing in inglese: ripeti le frasi del video immediatamente dopo il speaker, cercando di imitare il tono, la velocità e l'accento. Usa un shadowing site per registrare te stesso e confrontarti, ma anche YouTube stesso è una risorsa fantastica per questo tipo di pratica. Ogni ripetizione ti aiuterà a rendere il tuo parlato più fluido e naturale!

La grammatica di questo video

Le strutture che chi parla usa di più, con le parole esatte del video:

StrutturaNel video
Frasi relative who / which + frase — un’informazione in più su una persona o una cosaoverflow, which is · height, which means · margins, which is
Forma passiva be + participio passato — conta ciò che accade, non chi lo fais just fixed · being locked

Cos'è la tecnica dello Shadowing?

Shadowing è una tecnica di apprendimento delle lingue supportata da studi scientifici, originariamente sviluppata per la formazione dei traduttori professionisti e resa popolare dal poliglotta Dr. Alexander Arguelles. Il metodo è semplice ma potente: ascolti un audio in inglese di madrelingua e lo ripeti immediatamente ad alta voce — come un'ombra che segue il parlante con un ritardo di solo 1–2 secondi. A differenza dell'ascolto passivo o degli esercizi di grammatica, lo shadowing costringe il tuo cervello e i muscoli della bocca a elaborare e riprodurre simultaneamente i modelli di discorso reale. La ricerca dimostra che migliora significativamente la precisione della pronuncia, l'intonazione, il ritmo, il discorso connesso, la comprensione dell'ascolto e la fluidità del parlato — rendendolo uno dei metodi più efficaci per la preparazione alla prova di speaking dell'IELTS e per la comunicazione reale in inglese.

Tecnica dello shadowing: leggi la guida completa passo dopo passo →