- Видео 1 480
- Просмотров 1 016 200
Code Ryan
США
Добавлен 25 янв 2022
I'm Ryan Solomon and my goal with this channel is to provide resources that help you build whatever you want to build.
A Developer Lesson Learned The Hard Way
As a web developer, it can be easy to just push a PR without considering how you can make things more maintainable and extendable in the long run.
Просмотров: 1 572
Видео
Do You Need A Degree For Software Engineering?
Просмотров 11014 часов назад
I discuss my experience with having a college degree for software engineering and if I think it's needed or not.
The Modern Guide To Using State In React.js
Просмотров 68521 час назад
I show you a step by step process for how to think about using state in React.js
I Really Didn't Understand This..
Просмотров 2,5 тыс.День назад
Today, I discuss declarative vs imperative programming in the context of React.js and why it matters.
This Is A New Helpful Feature In Next.js 15
Просмотров 1,2 тыс.14 дней назад
This Is A New Helpful Feature In Next.js 15
3 Next.js 15 Project Organization Strategies
Просмотров 1,2 тыс.21 день назад
3 Next.js 15 Project Organization Strategies
Doing This Is A Bad Idea In Your React Apps
Просмотров 71721 день назад
Doing This Is A Bad Idea In Your React Apps
NEW Next.js 15 Feature! Enhanced Forms
Просмотров 2,4 тыс.28 дней назад
NEW Next.js 15 Feature! Enhanced Forms
Master 3 Essential Next.js Concepts in 4 Minutes!
Просмотров 487Месяц назад
Master 3 Essential Next.js Concepts in 4 Minutes!
A Commonly Misunderstood React Concept
Просмотров 701Месяц назад
A Commonly Misunderstood React Concept
Many React Developers Don't Understand This
Просмотров 2,1 тыс.Месяц назад
Many React Developers Don't Understand This
The Next.js Mistake That Breaks Your Data
Просмотров 572Месяц назад
The Next.js Mistake That Breaks Your Data
The Complete Guide To Mastering React State
Просмотров 321Месяц назад
The Complete Guide To Mastering React State
Master React: Essential Event Handling Techniques
Просмотров 4882 месяца назад
Master React: Essential Event Handling Techniques
EASY UX Upgrade: Snap Scrolling with Next.js & Tailwind
Просмотров 6862 месяца назад
EASY UX Upgrade: Snap Scrolling with Next.js & Tailwind
Avoid This Common React Mistake Newbies Make
Просмотров 1 тыс.2 месяца назад
Avoid This Common React Mistake Newbies Make
The Surprising Key to Overcoming Coding Blocks
Просмотров 1272 месяца назад
The Surprising Key to Overcoming Coding Blocks
THIS Is The HARDEST Part Of Software Engineering
Просмотров 8262 месяца назад
THIS Is The HARDEST Part Of Software Engineering
React State Explained: The Key to Dynamic Apps (Beginner's Guide)
Просмотров 1602 месяца назад
React State Explained: The Key to Dynamic Apps (Beginner's Guide)
5 Things I Love About Being a Software Engineer (And You Will Too)
Просмотров 1892 месяца назад
5 Things I Love About Being a Software Engineer (And You Will Too)
Unlock React's Power: Understand Your UI as a Tree Structure
Просмотров 2692 месяца назад
Unlock React's Power: Understand Your UI as a Tree Structure
5 Things I HATE About Being A Software Engineer
Просмотров 1352 месяца назад
5 Things I HATE About Being A Software Engineer
What is React.js, really? Complete Guide For Beginners and Pros
Просмотров 2593 месяца назад
What is React.js, really? Complete Guide For Beginners and Pros
Build a CLEAN Dropdown List in Next.js with Tailwind CSS
Просмотров 4063 месяца назад
Build a CLEAN Dropdown List in Next.js with Tailwind CSS
Master React.js Lists: Easy Rendering Techniques Explained!
Просмотров 2673 месяца назад
Master React.js Lists: Easy Rendering Techniques Explained!
Next.js Pitfalls: Avoiding Unsupported Client and Server Patterns
Просмотров 2823 месяца назад
Next.js Pitfalls: Avoiding Unsupported Client and Server Patterns
A lesson that I learned the hard way: There is no "right way". Avoid premature optimisations! The first example works perfectly fine without even requiring any JavaScript. When you need to change it, you'll easily see all places that need to be adjusted at the same glance. Adjusting multiple lines at the same time is almost no work, especially with the right IDE. As long as all the lines to change are obvious, you don't introduce any technical debt! The architecture is simple and flexible. But what about the second example? You bake the assumption that the texts might change while the classes stay the same into the architecture. Now, if your customer decides that one of the buttons needs custom markup, what are you going to do? You'll need to refactor, maybe create a second array with class names, or maybe create an array of objects that hold the text and the class names? But what about the class names that are the same? Maybe spend some time figuring out the "default" classes and a way to add custom ones and remove some of the default ones? What about other extra markup? Maybe, you want an icon before one of the texts, maybe some additional accessibility attributes? You made it much harder to implement all of these changes. With the first example, it would have been easy! Don't waste your time thinking about extensibility you don't need! You'll make your code more prone to break and harder to maintain in the long run, and also less performant in most cases.
I agree with the sentiment of the video but I disagree with the example. The option on the left is the simplest and optimal solution to this problem. If you need to change a style you can find and replace within your selection. No worries. The option on the right adds complexity for no gain. Premature optimisation is often the enemy of good software. Let's say that you have a second page that requires navigation. A common error is to copy and paste the link list on the left. This is makes the codebase worse. You have now duplicated styles and functionality between components. It increases work as changes need to be done in two areas. It increases the risk of a bug as you may not realise the change must be done in two places.. At this stage, you would want to create a NavigationLink component to encapsulate the styling and functionality. The option on the right in the video would be suitable for dynamic pages and again, you would likely use a NavigationLink component. Like I said, I agree with the general video premise. I just feel it would be better expressed by demonstrating how developer decisions can help/hinder the maintainability of software as navigation evolves. I feel the static example in the video misses the wider point. Thanks for posting the video. It was well presented and generally enjoyed it 👍
You know, if you're working for just yourself, then what you said in this video, is correct. However, you need to put into account, that most developers work for companies. And this is where the problem truly arises. CEOs, for the most parts, they don't care about the quality of your code, they just want "fast food" software. I ain't lying here, this is a very well known fact. Just like in this video, it showed that good things take time to master. But CEOs, they don't "take time" to do crap. Therefore, most developers learned the cold, hard truth that they have to adapt to the way CEOs work, to code faster, better, in order to "race" with the speed of the CEOs. It's the "rat race" after all. Unless the CEOs change their ways of doing things, if not, I bet, more and more developers will continue to do exactly what you told them not to.
This feels a bit out of touch and passing the blame. Maintainability is important because it affects the company's bottom line. If it doesn't produce business value then you're making a bad decision in your project. If there's pushback from management then it is the responsibility of the engineers to translate how maintainability translates into future improved throughput. I get it that there's often dysfunction on software projects, but engineers need to advocate effectively too, so that non technical stakeholders are on the same page.
@@PlerbyMcFlerb "Feel"???? Buddy, because you "feel", that's why you don't understand the fact. If I, as a team leader, made bad decisions, then that is nobody's fault, but mine. However, posting fake jobs(Which are plenty), lying to employees, this thing is real and employers do that all the time. Keep in mind, employers lie to employees all the time and they do that by hiring an entire HR department to do so for them. This is not what I "feel" or "imagine", this thing is real out there. I have witnessed this lying thing between both employers and employees day in and day out, I also see insane job posting without logical sense, such as "5 years of experience" for "junior developers", even more for senior developers, on a daily basis. You see, blaming other or blaming yourselves, that s*** is easy. But, understanding clear whose faults it belongs to, is the hard part. I don't deny the fact that developers also have mistakes and bad habits. But they are not the ones who started the whole thing. The employers do. If the higher ups are liars, then the bottom down will follow.
@@PlerbyMcFlerb Management is hiring profesionals to do their job, maybe don't ask professionals to explain everything they are doing and why they are doing it, because you hired them to do a job, let them do the bloody job
thanx Ryan <3 , can u link me yout video about generateStaticParams ?
thanks a lot man, simple and efficient <3
Happy it helped!
Thanks very helpful😶🌫
Key =item Is triggering me pretty hard
can you make an auth video using tanstack router ?
First comment here. I don’t have a degree yet, but learning web development currently. Here in my country they seams value a degree holder over someone that is good at what him or her does.
Great point! It definitely can depend on where someone lives
Hey Ryan👋🏻, great video! I'm currently working on a Next.js project where I have separate frontend and backend directories. I'm curious if there's a recommended way to integrate both frontend and backend within the same project directory? As a beginner learning Next.js, I'd appreciate any insights you might have on consolidating project structure. Thanks for your help! 🚀
I am encountering an issue with TanStack Router while trying to implement file-based routing. The requirement is to navigate to the homepage with a URL ending in /index.html. Could you please guide me on how to incorporate the .html extension in the routing setup, given that the project uses file-based routing?
I always asked to myself why thi new tag: now it is crystal clear. Thanks!
You’re welcome!
Thanks, i struggled with this so much. Now i get it!
Subscribed within first 5 minutes. Exactly what i was looking for. Api routes for dummies! Thank you
Happy it helped!
hey ryan i am a junior web developer and i would like to request u to review my react code that i made for login and sign-up in my project but it is not done yet. I think it will be done tomorrow. Thank you Ryan.
Who on earth writes react the same way as imperative code
What does that mean
Nice, but if you create a nextapi to handle functions from the backend, it logs users out after ah hour. I don't want to call my config from client side. I want to handle everything in next api functions
In imperative way you explicitly write the shortest possible code, that will just work, and you totally understand it. In "declarative" way you write the code you hope will work, using lots and lots of code that someone else wrote, and you, more often than not, don't really understand how it work.
I don't think that's how it works....
@perigord6281 How you think it does? By the miracle? Browsers understand only that f*cking vanilla js - nothing more.
@@TheHellishFrog not trying to be condescending but I have literally no idea what you're talking about
@perigord6281 Could I suggest - first get an idea based on solid understanding of the subject at hand - and only then - talk.
@@TheHellishFrog really just seems like you're placing declarative code as some sort of Boogeyman without any proper elaboration, but ok
it's quite simple: declarative means what you want, imparative means the how. look into languages that use annotation and decarators for a better understanding of declarative. like angular, typescript, spring boot. in angular if I want to create a service and use it inside a component, I don't need to imparitively create the service object and then pass it to the component to use. I just declare a class as a service and let angular do the creation and dependency inject for me into the component. HTML IS declarative, you just tell it what elements you want displayed and where and it takes care of rendering that in the DOM and displaying it in the web page. also CSS is declarative, you use it to tell the browser what colour the element should have as well as spacing, font, etc and never have to tell it how to do this. also functional programming is imparative. if you got a list of items and you want to perform operations on them and or filter some out, you would code up a for loop to imparitively iterative the items in the array and describe eact step, along with the if/else conditions. in functional programing, you would just stream the values and perfom a map, filter or other operations on it. with FP you're focued on describing the what, not the how. hope this helps.
I think you want to say also functional is declarative.
Little tip, when you update a state based on its previous value prefer using the function instead of what you're doing with the items list for example. Like : [someNumber, setNumber] = useState(0); setNumber((prev) => prev+1) This way you're sure to always have the ACTUAL previous value. :)
Can you render a layout only for subroutes?
The difference is the same
If the submit button is blue then is declarative, if he button is red then it is imperative. Simple!
Ok, I'll explain it a bit better: { buttonColor: blue } => that's declarative. setButtonColor("red") => that's imperative. But it's got to be either blue or red, nothing else will do.
This article from the React docs might also help clear this up: react.dev/learn/reacting-to-input-with-state#how-declarative-ui-compares-to-imperative
good work
Thank you!
What could this library be used for in business practice? Can someone give some examples in words? Thank you!
not sure if this is a bug but I have a [domain] route that fetches from a database and that is showing as a static route
Hmm, I’m not 100% sure what’s going on off the top of my head, but I think that’s still possible, so not necessarily a bug. If you’re concerned about it, I would maybe just try to find an example of your specific case in the docs
Redux toolkit doesn't have that much boilerplate , but as a beginner I find redux toolkit easier to read than zustand😅
Good stuff, well explained. It is great that you are not editing out the bugs!
obv info but thank you
I'm fairly sure the "ProductButton" component should just be an achor tag which you can do using the Link component. Just means you don't have to handle routing yourself.
Thanks for sharing this pattern, man. Great content ❤
You’re welcome!
But bro can you tell me what is generator function?
audio only feels like, ai talking instead of you
Bro what's the editor theme?
It’s called Winter is Coming
Thanks 👍 @@coderyan
Hi Ryan, thanks so much for this video. I'm putting together yet another weather app, I know sooooo original. What I wanted to do is allow users to type in a location in the URL bar and get the current weather. I knew dynamic routing was the answer, but I wasn't sure how to set up this functionality. This video showed me how to do just that. Much ❤from Ohio
Happy to hear it helped! Good luck with your weather app!
Awesome video!
Thank you!
Try avoiding React in the first place. Use it at your job, but invest your free time into learning tools that actually dk things right.
Ryan, not wanting to be a naysayer. Doing things in JavaScript doesn't make it more "accessible" mate. It just makes it easier as when you download ts scripts from the supabase site that don't LINT it is a pain in the arse. But what is more a pain in the arse is when we start a tutorial and we're using typescript and nothing you're showing us works. I would love to see you use ts and sort this craziness out for us. Like I said, really appreciate the effort but to show us JS you might as well be showing the greater NextJS community basic.
How do you consume the path from within a component?
Any reason you’re not opting out of routing by using ‘_components’ (private folder structure) instead of ‘components’ while in the app dir?
Nope, no particular reason. I think explicitly using the private folder structure is a good way to go
If you use 'src/' in your project structure, you can organize it like this: - src/app/ for all app route pages - src/components/ - src/db/ - src/lib/ This creates a cleaner structure. For components, the best practice I've found is to name them based on their function, like 'buttons', 'loading', or 'forms' - rather than naming them after pages (like 'settings' for the settings page). I'm a beginner in programming, and when my codebase gets too big, I find it difficult to locate things without proper organization."
Ryan says he prefers page then components. I say ... why not both? src/components - universal ones src/somepage/components - page specific components
Nice Sir
Thank you
thanks
You’re welcome
Thank you so much bro
You’re welcome!
please can you make a video about reseaults paginations? or add a load more using server side only?
Do we cheer on features that php and alike supported for about 20 years? Reactpeople are crazy.
It's not about PHP or React/Next.js. The default behavior of a form element with an action is to cause a full page reload. In a typical SPA, pages don’t actually reload; they just replace the outlet or content. Next.js tackled the full page reload issue with client-side navigation using their new Form component. It's nothing fancy, really-I used to do it myself before, but Next.js added this with their v15 release
😂
True story 🍸
What about passwords? I don’t want my password to become a URL param for my website
What other use do you see for a password than authentication? You only use passwords to authenticate yourself
it's useful for search purposes, e.g. a home page's search bar that redirects the user for a catalog with the search param