Тёмный

The harsh reality of good software 

ThePrimeTime
Подписаться 469 тыс.
Просмотров 313 тыс.
50% 1

Recorded live on twitch, GET IN
/ theprimeagen
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
Reviewed video: • The Harsh Reality of G...
By: / @awesome-coding
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts

Наука

Опубликовано:

 

15 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 712   
@awesome-coding
@awesome-coding 3 месяца назад
Hey! That's my video! Thank you for the shoutout!
@re.liable
@re.liable 3 месяца назад
I love your videos
@alexandrecosta2567
@alexandrecosta2567 2 месяца назад
are you also behind deno's channel?
@awesome-coding
@awesome-coding 2 месяца назад
@@alexandrecosta2567 Yes - I'm helping produce some of their videos as well.
@futuza
@futuza 2 месяца назад
You have some great takes, awesome-coding.
@awesome-coding
@awesome-coding 2 месяца назад
@@futuza thanks! :)
@unl0ck998
@unl0ck998 3 месяца назад
Do you care how many hours someone slaved to build the desk you are using? No, and if it breaks you hate them. Its not exclusive to code.
@mattwhite9658
@mattwhite9658 3 месяца назад
Yeah but it is more on the scale of if the entire company sat at that one desk daily. And even better the desk isn't broken the people that are sitting at it complain about the chair you didn't design or are sitting on the end of it and saying they can't see the screen well because it is 6 feet away.
@Dom-zy1qy
@Dom-zy1qy 3 месяца назад
I built my desk in like 2 hours 😎
@MrDasfried
@MrDasfried 3 месяца назад
Just build it your self
@t1nytim
@t1nytim 3 месяца назад
​@@MrDasfried that makes a lot of sense. Then when I hate myself, it'll be no different.
@Daniel_Zhu_a6f
@Daniel_Zhu_a6f 3 месяца назад
software is nothing like a desk, you can't clone desks (but it takes less than a day to build one from boards). perfect cloning at near-zero cost is not something you can just wave away. it affects literally everything in the product lifecycle. in a way, it contradicts capitalism, which is built around scarcity of commodities.
@ofadiman
@ofadiman 3 месяца назад
My go to language is TypeScript on a good day and Polish on average.
@yuriy5376
@yuriy5376 3 месяца назад
😂
@ZombieJig
@ZombieJig 3 месяца назад
Ironically Polish is at least 100x harder to learn than TS
@stefanalecu9532
@stefanalecu9532 3 месяца назад
​@@ZombieJigbeing a natural language with lots of exceptions and a huge vocabulary and a lot of ambiguity sure makes you harder than a programming language with defined syntax and 50 keywords at most :p
@luisendymion9080
@luisendymion9080 3 месяца назад
LOL that caught me by surprise, good one 🤣😂
@dannyarcher6370
@dannyarcher6370 3 месяца назад
I need to meet some Poles. It may just be me but the outside impression of you lot is "lovably quirky". This comment only strengthens my impression.
@Cyberfoxxy
@Cyberfoxxy 3 месяца назад
As a junior I read an article about "all code is garbage". At the time I didn't pay it much attention. I went through my programmer puberty with design patterns. Clean malleable code that somehow was future proof. Now. I'm past programmer puberty. Every abstraction I have ever written has fallen short in some way or another. There is no such thing as future proof code. The best code is the one you can quickly delete and rewrite.
@aoeu256
@aoeu256 Месяц назад
Hmm maybe, but I swear there are certain abstractions that can increase your chance of future proofing your code... Pure functions, inversion of dependencies, loose coupling, embedded DSLs, passing through keyword arguments, decorators, maybe even monads O_o.
@taragnor
@taragnor Месяц назад
@@aoeu256 Yeah, I definitely find you can write software in good ways and bad ways and some design patterns are much easier to upgrade. A big key I find is having code that will hopefully create errors at compile time. Things like Rust enums which force exhaustive patterns, typescript "satisfies never" in the default parts of a switch statement and similar tricks have saved me a lot of time. So that way if you ever add in a new type at some point, your compiler tells you you've missed out on handling the specific case for it. And the more your compiler can tell you and detect, the better, because you will make stupid mistakes so setting it up where the machine double checks for you is key.
@ChrisAthanas
@ChrisAthanas 10 дней назад
Read and understand it enough to dump it and rewrite it
@robgrainger5314
@robgrainger5314 3 месяца назад
I doubt very much that the person who wrote the Rollercoaster in Excel thought that they were using the right tool for the job. Its more like doing it because you can, not because you should.
@Dogo.R
@Dogo.R 3 месяца назад
The "job" was "build a rollercoster in excel", not "build a rollercoaster". It was the right tool because the tool was part of the design constraints.
@theguy9067
@theguy9067 3 месяца назад
He never claimed the person thought it was the right tool, he used it simply to prove the point that you can use many tools to do a thing and if you're good with the tool, it would appear it was the right tool for the job but really it was all the developer, not the tool
@JorgetePanete
@JorgetePanete 3 месяца назад
It's*
@MerkieAE
@MerkieAE 3 месяца назад
@@Dogo.Rmaybe the person who made it only knows how to build it in the excel
@TehKarmalizer
@TehKarmalizer 3 месяца назад
@@MerkieAE if the task wasn’t constrained to only use Excel, then Excel is always the wrong tool for that job. It’s a useful exercise, nonetheless.
@luizpbraga
@luizpbraga 3 месяца назад
the manager is also the HR of my company. I can't complain about him to him. :(
@microcolonel
@microcolonel 3 месяца назад
Somehow way worse than not having HR at all.
@conorx3
@conorx3 3 месяца назад
HR works for the company not for the employees
@brunopena3710
@brunopena3710 3 месяца назад
You can do it, but only once
@microcolonel
@microcolonel 3 месяца назад
@@conorx3 sometimes your incentives are aligned, which is when it works out.
@truehighs7845
@truehighs7845 3 месяца назад
Bit like the Police...
@SuperPranx
@SuperPranx 3 месяца назад
Just because a famous framework has non-readable code, doesn’t mean readable code is bad. On a big, long term project where new people will keep coming in, it’s far more important to make code easily readable. If each function states clearly what it’s doing, reading code is similar to reading a story about what that code is doing.
@judedavis92
@judedavis92 3 месяца назад
Hot take: software is hard and complex. Your job is to make it simple and build on the simplicity.
@yuriy5376
@yuriy5376 3 месяца назад
Is that even possible? How can you build simple software for complex business requirements?
@Kwazzaaap
@Kwazzaaap 3 месяца назад
People say this and then pack a bunch of complex logic behind some weird type or function and suddenly you have no control and are locked in some pattern that cannot possibly be best for all the cases its marketed for
@MrSanchezHD
@MrSanchezHD 3 месяца назад
@@yuriy5376 By using the right complexity management technique for the job. Something learnt through experience & research.
@judedavis92
@judedavis92 3 месяца назад
@@yuriy5376 make it as simple as possible. As the software requirements become more complex, then build on these simple constructs into more manageable solutions. That’s how software must be designed. That’s where I think things like DDD _could_ be useful.
@thewiirocks
@thewiirocks 3 месяца назад
Our job is not just to make it simple. Our job is to take incredibly hard problems and make them look effortless. “Effortless” software is so slick and easy to use that it seems from the user’s perspective that it must have been easy to make. …which sadly then leads to bad management killing off top performing teams because they just spent the last year “rescuing” a shitty team and believe that their “newly improved” team can clearly do such a simple thing better than the pathetic team that’s currently managing it. 🤦‍♂️
@baldpolnareff7224
@baldpolnareff7224 3 месяца назад
What my previous team did is exactly the reason why they're now in a very bad position, they settled for "good enough, it works" and now they have a huge but fragile infrastructure they can't maintain nor change without a massive refactor
@BobBeatski71
@BobBeatski71 3 месяца назад
I'm a HW guy. Have taken on a Java project that ultimately ends up as a piece of hardware from the code output. To learn Java, I bought Java beginners by Oracle two years ago. Yesterday was the first ever JUnit for the project in its 8yr life! I've had to do this because each new HW product starts as a new J package, with existing code copied / pasted / tweaked by overrides. It's an enormous intertwined f'in mess that now does not work unless one knows all the gotchas. When I mentioned this to one of the original coders, his reply was "it was good enough to get the job done". That guy has a PHD and insists on being called Dr. I call him Mr to bring him down to earth.
@baldpolnareff7224
@baldpolnareff7224 3 месяца назад
@@BobBeatski71 I worked at a hardware company myself, manufacturing always takes priority over code, and requirements are never clear, it's just not a good experience. Hell, the IT infrastructure sucks in these companies in general, you can't always develop software under normal conditions. So I see why people settle down in a sense, these companies never prioritize good software. But nonetheless, it should be a priority
@hamm8934
@hamm8934 3 месяца назад
Exactly this. Whenever people say “just get it working”, all i hear are people playing not to lose, instead of playing to win. “By the time you need to refactor the code, youve already won because your product took off.” Yeah, until it dies a month later, ie the current state of the gaming industry and nearly every website. The fact of the matter is: you need to “just get it working”, in the present sense, and the future sense. Otherwise, youre not playing to win.
@ame7165
@ame7165 3 месяца назад
my last company did this. "let's use stored procedures because they're easy". literally thousands of stored procs later, upper management says let's move away from oracle due to cost. cool, who wants to rewrite thousands of procedures from oracle flavor to another? nobody? not to mention the troubleshooting hell when you're using debugger and then reach a stored procedure call. everyone dances with joy at this point yes? no? 😂
@airman122469
@airman122469 3 месяца назад
This is the state of the software I work on. I tried multiple times to get them to halt and rethink, but nope. They just pressed on, running on that feature treadmill. And now it’s all unmaintainable garbage that I honestly can’t stand to look at.
@zeuglcockatrice4633
@zeuglcockatrice4633 3 месяца назад
what I understand from these kind of videos is that being a good software developer it's about getting used to being a failure, which is something I excel at
@nuclearmedicineman6270
@nuclearmedicineman6270 3 месяца назад
You're like 99% there.
@JorgetePanete
@JorgetePanete 3 месяца назад
is*
@rocketpig1914
@rocketpig1914 3 месяца назад
It's a lie. Software isn't easy. Life isn't easy. But you can do them well.
@AntonioDoesMetal
@AntonioDoesMetal 3 месяца назад
The only time you're a "failure" is when you give up, everything else is just part of the process
@eggsys7990
@eggsys7990 3 месяца назад
"getting used to being a failure" Add: learn from it to overcome then you will found your self better software engineer @@SimonWoodburyForget
@logantcooper6
@logantcooper6 3 месяца назад
I do think in the world of enterprise LOB applications that readbility is almost more important than anything. When the technical complexity is low but the domain complexity is high, code readability is important since the code is your source of truth for how a business process ACTUALLY works.
@michaelkolich1089
@michaelkolich1089 3 месяца назад
What's lost in Prime's take is that he is hyper-focused on 1 long function. When you talk readability, you are talking about the entire repository, a feature, a module, a function in that order in terms of importance. You can look at a long function and say "look how unreadable that is, it's so long!" as a kind of gotchya for people who say that readability doesn't exist. What is missing is the context of that long function. He skimmed right past a small function that leverages a long function and guess what, it's crystal clear what that small function does because of the lifting done by that large function.
@Slashx92
@Slashx92 3 месяца назад
Real. I work on automations for business processes and the function is how money literally moves between subsidiaries, for example. And coming from the web to this job 4 years ago made me really appreciate simplicity. When implementing a single process without the need for too much reutilizarían or branching, I just write a single big function that does the thing, with maybe a couple of properly named utils functions. Having to jump through 4/5 functions with vague names between files is a nightmare when 2 years later the client wants to add a new use case. Nobody remembers what the thing actually does. Not even good documentation helps sometimes to understand code from “clean coders” (not derogatory lol)
@AntonioDoesMetal
@AntonioDoesMetal 3 месяца назад
This this and this. There’s a reason we haven’t migrated off of mainframes with 30+ year old code that still hold up the stock market, flight systems, and other industries. Rewriting/rebuilding would mean you would have to trust you’re not breaking 30+ years of business logic that nobody really understands
@michaelvelik8779
@michaelvelik8779 2 месяца назад
Comments that explain why something is being done. Those are a godsend a year later when you need to make a change.
@locobob
@locobob 2 месяца назад
I’ve been an engineer, product manager, solutions consultant and sales manager. As soon as I stepped out of the engineering bubble I immediately got the “good enough” mindset. Once you realize that perfect code doesn’t pay the bills, and that code is only a means to an end, you get it.
@PhilDietz
@PhilDietz 20 дней назад
My company had software running for 25 years with no SME or incident. All it did was rack in money. Also keep in mind, your crummy software that breaks is going to get you on the shitlist for Operations. There will be a point where they will start calling you at 3am for every occurrence until you fix it.
@michealkinney6205
@michealkinney6205 3 месяца назад
Lol, you really hit that nail on the head @24:15. I came into where I work and the repo was 10gb+ in size because devs before me were keeping data with the code.. I rebuilt everything from the ground up over years.. took care of the code base and developed a proper pipeline.. the repo is now
@paper_cut9457
@paper_cut9457 3 месяца назад
there's shitty code and then there's the data analyst code. that's one of the most amazing mess
@Ryan-qu4vx
@Ryan-qu4vx 3 месяца назад
Very hurtful, 100% true but still hurtful.
@paper_cut9457
@paper_cut9457 2 месяца назад
did not mean to hurt anyone. apologies. I'm an analyst myself and I'm just amazed at how things keep working in offices like mine.
@WhiteThunder121
@WhiteThunder121 2 месяца назад
Instructions unclear. Put all my production code in a Jupýter Notebook.
@Ryan-qu4vx
@Ryan-qu4vx 2 месяца назад
@@paper_cut9457 Obviously no offence taken. I'm an analyst as well and I've seen the disaster code firsthand. I like to call it Buca di Beppo code because that spaghetti code is family style.
@haroldcruz8550
@haroldcruz8550 2 месяца назад
damn
@Tony-dp1rl
@Tony-dp1rl 3 месяца назад
The best written code is the code that is easy to replace ... almost every good pattern or practice stems from that.
@md2perpe
@md2perpe 3 месяца назад
My goto languages are BASIC and C/C++. There are not many other languages having GOTO nowadays.
@Octogenico
@Octogenico 21 день назад
Lua :)
@infeltk
@infeltk 10 дней назад
SQL
@tole3590
@tole3590 9 дней назад
Bruh 😂
@ChrisBensler
@ChrisBensler 3 месяца назад
I agree that experience in many ways makes software dev more difficult. I was at peak productivity/effectiveness when I was still naïve of all the best practices. It is commonly understood that 'cowboy' coding is a bad thing but in over 30 years of doing software dev and programming, it is usually the optimal strategy. Fancy tools, methodologies and paradigms are massive technical debt. Good devs know how to KISS. The vast majority of the time, good code does not mean making bulletproof code, it means making it as simple as possible without painting yourself into a corner.
@someguyO2W
@someguyO2W 3 месяца назад
I've been thinking about this recently quite a lot.
@TehKarmalizer
@TehKarmalizer 3 месяца назад
It’s all going to be technical debt anyway.
@retryhikaru184
@retryhikaru184 3 месяца назад
its a good approach to anything in general. You just learn over time, that people just don't give a sh*t and everybody has agenda, so why bother go extra miles anyway. Just survive and do the minimum and you're good.
@chauchau0825
@chauchau0825 3 месяца назад
Sinplicity is key but never easy. Saddest part is that not-so-good devs write complicated code thinking what they did is "simple" or "clean"
@Rick104547
@Rick104547 3 месяца назад
What I find hard is getting the rest of the devs on board though. So many devs practice dogmatic clean architecture for instance thinking it's the way. Takes alot of time and energy to change that around.
@Tidbit0123
@Tidbit0123 2 месяца назад
I love what youre speaking about in the beginning, I am currently developing a feature at work and everything is new, I am a graduate dev trying to implement a masstransit feature and its honestly fun tbh, but productivity is slow because I am a) googling everything, b) trying to write good unit tests c) message queues are hard to debug haha. But tbh I think I am nearing the end and its awesome, feel like I have personally learned a lot, but I feel slow, too.
@macctosh
@macctosh 3 месяца назад
I have a simple rule. code complexity should match the bussines requirement complexity. I naively started a side project that I thought was simple three years later no matter how much I refactored my code it's just complex. I learned from this that there is no such thing as a simple "real world" software. if you software is simple it has "no value" and no different from the many software projects I completed as a cs student.
@thewiirocks
@thewiirocks 3 месяца назад
If you haven’t read The Mythical Man Month, you might enjoy it. Brooks spent a good chunk of the book talking about inherent complexity (the complexity needed by the problem) versus accidental complexity (the complexity caused by the methods used to solve the problem).
@genechristiansomoza4931
@genechristiansomoza4931 3 месяца назад
Try creating accounting software. It's a simple +- right 🤔
@Shogoeu
@Shogoeu 3 месяца назад
Am I the only one that rediscovers my own code every 3 months and after I read how it works, I'm amazed how flexible and maintainable it is?
@kakwa
@kakwa 3 месяца назад
Well, the 3 months figure is worrying. Personally, I always throw-up seeing the code I've written in the past. But in most cases, I only have to rediscover it every 2 to 3 years generally.
@justinlynch6691
@justinlynch6691 Месяц назад
Why worrying? If you're not touching your code for 2-3 years are you iterating?
@anyonei1806
@anyonei1806 11 дней назад
Yes, sometimes it's a pleasant surprise. I find that mapping coding abstraction to business abstraction increases the likelihood of this happening as the business requirement changes in ways that the code base already anticipated.
@tc2241
@tc2241 3 месяца назад
Completely disagree with his take one clean code. I’m not referring to Uncle Bob either. Clean, readable code is a thing and should be something that’s desirable. There are few instances imo where ugly illegible code is acceptable due to quirks and performance. Rarely are devs programming at such a level. Widely used libraries or not. Ugly code in most instances is lazy code.
@gyurkesm
@gyurkesm Месяц назад
Please try to understand what he said! Readable code is desirable and you should try to write the best you can, but you should not use the phrase 'clean code' for that. Even if you don't mean it, people will think of Uncle Bob's clean code. Imo, even if somebody likes Uncle Bob's clean code style, it is not an universal 'you should write like this' clean code
@akovaski
@akovaski 3 месяца назад
19:10 This is something I believe is a good way to fight bad abstraction. For me, I've been phrasing it as "The correctness of the code should be locally obvious." This is something I started thinking about when I had to dig down many branching levels to see what a function did, then I had to do a scan of the project to see how an object was initialized, so that I can know which class to further dig down to see what function was actually being called on the object, which again required tracking down the various ways object's members were set. There are 2 paths that I know of to fulfilling this guideline: make the code local or make the abstractions robust. Good libraries are an example of robust abstractions, where you can reason about your program without having to read the library's source code. Though even if your abstraction is robust, someone who reads the code will probably need to learn your abstraction to verify correctness, so making the code local is generally a strong choice. (Re-listening to the clip, "you don't have to learn new abstractions" is mentioned, so I like double agree with this guy.)
@rothn2
@rothn2 3 месяца назад
Preemptively adding abstraction is usually a bad idea. Add it when you need it!
@DarrenJohn10X
@DarrenJohn10X 3 месяца назад
Classes are abstraction. Java forces classes on you even just for Hello World. No wonder so many hate Java.
@dannyarcher6370
@dannyarcher6370 3 месяца назад
@@DarrenJohn10XDon't blame OOP for Java's failures. C# is amazing.
@0x0404
@0x0404 2 месяца назад
Good to see different takes that still align overall. From somewhere else I'd taken "Write code that someone else can understand 6 months from now". That someone usually being yourself.
@kennethhughmusic
@kennethhughmusic 2 месяца назад
25 years in the industry and the main thing that goes through my mind when writing software is "will someone else be able to maintain this without wanting to end their career as a software developer". If you write code that no one else can maintain, expect to maintain that code for a long time :) I agree with the "readability" points though, in fact, I agree with the majority of what you said around the state of code and I have added to the mess LOL I also maintain that the more generic something becomes, the less useful it is. Some real gems in here
@BrentMalice
@BrentMalice 3 месяца назад
the no googlin thing is so tru. i switched to linux cuz of prime and broke my pc 4 times with internet, 5th time i didnt. not being able to Bing Copilot and copypaste made everything fun i miss windows
@mykytapolchanov6490
@mykytapolchanov6490 3 месяца назад
It is impossible to break NixOS tho.
@theodorealenas3171
@theodorealenas3171 3 месяца назад
I still remember when Windows was my caretaker whenever I would bork Linux and feel bad
@pluto8404
@pluto8404 3 месяца назад
I dont miss windows ads. Basically puts you center in time square while you just want to look at some funny cat jifs.
@BrentMalice
@BrentMalice 3 месяца назад
im deff not missing it. so far every game i wanted to work, works (league/dota/battlebit/wowclassic) and vscode and even GIMP open just... instantly. idk how this is even possible. this whole symlink thing is pretty daggon neat too. and search is instant, cloudflare warp just works... second time ive tried linux and first time able to stick with it, all thanks to bing copilot being so good at answering everything. only thing i hate so far is the default nautilus skin but i havent tried changing yet.
@theairaccumulator7144
@theairaccumulator7144 3 месяца назад
​@@pluto8404you can easily disable all the bloat ware except the MS store
@chrisstadler7111
@chrisstadler7111 3 месяца назад
I couldn’t agree more with your assessment of how to stay happy with your development journey
@lelilimon
@lelilimon 3 месяца назад
15:38 I like how he sits so still while being almost swallowed
@mroliveoil
@mroliveoil 3 месяца назад
xD
@vladislavkaras491
@vladislavkaras491 3 месяца назад
Thanks for all the commentaries!
@johntoniolo46
@johntoniolo46 3 месяца назад
Back in my algorithms class in college I learned about overdoing the concept of very small functions / large abstraction chains in an unexpected way, and the lesson keeps revealing itself in new ways. Mergesort... You simply break the array into two parts, merge sort each of them, then merge them together. This is great when the array is 1000000 elements, and 500000, and 250000, and so on. It's not so good when the array length is 16 due to the overhead of the recursive calls and that dividing something by two gets you fewer and fewer shaved off elements each time. Indeed, once you get below a magic threshold of about 16 or 32, it becomes more efficient to simply insertion sort instead of continuing to subdivide... To "just do the thing" instead of offloading it to more and more subdivisions. Though this is performance vs code style, I think it provides some intuition that some abstraction is good and necessary... Merge sort is more efficient than insertion sort. But you can overdo it. A 1000 line function is probably bad, but a 100 line function might be as small as it makes sense to be. Breaking it up further would just waste not only the developers time, but the readers time jumping from useless function to useless function. I think this goes for many concepts not only in computer science but in life. TLDR; Diminishing returns, use common sense over dogma.
@OurSpaceshipEarth
@OurSpaceshipEarth 3 месяца назад
250,000 or 32 just use the same logic. thre's no way 32 will take more time then something with ~7,500x elements/iterations
@tole3590
@tole3590 9 дней назад
Bro cooked but no one was hungry
@mateusleon
@mateusleon День назад
24:35 living right now, and is so true. When I started 16 years ago, I was taught that the most important duty in programming was keeping a good eye on the code you needed to maintain, consistent tabbing, etc, and nobody on my career was careful enough to keep the codebase nice and clean.
@alexanderkozhevnikov9087
@alexanderkozhevnikov9087 Месяц назад
I am a huge proponent of what you called "eyeshot development" here. I've been using the word "locality" for the idea, but "within eyeshot" is really nice in how plain and not-abstract it is. Opposite of "spooky action at a distance". If I change code waaaayyy over there somewhere, and it breaks this code over here, that's a non-local change/effect. If some function in that other source file mutates this data that's being used by code I'm looking at here, ditto. Low/poor locality of stuff that's related and coupled. Ideally we'd make proximity/locality correlate to relevance/coupling. If I need to read/see both anyway, maximize locality, get them close to each other. It's obviously not supposed to be an "infinitely strong" rule - it doesn't always outweigh everything else. All best practices are weights that pull one way or another, better code is better balance of those pulls. And locality/eyeshot is definitely one of the pulls. Our life is better when all *relevant* information is as close by as possible. Same file, same screen. Do we need to know *that* code to understand/verify/change *this* code? Then it should be nearby.
@petersmythe6462
@petersmythe6462 3 месяца назад
"the person who works on it can continue to work on it." What if a different person has to start working on it? What if they quit? What if the project needs more developers to scale it up? What if they demand double the salary and a stake in the company for half the hours or they'll leave? What if they take months off for maternity leave? Is it gonna be a black box until they come back? When they do, are they even going to remember how their own code works? Part of the problem with bad code is that when anyone else needs to work on it, it becomes an intractable problem. This isn't to say you need to turn everything into maximally encapsulated OO, or 10-line highly nested do nothing manager functions, or increasingly nonsensical inheritance trees, or for that matter stateless functional code. What it does mean though is that someone else should be able to read your code and be able to figure out how to change it without understanding how every line of the codebase is coupled to every other.
@benjikrafter
@benjikrafter 2 месяца назад
I'm so glad my manager owns the tiny company he does. I never have to worry about being told what to do by 10 steps up the corporate ladder. And it's such a small team that my voice is important. I'm able to code my best, be comfortable, and have positive motivation. The reality of most people's software engineering jobs is terrifying to me. And hopefully I never have to understand that experience myself.
@AK-vx4dy
@AK-vx4dy 3 месяца назад
Maybe aversion to small functions and hopping is line between VIM and IDE? Becuase most of IDEs greatly improve this hoping experience. Also meaningful names limit necessary hopping too. Anway i saw once owner of the firm who have and trains x20 programmers and he opted even for two line functions but he also admitted that they select specific type of people to his teams
@trietang2304
@trietang2304 3 месяца назад
I generally break into function when I think a block of code is so complex that I may forget what it does in the future.
@Kane0123
@Kane0123 3 месяца назад
So long as the .exe is named well, I’m happy.
@Ultraporing
@Ultraporing 2 месяца назад
Thanks Prime for your incessant hammering on not abstracting. I'm currently writing new docker containers and systems for our cloud at work and started to abstract. Then remembered your yelling about it. I killed the whole project and restarted from scratch, no abstraction, just simple neat sequential code. And am thankful I did :). You are right, experienced programmers really got an abstraction problem (me included, been writing code around 15 years now). Good fortunes to you good sir o7
@simpeers
@simpeers 2 месяца назад
Small Focused Functions is bliss. But I might be biased as I prefer functional programming, and thus it makes perfect sense. But then what the point of that is that the functions does one think, and it should be quite obvious what when you just read its name.
@Ekitchi0
@Ekitchi0 3 месяца назад
Small functions make the individual functions easier to understand but you kick the can down the road because it can easily make the larger function using all the small ones harder to understand. I think the priority is if a functionality can or needs to be reused many times, then it should be its own function. If you split your large function into smaller ones that are only used within that one function then it was useless to split it from the start.
@ben_clifford
@ben_clifford 2 месяца назад
19:10 I agree with your friend, and I've been saying this for years. We've known for years that readability matters. If functions are too short, readability suffers. But when a logical block takes 2 page scrolls, that's also unreadable. Trade-offs, people.
@brentlio5578
@brentlio5578 2 месяца назад
Atomic pieces: Regex to scan important instructions/data from robot code. Small features: Robot motion point joint knuckle flipper, code formatting, comment injection, various data extractor from running robot programs, setup validation tool, etc. Everything together: General robot commissioning tool.
@AnatolKukula
@AnatolKukula 2 месяца назад
At 16:20 tiny pieces are brilliant. Like Lego pieces vs puzzle pieces. Puzzle piece can fit only in one place, Lego pieces can be rearranged and reused. If I am not mistaken that's a part of Composition over inheritance
@digitalspecter
@digitalspecter 3 месяца назад
I've been a dev for 30 years, it's one of my hobbies as well. I've been trying to get better every day but I still feel average. Why? Because of the complexity of multiple conflicting goals. I very, very rarely get to feel like "this is the best solution" because everything is a compromise. I think there are better and worse compromises but most of the time what I feel is a slight disappointment. Also, it doesn't help that every OS, every programming language and every API is also a bunch of more of less annoying compromises. I wish computer science was more of a science but also that the industry cared a bit more about what the studies indicate. One corner of the industry is busy reinventing the broken javascript wheel every couple of weeks and the other corner is bolting more crap on Java.. but we're not ready for any kind of paradigm shift because most people don't want to learn new things and like Prime said the "best tool for the job" is just the language&framework one is the most comfortable with.
@tomtech1537
@tomtech1537 2 месяца назад
I think coding in industry is far more of an art than a science, which is why no one can say what is 'good'
@terribletheo8401
@terribletheo8401 3 месяца назад
Congrats on 600 videos
@_skyyskater
@_skyyskater Месяц назад
Even the best programmers will occasionally write some pretty hard-to-read code. There is often a sliding scale/trade off between efficiency and code readability. Also other constraints may come into play. I do believe most code can probably be improved by an order of magnitude in terms of readability, but this is due to a lack of training and industry standardization in this area.
@mateusleon
@mateusleon День назад
12:17 the look that he makes, staring at everybodys eyes, is really absourd.
@nijolas.wilson
@nijolas.wilson 3 месяца назад
I could talk forever on this topic, but the short version is I firmly believe the only candidate for an objective measure of "good" code beyond it simply working is properly tested code.
@Heater-v1.0.0
@Heater-v1.0.0 3 месяца назад
I don't understand your logic there. I mean one has no idea if ones software actually works unless one has tested it, at least to some degree. The degree to which one tests it shows how much you care are about it actually working. Unless you are happy to let your users test your creations.
@someguyO2W
@someguyO2W 3 месяца назад
What's your objective measure of "properly" tested code?
@theodorealenas3171
@theodorealenas3171 3 месяца назад
100%. My teammates hate me when I say this but I only trust bits of code that executed recently.
@heap_or_stack
@heap_or_stack 2 месяца назад
This content changed my vision of programming for sure !
@takeiteasyeh
@takeiteasyeh 3 месяца назад
really summing it up from 2:00 to 4:15. every new project has to have something I havn't done before
@vargonian
@vargonian 3 месяца назад
I am a fan of the smaller functions, and then creating new classes if you have a giant class with a bunch of little functions. It makes it so much easier to change/fix an issue in just one place. I am not a fan of the term “self-documenting code” for the same reason that Prime isn’t a fan of the term “clean code”. This is also why I don’t dislike comments as much as other people; they help me more often than they confuse me.
@porky1118
@porky1118 3 месяца назад
4:15 Whenever I learn a new language or tool inside a language (like ECS or a game engine), I usually try to replicate something I've done many times before, like reprogramming ball physics and connections like in World of Goo, or trying to implement compile time dimension generic geometric algebra.
@ritwikyadav9749
@ritwikyadav9749 3 месяца назад
At the end of the day just enjoy what you are doing. If you can find a way to not look at a problem as inconvenient but as an oppurtunity to learn and get better your life will significantly be better despite not actually being better in any objective way. It will be the same thing but you will get much more joy from doing it just because you believe it to be fun/interesting learning project.
@newjdm
@newjdm 3 месяца назад
19:50 Fair point. For most PR’s I have to use IntelliJ’s review feature and hop around in the code to really understand the logic
@ferinzz
@ferinzz 3 месяца назад
Never forget : Support wants to know where they can poke to know why things aren't working right. Meaningful errors, tools to fix things without dev involvement, understanding what aspect relies on what system at a high level. How can we show where something isn't working so you can go straight to the issue.
@jaceklanger7735
@jaceklanger7735 2 дня назад
The idea behind small functions sis not to extract every block into its own functions but to identify varient and invariant behaviours and creae more generic behaviors, so that you end up with less. There is no hard limit on how many lines a function should have, but there is a good chance that you can write more generic code when it exceeds a certain length, as the generalization often stems from actually following the DRY principle rather than clean. That being said a generic function can be hard to read at times.
@mrmaniac9905
@mrmaniac9905 3 месяца назад
The harsh reality of that rollercoaster enjoyment curve is actually extremely depressing
@alxk3995
@alxk3995 3 месяца назад
It's more or less the state of flow people can enter. The task needs to be interesting but not to hard or you get frustrated. Also not to easy or you get bored. Applies to almost any activity.
@cds5506
@cds5506 3 месяца назад
I mostly build for the web so I use TypeScript and Go for the most part and it lets me solve most web-related problems.
@FlanPoirot
@FlanPoirot 3 месяца назад
the web is boring, how many times are you just gonna do CRUD before you get bored? it's ok if that's your job, but there's much more to programming then just storing and presenting data on a web page (which is hands down one of the most needlessly overengineered areas of IT if not tech as a whole
@anoh2689
@anoh2689 3 месяца назад
​@@FlanPoirotI am curious. what are the other programming domains that are better than the web in your opinion?
@dputra
@dputra 3 месяца назад
​@@FlanPoirotnot all web is equal
@FlanPoirot
@FlanPoirot 3 месяца назад
@@anoh2689 not "better" as making websites is obviously useful, without the web access to information would still be limited and there's great value in it. but limiting urself to just web development to me seems like deciding to be a carpenter that exclusively only makes chairs and refuses to make anything else, it doesn't make sense. I'd say just explore what programming has to offer, do ur job as a backend/frontend/whatever u need to do to get paid, but it never hurts to do more. as for other areas u might explore: low level programming, emulation, CLI, encryption, graphics, databases, ML, GUI, embedded, compilers, simulation, data science, etc. I mean, the great thing about programming is how versatile it is, u can provide (real) value by doing a lot of things with it and adjacent knowledge in other things that might also interest u
@DingleFlop
@DingleFlop 2 месяца назад
The NP + NL situation, to me, is actually what ChatGPT is PERFECT for. It allows you to explore a new problem, and relate that problem to a language to already know. ChatGPT is not good for 90% of the things people think it is, but as an interactive learning tool, it does GREAT! It can't teach you fundamentals, but it helps you more broadly apply the fundamentals you already know.
@DingleFlop
@DingleFlop 2 месяца назад
Someone in chat said "Clean code is opinionated" I'd say "Opinionated code is good code" PARTICULARLY because it's "led" by a person, rather than an amorphous blob of principles, patterns and expectations that aren't very cohesive.
@lucastperez
@lucastperez 3 месяца назад
I remember finding your channel a few years ago when I started learning vim and wanted to write my own vimrc and also to get better at it. At some point I just stopped watching your videos. I don't really have a reason for that, I just think that I wasn't interest in rust or other things you were doing, or the memes, don't really know. But I really like these videos like this one. It is a talk about software, it makes sense independently of the language you use the most, it is just honest takes on development process. I love it. Contratulations on the content 👏
@alexanderkozhevnikov9087
@alexanderkozhevnikov9087 Месяц назад
About "readable" - the problem is that readability has subjective and objective components, and many of the objective components are relativistic rather than absolute. So yes, there are objective readability factors: human vision has mechanical and computational constraints which can be studied, understood, and optimized for (this is why newspapers and textbooks use thin columns - it optimizes for less eye saccades, and this is one of the reasons why line width in code is partly an objective readability matter). Of course, there can be physical and mental variations between people that make us more sensitive to these objective factors, so it's partly absolute and partly relativistic. There's also stuff that seems "subjective" only because it's heavily relativistic. For example, whether you find camelCase more readable than snake_case is heavily influenced by what you're used to looking at, so that can feel like purely a matter of taste when part of it is *habitualization* - and we can measure this in our own lives if we ever spend enough time away from one style of naming, and then see how we feel when we come back to it. (For example, I used to think camelCase was equally readable to snake_case, but then I noticed that even though I was instantly comfortable reading snake_case after years of programming professionally in camelCase, after a mere two-three months doing snake_case full-time I found camelCase harder to read.)
@paulholsters7932
@paulholsters7932 3 месяца назад
I love writing code and creating a product. I don't care if it's bad or good. That are worries for later. I refactor as I go. But I guess it's different when you work in a team.
@desmozGenes
@desmozGenes Месяц назад
Nice video. What's this drawing tool you use? Is this some new version of Photoshop? :D I have no idea.
@imerence6290
@imerence6290 3 месяца назад
One of my favourite features of Google's Gemini is summerizing his long ass videos.
@tubebrocoli
@tubebrocoli 2 месяца назад
The thing about abstraction, is that to get the "right" one, it needs to be canonical, and there's no easy way to know what that is, and the language you're working in may not even support it natively. (and if it's not supported natively, it won't be canonical). The only way to get to those is with tons of experience with the specific problem, or with maths, and most programmers can't tackle the same problem enough times, and most programmers also really struggle with pure maths thinking.
@carljacobs1287
@carljacobs1287 2 месяца назад
My first boss (30 years ago), said that for ever 1000 lines of code there's a bug, and for every bug you fix you create another. 30 years later, I still agree!!
@lpfan678
@lpfan678 10 дней назад
Your videos are therapy for me.
@carlinhos10002
@carlinhos10002 3 месяца назад
19:23 THIS! THIS! THIS! A million times. LET'S GO!
@sucellos8621
@sucellos8621 3 месяца назад
23:22 There is no man happier than Primeagen getting affirmation during a react video.
@scotmcpherson
@scotmcpherson 3 месяца назад
I write what I like to call "clean enough code". I keep my classes seperate, and generally try to write methods that do one conceptually generalized thing, and I try to keep the code organized enough that you can read the flow, but that's not always possible.
@Kane0123
@Kane0123 3 месяца назад
People should say “good code”. I write code I think is good. I try.
@Sancarn
@Sancarn 3 месяца назад
RE: The excel roller coaster, it should be noted that a lot of people don't have a choice but to stop there.
@TheJacrespo
@TheJacrespo 3 месяца назад
We need to escape from our code fetishism and see things from the other side of the business to realize that if you don't know the in-depth and minute nuances of the domain you are trying to model with your software, your software will result in accumulating overengineered, convoluted designs and features that don't bring any value, advantage, or profitable innovation. That is what the people who are paying/investing need. So, we have to be good at two things: coding as a means but attached to business-relevant goals. DON'T CONFUSE business goals with features. This is the fatal error that most of us in hardware and software engineering have committed in the past.
@brinckau
@brinckau 3 месяца назад
We rather need to escape from our commodity fetishism. - Do you like coding? - Oh yes, so many business opportunities. - What do you mean? - I created my company last year. - Ok, but what about coding? What type of software do you make? - I make software with tremendous profitability. I'm sure my company will double its revenue this year. - What's your favorite language? - $$$$$$$$$$$$$$$$$$$$$$$$$$$$ - Do you have some advice for a beginner developer like me? - Yes, you really need to see things from the other side of the business. Think marketing, human resources, market research, balance sheet, assets, merchandise, shareholder, industry, sales, innovation, efficiency, productivity, business model, management, cash flow, market segmentation, customer loyalty, distribution, logistics, expansion, competition, branding. - ???
@pavelperina7629
@pavelperina7629 Месяц назад
I believe in a clean code - as long as project is completely isolated low level code without dependencies or small application. Let's say up to 20 files and higher tens of kilobytes. Once it has like 3 layers of abstrations (and it's hard to even find all methods that class actually has), many classes that are glueing together simpler classes add logic of their interaction, interractions with gui, error reporting, it get's complicated. And then add serialization and undo stack.
@daxeckenberg
@daxeckenberg 2 месяца назад
4:46 How about working on the logistics of a product ( SRE before SRE: plumbing, instrumentation, tooling, etc) only to have the product launch cancelled two weeks before public beta. Even better, ( which most people can't believe ) agreeing 100% with management that although the product would be successful, it would distract from a sudden and rapid change in the competitive landscape. "Hey Ted, just an FYI and you didn't hear this from me.... Jeff Co. are signing revenue share agreements with the big 6 for variois thin round pieces of plastic. " Option A: spend marketing $$$ launching a UK service ( first intl expansion ) as planned for the past 18 months. Option B: Cancel above project and pour $$$ into price cuts, domestic improvements to keep Jeff Co. from entering into an easily profitable enterprise given their existing large primo user base. Obtion A would have been validating for all the blood sweat and tears... but selfish upon reflection. Option B helped keep Jeff Co. at bay.
@karljoyeux8845
@karljoyeux8845 Месяц назад
Excel roller coster blew my mind 🤯
@jelanijackson3247
@jelanijackson3247 2 месяца назад
Great POV on developer happiness/enjoyment
@susiebaka3388
@susiebaka3388 3 месяца назад
19:40 considering you use Golang now and you can so easily import packages from remote sources, do you think your opinion will change on this?
@earx23
@earx23 3 месяца назад
All problems can be solved by adding another layer of abstraction, except for having too many layers of abstraction.
@tc2241
@tc2241 3 месяца назад
I try to only abstract when it comes to external dsls. I would for external libraries, but I find it works better to just limit its use to a specific internal library and just rewrite it rather than abstract it. It’s not as fast as abstraction but better than having to refactor my code in all million different services.
@user-qr4jf4tv2x
@user-qr4jf4tv2x 3 месяца назад
"How do you laugh in bilions" - ThePrimeTime
@ea_naseer
@ea_naseer 3 месяца назад
write PHP
@personalaccount1515
@personalaccount1515 3 месяца назад
Gosh! Dude are you on fire in this video. Wonderful! Clap, clap, clap
@nilfux
@nilfux 3 месяца назад
This is a great example of the Dunning-Kruger Effect.
@Dazza_Doo
@Dazza_Doo 3 месяца назад
21:32 Nice Job Flick, you need a pay raise.
@lorathas
@lorathas 9 дней назад
I agree with your friend. I've wasted too much of my professional career going through 20 something functions deep on code that should have been at most three levels of abstractions away. Way too many developers think about principles for the sake of principles, and don't think about things practically.
@hosseines276
@hosseines276 3 месяца назад
25:56 "you don't want to end here" -- mean while building td in Vim XD
@donaldjohnson-ow3kq
@donaldjohnson-ow3kq 10 дней назад
The real coding wizards with 40+ years of experience have done the following.....looked at a breaking piece of code at 2am and asked "who the heck wrote this junk??" and then they saw their own name as the author at the top and remembered everything.
@raph151515
@raph151515 3 месяца назад
if you don't feel doubts while writing, it's probably going to be bad. Whatever your current level, you should be aiming at least slightly higher. It's not about how many design pattern you can cram into your code but the overall coding efficiency, code simplicity and performance. It's about looking for new angles. Let's take the example of the APIs of the modules (JS) you can refactor them for an eternity and still find better ways. How to be concise, performant, readable, how quick people will use what you created and how good the result will be for them.
@colinmaharaj
@colinmaharaj 3 месяца назад
Yeah I'm good at tcp programming and use the Indy framework in C++ Builder
@stefanalecu9532
@stefanalecu9532 3 месяца назад
I'm using Indy framework but in Delphi, hello :p
@carljacobs1287
@carljacobs1287 2 месяца назад
After using Delphi for 20+ years, I still enjoy it. I don't care if it's outdated, it works for me.
@gammalgris2497
@gammalgris2497 3 месяца назад
What is the best tool for a given problem Vs the tool people are most familiar with. Never thought about that before as the tools were often chosen (directly or as implication of an earlier decision) by someone that didn't have to work with them. Now I'm familiar with several tools and am wondering.
@DielsonSales
@DielsonSales 12 дней назад
This “optimize code to read on stash” seems to be how the Linux Kernel developers operate. One reason Linus was against C++ was the fact that it comes with a lot of baggage and you need a lot of context to understand a little piece of code that usually isn’t there in the diff. It really makes you think about such trade offs.
@Sina-xw4xp
@Sina-xw4xp 3 месяца назад
Well structured, documented and properly tested code is pretty much possible and totally justifies the effort put into it, no for prototyping of course. Encapsulation is necessary for handling complex programs and teamwork. And yes refactoring is needed to adjust the code for further development. Clean code also exists! just because it's relative doesn't mean that it doesn't exist!
@pmiddlet72
@pmiddlet72 2 месяца назад
To add to the 'good enough' approach. That's fine for innovation, MVP for PoC, and for fairly low risk and reasonably low visibility processes that won't charlie foxtrot other things important to an org. But for everything else, a mantra I adopted long ago "You can do things right. Or you can do them again."
@privacyvalued4134
@privacyvalued4134 3 месяца назад
The best way to write software is to attempt to predict what a future feature request will be for any given unit in the software and then plan for that request to happen somewhere along down the road. You have to REALLY know your audience though or you'll just abstract everything and the result will be Java.
@SandraWantsCoke
@SandraWantsCoke 3 месяца назад
18:55 - (5) is not necessary if you start with atomic components and use them everywhere. It's the opposite of first writing a bunch of spaghetti and then trying to find similarities in random patterns and abstracting those. (done that unfortunately, but gotta learn somewhere).
@tabsc3489
@tabsc3489 3 месяца назад
words of comedicallyy-gold wisdom and equally wise responses to those harsh truths. thanks for sharing, signed a jr dev 1.5 year post grad
@DarrenJohn10X
@DarrenJohn10X 3 месяца назад
Thanks Prime, this was an awesome Awesome video reaction video.
@lukei9772
@lukei9772 3 месяца назад
@Awesome MENTIONED LETS GOOOOOOOOO
@g3mint446
@g3mint446 3 месяца назад
Sometimes I wonder if uncle Bob tried a big project using small functions? I've tried writing clean code for so long. One big project I refactored over 5 times trying to get it clean, on my own time.. No pattern was suitable and I ended up with a bunch of abstractions for business logic that just didn't belong there. One large well procedurally written controller function was the cleanest it could ever get. Anything else was a complete mess to work with. The cleanest code I can write for applications with no UI often boils down to a large controller, some utility functions and well fitting models for objects that should be objects. Anything else makes it just harder to work with, and is absolutely not easier to read.
@bigdbag
@bigdbag 2 месяца назад
I've realized over the years that team organization and larger organizational hierarchy is the best guide for how I approach construction of not only architecture but all the way down to coding patterns. How humans operate in an organization is a great guide to achieve goals like mitigating the rate of code rot and ease of replacing old code with new code.
@no-one_no1406
@no-one_no1406 2 месяца назад
Excel roller coaster? Wow! Now I want a c compiler in excel!
@sploders1019
@sploders1019 2 месяца назад
I try to only abstract things that are simple in principle and complicated in implementation, like TLS (just an example; I’m not doing my own crypto). TLS is exactly like a normal socket, but everything inside it is encrypted. Simple enough, but the process of encrypting the data traversing TLS is obscenely complicated, thus making it a perfect candidate for abstraction
@g.c955
@g.c955 3 месяца назад
we inherited a codebase, I'm trying to convince the project lead to not add optimizations without evidence of a performance issue. I say "we should make minimal necessary adjustments to ensure the delivery of the service given the tight deadline and avoid huge refactoring that could risk introducing unforeseen issue, which will add more workload." but it's hard when it's not your project....😅
@neoncyber2001
@neoncyber2001 2 месяца назад
I used to work with laser engravers. customers will get them working just enough to begin operations again. and i've seen millions of dollars wasted because they got the machine just barely running for the application rather than getting it fully maintained.
Далее
The Worst Kind Of Programmer
19:15
Просмотров 418 тыс.
The Brutal Truth Behind Tech Layoffs | Prime Reacts
1:20:34
Ozoda - JAVOHIR ( Official Music Video )
06:37
Просмотров 625 тыс.
Nima ovqat qilay?😂
01:01
Просмотров 920 тыс.
The Perfect Programming Language
23:50
Просмотров 346 тыс.
So You Think You Know Git - FOSDEM 2024
47:00
Просмотров 986 тыс.
ThePrimeagen Hacks My Productivity
3:30
Просмотров 35 тыс.
I Quit Amazon After 2 Months
29:39
Просмотров 287 тыс.
The Harsh Reality of Good Software
5:56
Просмотров 39 тыс.
Why Most Programmers DON'T Last
18:56
Просмотров 255 тыс.
Cloudflare: Pay Me 120k Or We Shut You Down
30:00
Просмотров 379 тыс.
Why I Quit Netflix
7:11
Просмотров 483 тыс.
Our Terrible Future And Open Source | Prime Reacts
38:29
Will the battery emit smoke if it rotates rapidly?
0:11
Bluetooth Desert Eagle
0:27
Просмотров 7 млн