Why Use File Trees

ThePrimeagenClips
29 Feb 202404:10

Summary

TLDRIn this engaging discussion, the speaker debates the utility of using file trees for navigating codebases, expressing skepticism towards their conventional use. They argue for a more dynamic approach, utilizing Language Server Protocol (LSP) and tools like ripgrep for efficient code exploration. The speaker acknowledges situations where knowing a file's location rather than its name could justify file trees but advocates for fuzzy finders as a more effective solution. Highlighting the challenges of navigating projects with numerous similarly named files (e.g., index.js), they share personal anecdotes to underscore their preference for content over structure, culminating in a humorous embrace of their unconventional terminology and stance.

Takeaways

  • 😕 He doesn't understand why people use file trees to explore codebases
  • 💡 He prefers using LSP and search tools over file trees for code exploration
  • 🤔 Finds it odd when people keep file trees open all the time
  • 😠 Believes searching by content is better than by file names
  • 🧐 Does understand issues in huge codebases with many similarly named files
  • 🙂 Will sometimes know the folder location but not exact file name
  • 😌 Admits folder navigation is a personal skill issue for him
  • 😣 The many index.js files in JS projects causes discovery problems
  • 😂 Leaning into calling directories 'folders' even if uncool
  • 😎 Uses fuzzy finding when he knows which folder a file is in

Q & A

  • Why does the speaker find using file trees confusing?

    -The speaker doesn't understand why people browse file trees when looking for things instead of searching by content. He finds it more intuitive to search for specific things using tools like LSP rather than hoping to stumble upon something by exploring the directory structure.

  • What approach does the speaker prefer for navigating a codebase?

    -The speaker prefers to use tools like LSP and ripgrep to search for specific content instead of browsing through file trees. He'll only look at the file structure if he needs to create or delete a file.

  • When does the speaker admit to using file trees?

    -The speaker admits he will resort to using file trees in huge codebases where there are many identically named files like index.js, since fuzzy finding becomes difficult.

  • Why can't the speaker break his habit of saying "folders"?

    -He explains he was raised using Windows and has called them folders for so long from his early days of using DOS. He has accepted he will likely never be "cool" enough to call them directories.

  • What is the speaker's perspective on file trees and directories?

    -The speaker finds the concept of manually browsing file trees to explore code confusing and unintuitive. He heavily prefers searching by content instead. But he admits directories become more useful on huge projects where fuzzy finding fails.

  • What tools does the speaker use instead of file trees?

    -The speaker prefers to use Language Server Protocol (LSP), ripgrep, and other content search tools to navigate code rather than browsing file trees.

  • When does the speaker struggle to avoid using folders/directories?

    -The speaker struggles with huge Node.js codebases that have many identically named index.js files, making fuzzy finding difficult. Directories help disambiguate in those cases.

  • Why is the speaker set in his ways about terminology?

    -Having used DOS and Windows from early days, he is too stubborn to stop calling them folders now. He accepts he is not "cool" enough for proper modern terms like directories.

  • What is the tone/mood of the speaker?

    -The tone is casual, irreverent, and self-deprecating - he does not take himself too seriously while explaining his contrarian preferences.

  • How does the speaker use LSP for navigation?

    -The speaker uses LSP to show definitions and references/usage when he has found a specific symbol, allowing him to explore related code instead of browsing the file structure.

Outlines

00:00

🤔 Why use file trees for code navigation?

The paragraph discusses why the speaker does not understand the usefulness of file tree views for navigating codebases. He prefers using language services and search tools to directly find symbols and usages. He is confused why people browse directory structures to find things instead of searching by content.

Mindmap

Keywords

💡File tree

A file tree refers to the directory structure and organization of files in a codebase. The transcript questions why developers use file trees to explore code when search tools like LSP or grep can find content instead of just file locations. It sees file trees as an odd and confusing way to understand an unfamiliar codebase.

💡LSP

LSP stands for Language Server Protocol. It is a capability provided by coding tools and editors like Vim or VS Code to show definitions, references, hover information etc for source code. The transcript advocates using LSP over browsing file trees to explore and understand code.

💡Fuzzy finder

A fuzzy finder is a search tool that allows searching for files by partial names or content. The transcript recommends fuzzy finders as an alternative to explore code instead of using file directories, since it allows searching by content.

💡Directory

Directory is the technically accurate name for a folder in a file system. The transcript humorously refuses to use the term directory instead of the more casual 'folder', leaning into not caring about technical precision.

💡Skill issue

A gaming meme referring to attributing something inconvenient or difficult to a lack of skill rather than external factors. Here, not understanding file trees is called a "skill issue".

💡Index.js

Common JavaScript file naming convention for the main entry point file of a module or package. The transcript acknowledges a use case for file directories when there are too many files named index.js.

💡Doom

An iconic 1990s computer game. Used humorously to establish the transcript author's long history and familiarity with early personal computing.

💡Windows 3.1

A vintage version of Microsoft Windows operating system from early 1990s. Adds further humorous detail to establish longevity of computing experience.

💡Folders

The transcript purposefully insists on using the casual term 'folders' instead of the technically accurate term 'directories' when referring to structures for organizing files.

💡Cool

The transcript humorously plays off not caring about technical precision as also not caring about seeming cool or modern.

Highlights

Questioning the utility of file trees for exploring codebases.

Emphasizing the efficiency of Language Server Protocol (LSP) for code navigation.

Critiquing the habit of manually searching through directories.

Advocating for specific search over directory browsing.

Acknowledging the use of file trees for file creation and deletion.

