|
Video Nasty posted:I know, it's great! All the documentation to ever be written about it is already published and available online. lol
|
# ? Feb 20, 2022 14:47 |
|
|
# ? Jun 5, 2024 09:33 |
|
Video Nasty posted:I know, it's great! All the documentation to ever be written about it is already published and available online. Not only that, but you don't have to wake up one day and hear "oh, you really should be using hooks instead of components, please rewrite all your code." All JS frameworks should ideally be EOL.
|
# ? Feb 20, 2022 19:06 |
|
Heh, React is a funny example since their releases have slowed to a crawl. Yeah, they released hooks **three years** ago, but they haven’t done any releases for 11 months at this point. https://github.com/facebook/react/blob/main/CHANGELOG.md#1702-march-22-2021
|
# ? Feb 20, 2022 20:06 |
|
Video Nasty posted:I know, it's great! All the documentation to ever be written about it is already published and available online. Isn’t that ES4? ES5 is what ActionScript in Flash ended up being, if I remember correctly.
|
# ? Feb 20, 2022 21:08 |
|
gbut posted:Isn’t that ES4? ES5 is what ActionScript in Flash ended up being, if I remember correctly. It's whatever Angular1.5 left us with, but I could've sworn it was a little more recent than ES4. Happy to be corrected there.
|
# ? Feb 20, 2022 21:45 |
|
smackfu posted:Heh, React is a funny example since their releases have slowed to a crawl. Yeah, they released hooks **three years** ago, but they haven’t done any releases for 11 months at this point.
|
# ? Feb 20, 2022 21:47 |
|
did you finally learn to use flexbox instead of tables
|
# ? Feb 21, 2022 00:35 |
|
barkbell posted:did you finally learn to use flexbox instead of tables
|
# ? Feb 21, 2022 00:55 |
|
Not trying to hate, I get the allure of knowing what you know and then never having learn new stuff again. But aren't you guys ever worried about, like, losing your jobs? And then becoming unemployable? I would never consider hiring a dev in 2022 that wasn't ES6 fluent. Is there just enough legacy Angular work out there to last?
|
# ? Feb 21, 2022 01:08 |
|
Ah, I don't do front-end stuff for a job, I only do it for my own personal project, so I can use whatever I want that does the job the best and easiest. Which it turns out is whatever doesn't require redoing the whole bastard thing every 6 months when some jerk changes the framework out from under me, and whatever doesn't involve fixing open-source poo poo that doesn't actually do what it's supposed to. (The back end stuff I do for a job *does* involve fixing open-source poo poo that doesn't actually do what it's supposed to, but then I don't mind because I'm getting paid for my time so I don't really care if getting it working takes longer than it should. I mean it's frustrating at the time, but I just have to remember to think of it in money terms.) If you're doing it for a job then there's no personal cost to using whatever the new hotness is, because you can just change project when the framework changes and then that becomes someone else's problem (seen this a lot). And that keeps the job market hot for all of us, by creating a lot of busywork. But I've made the mistake of using new hotness for my personal project more times than I should have, it's taken me like 5 times of getting burned to finally realize "never use any loving framework" is far more effective in the long run. (Well, the last time wasn't a framework, the final lesson was "never use any library controlled by Google". I thought flatbuffers would be safe enough, but no, even that turned out to have a shifting API.)
|
# ? Feb 21, 2022 01:18 |
|
fsif posted:Not trying to hate, I get the allure of knowing what you know and then never having learn new stuff again. I’m fluent in the latest vanilla JS goings-on but it isn’t necessary for my job or a potential future job in the same market at least for the time being.
|
# ? Feb 21, 2022 01:43 |
|
fsif posted:Not trying to hate, I get the allure of knowing what you know and then never having learn new stuff again. Web dev poo poo has so much churn that of any given new framework that people talk about, it'll just go through phases of "everyone thinks this is good and fresh out of college children advocate it" "oh, this actually kind of sucks and you need to start doing things differently to solve some problem that we didn't think of before", "this is outdated and you shouldn't use it, we do it this way now." What I've found is that generally, as stuff has progressed, it's become easier and easier to cotton onto a new web frame work and use the new stuff. I personally thought angularjs was dumb when that stuff was released, and never touched it, and that turned out to be a good instinct. But nowadays, almost every framework I touch is so much better than what was being used towards the beginning of my career that the choice almost seems irrelevant. I also don't really care about updating my resume with latest buzzwords etc. because frankly the people who pigeon-hole their career with language/framework specificity seem to get paid less than people like me. If I need to learn a framework to do a job or work on a new project, I'll do it, and I'll learn that poo poo better than the people who actually like the framework and advocate for it, but I'm not just going to arbitrarily pick a new framework for a project at work and use it just for the sake of learning it, and if I get filtered by some shithole job that wants ten years of experience in a framework that's only existed for one, that company was probably hosed anyway.
|
# ? Feb 21, 2022 06:13 |
|
Bruegels Fuckbooks posted:If I need to learn a framework to do a job or work on a new project, I'll do it, and I'll learn that poo poo better than the people who actually like the framework and advocate for it, Considering your last post suggested that code bases needed to be rewritten when React hooks were released, I'm skeptical. I had to collaborate with a developer at another company on a project about six months ago who I suspect would echo the same sentiments the last several folks on this page have. He needed to use React for the first time and he ended up being less productive than our junior developer, even as we purposely steered him towards projects he felt like he'd be better equipped to handle. Plus, you know, his code ended up being a complete mess and I had to spend an hour or so everyday helping him troubleshoot. For all this hand wringing about silly coding noobs chasing "the new hotness," the tech mentioned in the last series of posts (React, ES6, flexbox) has been dominant and/or standard for the better part of a decade now.
|
# ? Feb 21, 2022 13:30 |
|
I see that exact same scenario a few times a year. Especially because my company likes to shuffle teams in order to make the workforce fungible.
|
# ? Feb 21, 2022 13:44 |
|
fsif posted:I had to collaborate with a developer at another company on a project about six months ago who I suspect would echo the same sentiments the last several folks on this page have. He needed to use React for the first time and he ended up being less productive than our junior developer, even as we purposely steered him towards projects he felt like he'd be better equipped to handle. Plus, you know, his code ended up being a complete mess and I had to spend an hour or so everyday helping him troubleshoot.
|
# ? Feb 21, 2022 14:00 |
|
fsif posted:Considering your last post suggested that code bases needed to be rewritten when React hooks were released, I'm skeptical. I was being facetious with that example. I like hooks better than components too. I'm not going to go back and rewrite a bunch of poo poo that already works using hooks though just because I'd be afraid of being "behind the curve."
|
# ? Feb 21, 2022 16:49 |
|
I'm having a lot of fun and I want to share it with you. There is equal space between these grey boxes regardless of zoom level, zoom level is modulated with the scroll wheel. Zoom level affects only the size of the grey boxes and the space between the grey boxes stays the same. When I zoom in or out it needs to do so without the cursor moving. Usually this isn't too difficult. I've got the cursor position, I've got the dimensions of the page. But what I'm having a heck of a time with is the space not changing between the items that are all over the place. If the cursor is somewhere between the first and second column, then when I zoom out it's going to be over the second column somewhere. I need to take into account the amount that the pixels in the first column changed, but not the pixels in the space between it and the second column. Like. If I'm way down the page and there's 100 items in a column and I zoom in. I need to take into account the amount of space that remained unchanged between all these grey boxes. I more or less have to calculate how many grey boxes down the page my mouse cursor is. Which involves taking into account the height of every grey box above it. Have I lost my mind and all I have to do is scroll half the difference between old scrollHeight and scrollWidth and new scrollHeight and scrollWidth? Because I feel like I thought that scenario out already and decided it doesn't work.
|
# ? Feb 22, 2022 22:45 |
|
Yeah there really is no way to figure out where the cursor is supposed to be without iterating over all the grey boxes above and to the left of the cursor. Guess I'll just, go ahead, and do that.
|
# ? Feb 23, 2022 00:17 |
|
Figured out that a big part of my problem is while zooming the columns will adjust in size differently from one another. 10 grey boxes in one column 20 grey boxes in another column, zooming creates a bigger difference in the column with 20 grey boxes. Because the dang space between the grey boxes doesn't change. What I've been spending all this time on doesn't necessarily make sense. Even if it looks as good as possible, grey boxes in columns are going to be moving up and down a small amount while zooming.
|
# ? Feb 23, 2022 15:42 |
|
roomforthetuna posted:Because there is no such thing as code that isn't a complete mess, not even back when people were constrained to fit their entire application in a kilobyte of punch-cards. I feel sorry for devs who think this way or believe this is some kind of wise truism. Consider it possible that you have had the misfortune of only working with terrible developers in the past, or *hushed whisper* might be one yourself.
|
# ? Feb 24, 2022 07:57 |
|
Anony Mouse posted:I feel sorry for devs who think this way or believe this is some kind of wise truism. Consider it possible that you have had the misfortune of only working with terrible developers in the past, or *hushed whisper* might be one yourself. To be fair, Bernstein's DNS and its helper libraries are actually not horrible, so I may have overstated slightly that everything is bad, just *almost* everything is bad.
|
# ? Feb 24, 2022 15:49 |
|
All code is terrible and needs careful management and validation to not explode at the worst possible moment.
|
# ? Feb 24, 2022 17:55 |
|
Summit posted:All code is terrible and needs careful management and validation to not explode at the worst possible moment. Actually my code is perfect every time
|
# ? Feb 24, 2022 22:37 |
|
camoseven posted:Actually my code is perfect every time Mine is too. Ignore the fact that a few days ago I was trying to figure out how to code an algorithm that doesn't make sense, I've improved since then.
|
# ? Feb 25, 2022 11:16 |
|
My current code is perfect, but my past code is terrible.
|
# ? Feb 25, 2022 11:31 |
|
Crossposting from the Web Design thread. Okay, perhaps I'm an idiot noob at this poo poo, but using dataTables.js, how in the literal actual gently caress do I apply custom CSS? My Flask app theme is shades of blue, and having white/lightsteelbluerows in a table is jarring. Specifically, I want the <thead> to be steelblue and the rows to be lightsteelblue/cornflowerblue.
|
# ? Feb 25, 2022 15:01 |
|
Ola posted:My current code is perfect, but my past code is terrible.
|
# ? Feb 25, 2022 15:07 |
|
I've got these sort of helper functions in typescript. https://github.com/Kequc/kequapp/blob/0.2-wip/src/addable/create-route.ts code:
https://github.com/Kequc/kequapp/blob/0.2-wip/types.d.ts code:
https://github.com/Kequc/kequapp/blob/0.2-wip/examples/basic/app.ts code:
|
# ? Mar 1, 2022 13:13 |
|
It is quite possible I being a dummy, but don't you have to import the types where you use them? I don't have much (read "any") experience with d.ts files, so maybe there is some magic that is supposed to be happening and it's not?
|
# ? Mar 1, 2022 18:30 |
|
Lumpy posted:It is quite possible I being a dummy, but don't you have to import the types where you use them? I don't have much (read "any") experience with d.ts files, so maybe there is some magic that is supposed to be happening and it's not? yeah you can declare them globally with d.ts files. It's the reason (for example) react types (and every other package with @types) just "work" without you having to import them because the "@types/react" package builds d.ts files but for actually source code you're writing, it's a bad pattern. You don't usually want to do it because you have to go digging where the types are. But YMMV teen phone cutie fucked around with this message at 19:53 on Mar 1, 2022 |
# ? Mar 1, 2022 19:47 |
|
I'd assume types weren't working at all except that `ICreateRoute` is correctly registered by my IDE. Which means there's maybe something wrong with my types file, and not registration of my types file.
|
# ? Mar 2, 2022 01:18 |
|
I've started trying to code websites and I am confused how the className property can somehow be used to make a JSX element have different properties. I know a lot of C# and C++ and it makes no sense. Telling the code that you're of the Width class and of the Color class somehow makes it true? using strings? What? Help.
|
# ? Mar 3, 2022 04:05 |
|
well what you're referring to is actually a function of how CSS works: https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors the className property is just setting a class on the DOM element
|
# ? Mar 3, 2022 04:15 |
|
1. Define a CSS class with an arbitrary name, and arbitrary properties: .foo { border: 1px black solid; color: green; width: 100%; } 2. Create an HTML element with a class attribute that's just a string of space-separated CSS class names: <p class="foo some_other_class bar">blah</p>. (JSX is just syntactic sugar for defining an associative array describing an HTML element, and it uses className instead of class because class is a reserved word in JS). 3. When the browser renders the HTML element, it looks for any CSS classes with names specified by the element's class attribute, and applies them to the element. What's not to get?
|
# ? Mar 3, 2022 04:16 |
|
I R SMART LIKE ROCK posted:well what you're referring to is actually a function of how CSS works: https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors minato posted:1. Define a CSS class with an arbitrary name, and arbitrary properties: .foo { border: 1px black solid; color: green; width: 100%; } Thanks
|
# ? Mar 3, 2022 04:25 |
|
Nolgthorn posted:I've got these sort of helper functions in typescript. Is it because I'm using `export default foo as IFoo` and `export as` is actually javascript, typescript just happens to have the identical notation for casting? But I don't think there's such thing as `export default as` in javascript. Regardless. Maybe it's getting confused. Types work in my src directory, strangely enough when imported from the same place... but not outside the src directory... even though my types file is outside the src directory. I've tried moving things around and using different notation but I'm not sure I'm closer to a solution. If anyone has any ideas I'm all ears. I think it might be a bug in typescript? But I'm also not sure how to create a test case for the problem.
|
# ? Mar 6, 2022 22:55 |
|
I was writing a big post with examples of things I tried. Adding `"examples"` (the directory I was having trouble with) to my tsconfig works. But I don't want to include the examples directory in my dist.code:
|
# ? Mar 6, 2022 23:39 |
|
Nolgthorn posted:I don't really understand why I need to include it Nolgthorn posted:since types work fine in my tests directory without it.
|
# ? Mar 6, 2022 23:44 |
|
I'm only talking about intellisense in the IDE picking up the types and having them work properly. The test suite isn't running, I'm just working with types while fiddling around in a directory. Nevermind, only some types work in my tests directory too. Typescript! Everything coming from an Interface is type `any`, return values or properties. Unless I include the directory in my tsconfig's includes. Nolgthorn fucked around with this message at 00:34 on Mar 7, 2022 |
# ? Mar 7, 2022 00:04 |
|
|
# ? Jun 5, 2024 09:33 |
|
Common wisdom seems not to make a `types.d.ts` file and instead use normal imports for types. I thought I'd try something different because I felt it was cleaner but it's causing problems I'll switch back.
|
# ? Mar 7, 2022 15:28 |