Highlighting the preference for content-based search rather than file name search.

Mentioning the use of command-line tools like 'tree' for visualizing project structure.

Discussing situations where knowing the file's location is easier than recalling its name.

Using fuzzy finders as a workaround for directory familiarity.

Identifying 'skill issue' as a barrier to efficient codebase navigation.

Addressing challenges in large codebases with numerous similarly named files (e.g., index.js).

Expressing frustration with navigating 'index' files in JavaScript projects.

Sharing a personal anecdote about early computing experiences.

Embracing the term 'folders' over 'directories' despite technical conventions.

Concluding with a humorous defiance of changing personal terminology preferences.

Transcripts

play00:00

I have to know why do you use file trees

play00:03

I I I see no reason to use a file tree

play00:06

uh exploring my codebase like even then

play00:08

I I have such a hard time with this as a

play00:10

as a concept like exploring your code

play00:14

base with a file tree is kind of odd let

play00:17

me hit you why let me hit you with why I

play00:19

think that's odd let's say I didn't know

play00:21

anything about this code base in here

play00:24

right uh let let Vim motion let's jump

play00:26

in here and I wanted to find out

play00:28

something about like say this well I

play00:31

could use I could use my LSP to show me

play00:34

where everything's at and I'm like oh

play00:36

okay okay well where's this thing used

play00:38

now I can go and look at where those

play00:39

things used okay well where are these

play00:41

things used right like why why why why

play00:46

would you use it to go look through like

play00:49

that's the thing I don't understand is

play00:50

why people just like walk through their

play00:53

directory hoping to find something

play00:55

usually I have something I'm looking for

play00:57

something specific I'm trying to find

play00:59

and when I find the thing that's

play01:00

specific then from there I take that as

play01:03

a way to jump off with my LSP or with

play01:06

something like rip grip to go find it

play01:07

right APM motion and that's when I go in

play01:09

here and I go in like okay where's all

play01:11

these different places that it's used

play01:12

okay right like it just seems odd to use

play01:15

it for anything else like that's what

play01:17

I'm confused about right like if I need

play01:19

to create a file sure if I create a file

play01:21

then yeah I hit right here and I you

play01:22

know I create my file and there we go I

play01:24

have my file right here and I'm like ah

play01:26

it's look look at my new file it's right

play01:28

here if I need to delete it of course

play01:29

I'll delete it but I often don't do

play01:31

anything else you know what I mean

play01:34

that's why it's always so confusing when

play01:35

people have file trees and they have

play01:37

file trees always open it's like what

play01:39

what you search by content instead of

play01:41

file names yeah exactly that's what

play01:43

that's why I need to know I need to know

play01:45

why if you want to see a file tree of a

play01:47

project just use uh tree C I know but

play01:50

what's the like for me it's the easiest

play01:52

path to get uh to the thing that I want

play01:54

to go uh to the tree because I know the

play01:57

location but I don't know the name or

play01:58

it's hard to get there with the LSP yeah

play02:00

I mean if that that happens to me every

play02:02

now and then where I don't know the file

play02:04

name but I generally know where it's at

play02:06

I like let's just say that I know where

play02:08

it's at well I already know right away

play02:09

it's called motion right so I'm like oh

play02:12

it's motion tree there we go right and

play02:14

so I'll just still use a fuzzy finder

play02:16

because I know the folders that is in

play02:17

there that that that felt that is I mean

play02:19

it's truly just a skill issue is how I

play02:21

look at it I just have a hard I just I

play02:23

find it odd right and I I want to

play02:25

understand this I I do want to

play02:28

understand this because it just feels

play02:29

like weird issues in huge code bases

play02:31

there's like aund emotion trees yeah I

play02:33

mean okay so I do understand that one

play02:36

which is when you work with no JS and

play02:38

you have index.js or index.ts or index.

play02:42

TSX like

play02:44

9,000 times like that's difficult I I'm

play02:47

on I'm on hey I'm on your team uh

play02:49

obviously you can do something where you

play02:51

can throw in like you know Vim Lua init

play02:55

right you can try to like get your way

play02:57

there I don't know I don't know why I

play02:58

didn't find that one oh that's because

play03:00

it's Lua Vim AIT right you can kind of

play03:02

try to get to the thing you want with a

play03:04

little bit of uh folder little bit of

play03:07

foldering but man IND I I do understand

play03:09

the index.ts problem because right now

play03:12

in the tvi directory I think there's

play03:14

like something like a thousand anits and

play03:17

so it is like it's it's virtually

play03:18

impossible to search for the thing you

play03:21

want via fuzzy finder just because of

play03:24

how many index do whatevers there are

play03:26

and so I find myself you know I said

play03:30

folder man damn it dude I can't help it

play03:32

I was I was born and raised with the

play03:33

gosh dang Windows environment okay I

play03:36

played Doom I installed Doom when I on

play03:37

Windows 3.1 right like it was or

play03:40

technically it's just Doss I installed

play03:41

it for dos back then and like I can't

play03:44

help it we called them F folders okay

play03:46

and it's just going to stick with me you

play03:48

know what I'm sick and tired of trying

play03:49

to change myself and try to make it so

play03:52

that folders is like still uncool and

play03:54

just deal with the fact that they're

play03:55

called directories you know what I'm

play03:56

leaning in I'm leaning in and I'm just

play03:59

going to call folders and I I don't I

play04:01

don't care okay I'm not cool never been

play04:03

cool never been cool never will be cool

play04:05

I'm not planning on being cool cool and

play04:07

you can folder these nuts okay