[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1626721617472.jpg (122 KB, 1105x980)
122 KB
122 KB JPG
*** Please be civil, notice the "Friendly" in the thread subject ***

>Free beginner resources to get started with HTML, CSS and JS
https://developer.mozilla.org/en-US/docs/Learn - MDN is your friend for web dev fundamentals
https://web.dev/learn/ - Guides by Google, you can also learn concepts like Accessibility, Responsive Design etc
https://eloquentjavascript.net/Eloquent_JavaScript.pdf - A modern introduction to JavaScript
https://javascript.info/ - Quite a good JS tutorial
https://flukeout.github.io/ - Learn CSS selectors in no time
https://flexboxfroggy.com/ and https://cssgridgarden.com/ - Learn flex and grid in CSS
https://roadmap.sh/roadmaps?g=Web+Development - Guided beginner roadmaps

>Resources for backend languages
https://nodejs.org/en/learn/getting-started/introduction-to-nodejs - An intro to Node.js
https://www.phptutorial.net - A PHP tutorial
https://dev.java/learn/ - A Java tutorial
https://rentry.org/htbby - Links for Python and Go

>Resources for miscellaneous areas
https://github.com/bradtraversy/design-resources-for-developers - List of design resources
https://www.digitalocean.com/community/tutorials - Usually the best guides for everything server related

>Need help? Create an example and post the link
https://jsfiddle.net - if you need help with HTML/CSS/JS
https://3v4l.org - if you need help with PHP/HackLang
https://codesandbox.io - if you need help with React/Angular/Vue

/wdg/ may or may not welcome app development discussion in this thread. You can post and see what the response is.
Some app technologies of course have overlap with web dev, like React Native, Electron, and Flutter.

We have our own website: https://wdg-one.github.io

Submit your project progress updates using this format in your posts, the scraper will pick it up:

:: my-project-title ::
dev:: anon
tools:: PHP, MySQL, etc.
link:: https://my.website.com
repo:: https://github.com/user/repo
progress:: Lorem ipsum dolor sit amet


Previous: >>103462578
>>
Angular? More liek FAGular LOLOLOLOLOLLOOLOL
>>
HTMX? More liek HTMStinx LOLOLOLOLOLLOOLOL
>>
Tailwind? More like BASEDwind FRFRFRFRFRRFFRFR
>>
all cringe
>>
Feels like shadcn won, this is the final form of web ui components
>>
File: vue.png (12 KB, 500x300)
12 KB
12 KB PNG
Total Vue Domination
>>
File: 468467498468.gif (1.53 MB, 498x474)
1.53 MB
1.53 MB GIF
i like svelte so far
>>
everything is frameworks and libraries, a bit sad mate
>>
>>103495497
what do you want to talk about friend?
>>
>>103496127
newbie questions about js or css so I feel smart lels, idk, maybe new cool stuff in js/css? About that when are the results of that js poll thingie in the last thread?
>>
>>103496141
>>103496127
guess this one is closing in a few weeks
https://stateofjs.com/en-US
>>
>>103496155
it's closed already. You'll see the message when you click on "Take Survey"
>>
>>103496141
>newbie questions about js or css so I feel smart lels, idk, maybe new cool stuff in js/css?
building anything interesting?
imo that's the best way to learn.
As soon as someone can create a page that does something when you click a button, they should exit tutorial hell and instead start making something.
>>
>>103495169
For me it's React

1) It just works
2) It's easy to use
3) If it's a bit bloated then that's the user's problem, not mine
>>
>>103496772
It's not my personal favorite, but I understand why people like it.
When I have the choice I rather like working with Vue single-file components and its template syntax compared to Reacts JSX.
I likely have an upcoming job, where I'd have to use both, but it's probably going to be fine.
The only one I really don't like is Angular.

Similar for PHP. People say "modern" PHP is so different and Laravel is such a great framework, but I just can't handle looking at it.
And for some reason Laravel is constantly paired with Vue. If I am using Vue, then I'd want to use Nuxt or at least a separate Node backend, not PHP.
>>
>>103496772
I'm one of the people trying to learn webdev here and I was pleasantly surprised how easy React is to use, considering how much people here bitch about it.
>>
what is the best way to get chat messages from twitter streams into my node.js program?

ex https://x.com/RealAlexJones/chat

i see a websocket address in devtools but it has a rolling accessToken and im retarded
>>
>>103498216
huh, since when is the URL just [user]/live for a stream?
I was recently trying to grab chat messages of someones stream, but the problem was that the URL/ID was changing with every stream and requests to someones profile wouldn't show a live stream unless you are logged in yourself.

Can't remember the process I tried exactly, but it was an annoying chain of requests.
>Querying the public API with the broadcast ID
>Getting the media_key from the response
>querying the live_video_stream/status with that media_key string
>getting the chatToken from that response
>and with that chatToken I could eventually auth on the socket of the chat

I wonder what the process is with the [user]/live or [user]/chat URL, if there could be an easier way.
>>
>>103498366
just writing this out and thinking about it makes me annoyed again.
Why is all enterprise code and API stuff this absolute convoluted abomination.
>>
>>103498216
What is a "rolling accessToken"?

Your best bet is the WebSocket. If it has a variable access token or session-limited access token then you would need to somehow first scrape that token. You'd need to play with the ws
>>
>21 posts
>page 10
ded
>>
File: 1460592134821.gif (1.36 MB, 478x357)
1.36 MB
1.36 MB GIF
>React
>useState doesn't actually update variables
>have to use useEffect on top of useState
>have to rewrite a large portion of my app to be usable in any way
I hate react so fucking much, I want to cry, nothing works and everything comes with some retarded caveat that forces you to write code atop of whatever else you wanted to do.
GGRRRRAAAAHHHH!!!
>>
>>103501847
>useState doesn't actually update variables
well yes, it doesn't mutate a variable in-place, that'd be dumb

>have to use useEffect on top of useState
wrong, you shouldn't need to. useEffect is usually a code smell, especially for beginners.

>have to rewrite a large portion of my app to be usable in any way
that sounds like a skill issue
>>
File: npm9q9xvb9xc1.jpg (104 KB, 1080x1294)
104 KB
104 KB JPG
I'm burnt out from being a wage slave dependent trendy tech bs (js/python mostly). Somebody redpill me on PHP or show me good resources for getting started with WP development. I've dealt with enough pajeet tier PHP/Drupal code in the past that just the thought of it makes me gag, but these startup codebases drowning in frameworks make me gag even more. I just need something stable that can land me a steady stream of gigs without making me want to neck myself.
>>
>>103497045
>And for some reason Laravel is constantly paired with Vue.
this is because vue got popular from taylor otwell recommending vue over react and including it in the first party laravel templates/scaffolding
>>
>>103502202
>Somebody redpill me on PHP or show me good resources for getting started with WP development.
when i started at the company i'm working now i was doing wp sites all day all night.
now i'm a literal do-it-all man and i do hardly any fucking programming, i just deal with fucking dumpster fires that other people/departments are too brainlet to deal with, not because these tasks are hard, but because they're literal brainlets
i miss wp and laravel. i did some emergency fixes in an internal laravel tool and enjoyed every minute. no dumb fucking questions, noretarded sheets, no clicking mindlessly, no meetings, no javascript, no frontend frameworks to tard-wrangle
>>
https://pastebin.com/2vNfG8GD
Comrades, can somebody help me fix my code before the commissar arrives?
>>
>>103502921
sure anon, i'm gonna assume, by your nonexistent fucking explanation of the problem, that when you click on the radio the record div doesn't become visible. and that's because yoyu try to make it visible by selecting it in css with a subsequent-sibling combinator
however, the elements you're trying to select with it aren't siblings
>>
>>103502921
>>103503057
also, forgot to add
fiddle that shit you mongloid
>>
>>103503840
>we used to be brothers here
i'm extremely nice to customers at my work
but i call all my bros dumb cunts
make of it what you will
bitch
>>
>>103504101
go back to your tranny discord, dilate, and never come back, faggot
>>
function plaintextLaTeX(str){
function parse(str){
let previous,
superDigit=[..."0123456789"].reduce((p,c,i)=>(p[i]=c,p),{"-":"-"}),
subDigit="0123456789";
do{
previous=str;
str=str.replace(/\\frac{([^{}]*)}{([^{}]*)}/g,(match,p1,p2)=>`(${parse(p1)})/(${parse(p2)})`); //Fractions
str=str.replace(/\\(\w+){([^{}]*)}/g,(match,p1,p2)=>`${p1}(${parse(p2)})`); //Math functions
str=str.replace(/_([0-9]+)/g,(match,p1)=>p1.split("").map(digit=>subDigit[digit]).join("")); //Subscript digits
str=str.replace(/\^(-?[0-9]+|{[^{}]*})/g,(match,p1)=>p1.startsWith('{')?p1.slice(1,-1).split("").map(digit=>superDigit[digit]||digit).join(""):superDigit[p1]||p1); //Superscript digits and braces

//Add asterisks for multiplications while avoiding LaTeX commands
//str=str.replace(/([a-z0-9])(?=(?<!\\[a-z]+)[a-z0-9])/gi,"$1*"); //Between two variables or digits
}while(previous!==str); //Continue until no changes are made
return str;
}
return parse(str);
}
console.log(plaintextLaTeX("H(z) = \\frac{b_0+b_1z^{-1}+b_2z^{-2}}{a_0+a_1z^{-1}+a_2z^{-2}}")); //This should output: "H(z) = (b0+b1*z-1+b2*z-2)/(a0+a1*z-1+a2*z-2)"

Is there a fully-fledged LaTeX to (inline) plaintext conversion for code documentation? (No big ASCII art, it utilizes Unicode math symbols instead. I also spent hours figuring out writing the RegExp, tokenization would be better at that point if you were to add more stuff)
>>
>>103504571
Oops, I forgot that 4chan doesn't support some Unicode symbols for superDigit/subDigit (also in the regular expressions).
>>
inb4 4chan-friendly Unicode conversion
>>
File: Screenshot.jpg (102 KB, 1046x995)
102 KB
102 KB JPG
>>103504571
>>103504602
Not gonna bother \uXXXX
>>
>>103504571
>>103504726
pastebin maybe?
>>
>>103504914
There's no need, it's crappy/broken code anyway that only works for specific LaTeX expressions, tokenization would be more preferable over using RegEx for everything.
>>
>>103504988
github + latex to text, in google see if there's something you can make use of
>>
>>103503057
>>103503066
I think the joke went over your head anon
>>
File: evanyou.jpg (69 KB, 500x500)
69 KB
69 KB JPG
>>103501847
How do you need the state to behave?
In any case, consider Vue.js (unless you are stuck with React)
>>
File: 1696260464551197.jpg (876 KB, 1024x1024)
876 KB
876 KB JPG
testsuo
>>
>>103506163
>mfw unb&'d from posting pictures after like a year or maybe even 2
>>
File: 9dp9m5.jpg (51 KB, 500x500)
51 KB
51 KB JPG
>>
File: Deno.png (14 KB, 1024x1024)
14 KB
14 KB PNG
>>103507626
Deno
>>
>>103507992
Deno does seem to have some cool features. Being able to compile JS into a standalone binary is cool even if the binaries are like 80 MB.
>>
>>103508389
I guess it just bundles Deno with the executable if you decide to use the compile command
Overall it seems like an improved and modernized Node.js with its native TypeScript support and the fine grained permission system.

When it comes to actual compiling then Porffor is an interesting project. https://porffor.dev/
>>
I'm too lazy to make a web app for college. I have to use a bunch of different methods and technologies in the web app to show that I understand how to use them and also design and how it looks are important too. I'm too lazy for this shit. Anyone know how do I use AJAX, xml, json and all that other shit by not just copying some code off the internet? This shit is hella boring. The design part is even worse because I hate art. This is sooo boring.
>>
>>103508469
>Porffor
Looks interesting although it says it's still experimental at the moment

Also the guy making it is only 19, crazy
>>
File: 1548632998951.png (229 KB, 960x935)
229 KB
229 KB PNG
>>103508901
>AJAX, xml
oof, yeah no wonder you say that stuff is boring... is your course material from 10 years ago?
"AJAX" is just a boomer word for making a network request. The modern version of that would be to use the browser native fetch() API.
XML is literally completely irrelevant unless you are working on some legacy API stuff imo. Any time you spend on that is pretty much wasted, when you could learn something else instead.

You don't really have to be a design expert to make things at least somewhat decent looking.
Have a look at this: https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886
Stick to black, shades of gray and maybe one primary color and you'll be fine on that front. Nice padding here and there, making sure everything lines up nicely and it should get the job done.

What exactly is it you are trying to build?
Many here are happy to help as long as you aren't looking to be just spoonfed a finished solution.
>>
>>103509187
nta, both spring and .NET have xml as config files somewhere
>>
>>103509218
ok, to be fair I am mostly moving around JS fullstack things when I do anything backend related.
Haven't seen an xml file in quite a while.
Even then, is it something people really have to "learn"? That's like learning how JSON works.
iirc last time I had to deal with xml was when I had the misfortune to work on some legacy Android app many years ago. Definitely wasn't fun.
>>
>>103509244
>Even then, is it something people really have to "learn"?
hmmmh, idk really, I guess you do that when you don't want to lock your students into a single path for back end, thus why it is used in the use cases I mentioned. Outside of there, not so much.
>That's like learning how JSON works.
they taught me that too!
>Definitely wasn't fun.
complex xml is a pain in the ass, it's so tedious and error prone
>>
File: to594lh44f6e1.jpg (143 KB, 668x767)
143 KB
143 KB JPG
>>103509218
>both spring and .NET have xml as config files somewhere
I hate corporate tech so much
>>
I am trying to use fetch() and ajax or xmlhttprequest, i don't really know the difference desu. I wanted to use a rest api but idk how tf that shit works and everywhere I look I have to sign up or pay for it. My main goal is to display data using both xml and json but idk how tf I'm going to do that. I wanted to use a rest api but as I said I find it too much of a nuisance and also I don't really know how to integrate it to my liking. I want to have a bunch of various data using json and xml and to give a user the option to sort the data in any way he likes, for example for cars; jeeps, sedans, sports etc. I was only able to get to display data for the json on one table and xml on the other table and on the exact same page, I have to use this thing where I change pages but it doesn't need to load, idk what its called since I forgot. Its going terrible. I also have to figure out how to use dom js, jquery, xslt, xpath, xml schemas and javascript.
>>
>>103509539
node + express or php, pick your poison, you need a back end lang to actually read from the files
>>
>>103509539
yeah, there is no need to pay for anything.
So your task (in part) is to make the files available on a server and then fetch them from your frontend?

>I have to use this thing where I change pages but it doesn't need to load
what do you mean? I guess you have to change the data on the page, without reloading the page?
So like having 2 buttons and depending on what button you click, you either fill the page with the data from the JSON file or data from the XML file?

How are you loading the data right now?
>>
File: logo2.png (11 KB, 640x360)
11 KB
11 KB PNG
>>103507992
>>we're too dumb to write dino, hence our logo looks like a downo
>>
>>103509919
what was your thought process when posting that reply?
>>
>>103509919
"node".split("").sort()
>>
File: downo.webm (468 KB, 942x170)
468 KB
468 KB WEBM
>>103509989
?
>>
File: file.png (2.25 MB, 2642x1690)
2.25 MB
2.25 MB PNG
>>103493347
I made these today.
https://files.catbox.moe/waq93l.webm

https://greasyfork.org/en/scripts/520659-4chan-thread-sorter
https://greasyfork.org/en/scripts/520658-4chan-post-image-grid
>>
File: 1551297853523.jpg (29 KB, 300x500)
29 KB
29 KB JPG
>>103510060
>>
>>103510067
pretty cool
>>
>>103495169
>>103496772
> Not just using vanilla js and css

ngmi
>>
File: file.png (3 KB, 194x184)
3 KB
3 KB PNG
>>103509919
what handsome lad
>>
>>103510333
>AI, draw ze most downest deeeno u can imaginedragon.
>it'll be ze logo for our jaaavascript intapreta called deeeno
>also find a gud name foa our intapreta
AI: here is your logo and the name shall be "deno"
>top notch AI, here is the millions we woulda all have given to zo called professional deeesigners
>>
File: 2024-12-14_01-57.png (163 KB, 1047x463)
163 KB
163 KB PNG
>librewolf with 8 tabs devours 15Gb of RAM
Why is modern web like this? Are you part of this problem as well or are you trying to change the web crisis?
>>
>>103510987
doing my best here
on a site note, got both Chrome and Brave open right now with a shitton of tabs and they only eat 3.5GB each.
Does librewolf have something like Chromes task manager where you can see the usage of each tab?
>>
>>103493347
i have a site i wrote with my limited knowledge of html and css now i need a section with a gallery,i have a folder with 200+ images i want to post is there some html css code i can use for this thats already made like i just dump it all into this folder then i href it to it.
I was thinking of renaming them all to 1-200 then just copy paste with the numbers but is there a pre made version.
>>
>>103511428
Unfortunately, there is nothing like that AFAIK. Seems to be quite complicated actually, but if you start today, you may be able to make something work before the end of January.

Good luck anon!
>>
Asking everyone in here, how is the market like for web dev right now? Is it getting better for you? What things do you see in demand?
>>
File: 1729202421293241.jpg (542 KB, 1079x1127)
542 KB
542 KB JPG
>>103510804
>downest deeeno u can imaginedragon
i keked
>>
>>103509989
"node".split("").toSorted().join("")
>>
>>103512244
>>103509989
illuminati confirmed
>>
>>103510987
Some of the problems in modern webdev are due to FE retardation, many more can be traced to the marketing department.

No matter how hard we try at our company, the clients marketing and sales departments always manage to suffocate their sites under the weight of a thousand shit third party addons
>>
>>103509989
Array.from("deno", char => char.charCodeAt(0).toString(2).padStart(8, '0'))
.map((_, i, arr) => arr[arr.length - 1 - i])
.map(binary => String.fromCharCode(parseInt(binary, 2)))
.reduce((acc, char) => acc.concat(char), '')
.split('')
.join('');
>>
File: 1583074176553.jpg (81 KB, 910x960)
81 KB
81 KB JPG
>>103515149
>>
File: _.jpg (219 KB, 1920x1080)
219 KB
219 KB JPG
>>103515149
>>103515197
>>
File: Ruby_On_Rails_Logo.svg.png (21 KB, 1024x387)
21 KB
21 KB PNG
Thoughts?
>>
>>103516473
It just works but people will stay hating
>>
>>103516473
>Thoughts?
tentacle rape logo
>>
I've got a few bloated (50+GB) proprietary toolchains I need to use for development that are only compatible with specific versions of ubuntu & redhat. I've been using VMs but it's a pain and I was exploring alternatives. What I've come up with (but haven't attempted) is to use containers for the build environment and install the toolchain inside the container to a volume mount which I can then mount to any container I need. so end result would let me do this:
>host: ../container-volumes/bloatv1 bloatv2 bloatv3
>container1: mnt bloatv1
>container2: mnt bloatv2
>container3: mnt bloatv1 bloatv2
>container4: mnt bloatv3
then I can develop on the host and mnt my project to the appropriate container to issue build commands.

does this make sense? anyone run something similar and can provide feedback?
>>
File: background_05.1bef5781.jpg (390 KB, 1920x930)
390 KB
390 KB JPG
bump
>>
>>103518997
Any company that infantilises its employees is a bad company
>>
>>103511689
>Asking everyone in here, how is the market like for web dev right now? Is it getting better for you? What things do you see in demand?
Bumping for this
>>
>>103511689
>>103520284
Can only report from a German/EU perspective.

I left my last job a little over a year ago (by choice). And now started applying again about 2 months ago.
I feel there are actually a lot of available jobs right now, _especially_ when you do React.
Right now I only consider remote jobs, where I can use Vue and there are way fewer open positions in comparison. Got a job offer now where I could theoretically start in March next year, but not 100% sure if I'll go for it.
If I were to apply to React jobs it would definitely be a lot easier.

When I just go by web technologies, the things I probably see the most are:
>React / Next.js
gap
>Angular
>PHP / Laravel
>Node.js
>Java
small gap
>C# / .NET
gap
>Vue
gap
>Go

also regularly seeing:
>SQL
>AWS
>GraphQL
>knowing how to write tests

basically never seeing:
>Svelte
>any other frontend framework

I am specifically searching for frontend positions, so the backend stuff I see is rather incidental.
All of this is just a rough impression. Might be way off from actual numbers.
>>
>>103520911
oh and to add, while there are a lot of jobs, there is also a lot of competition.
The guy from the job where I got the offer said they had ~80 applicants, of which they had about half progress to the coding challenge.
Too many applicants seem to be low quality though and are trying to bullshit themselves into a position using ChatGPT and such.
When asked questions about their app/code it's apparently not uncommon, that some can't even explain the thing they are presenting in the interview.
>>
>>103521067
also often times the reaction from companies feels totally random.
I send everyone the same single-page document with details on my past positions and my current skillset, and many reject me outright while others are very interested and happy to schedule an initial interview.

Luckily very little HR bullshit though and often times even the initial video call is with someone from the dev-team and/or in leading/managing position.
Might be due to Vue being more common in smaller companies though, so I am mostly bypassing the Enterprise environment.
>>
>>103520911
>When I just go by web technologies, the things I probably see the most are:
>>React / Next.js
Reactbros win again
>>
Cloudfare
What do they exactly do for websites?
Do they give me unlimited bandwidth for my server and ddos protection or something?
>>
>>103523484
they change your DNS entry to point to their IP address so that all your website traffic goes through them first so they can provide a firewall + cache before serving your site's content. Zero egress fees.
>>
>>103524231
>Zero egress fees.
How is that fucking possible? That data is probably being siphoned by more than a few three-letter-agencies
>>
>>103511689
>What things do you see in demand?
Wordpress
>>
File: 1722269548078194.jpg (145 KB, 544x900)
145 KB
145 KB JPG
i am starting python and react brehs
any tips? I come from vue, and various mvc frameworks
i want to escape node but it keeps pursuing me
but at least i can do python
>>
>>103493347
Nah I'll use Claude and not have to learn any of that retarded shit
>>
>>103525063
React docs nowadays say to use a framework like Next.js, Astro or Remix. So I'd start off with that.

The frameworks are pretty easy to combine with a python backend but if you can get away with it it's preferable having everything just in JS.
>>
>>103524380
>How is that fucking possible?
They can easily cover unlimited text-only HTTP traffic because of how much they charge for multimedia traffic. If you start streaming audio or video on your free Cloudflare account they'll block you and force you to start paying.
>>
File: 1686394213225400.jpg (75 KB, 1024x1024)
75 KB
75 KB JPG
I started a new Fullstack job recently. We use Nuxt.js with ton of other technologies, not just JS. There is obviously other stuff for deploying, for management, shit like Jira/Bitbucket etc.

It all feels overwhelming. Literally like meme from this video: https://youtu.be/aWfYxg-Ypm4

Basically you are dumped into this clusterfuck of 20+ years of adding tech and tools on top of JS and you are expected to know it to climb up. And with shit like AI on the horizon and having to keep up with that (learning prompts and making LLMs etc. and using it so that you won't stay behind) it feels like you need to work harder than trying to become a fucking heart surgeon.

Not to mention i kinda winged my way into this. I still kinda suck with CSS and frontend, with JS i lack some basics but i already read most of javascript.into to try to keep up.

I guess i need tips on how to speedrun this and how to keep up and get competent enough into mid/senior even in few years to not stay behind.
>>
https://leetcode.com/problems/find-the-maximum-divisibility-score/description/
https://leetcode.com/problems/longest-subsequence-with-limited-sum/description/

Is there even point in solving them ? I'm already annoyed by the reading the assignment itself.
Will leetcode help you grow and improve ?
>>
>>103524231
>they change your DNS entry to point to their IP address so that all your website traffic goes through them first so they can provide a firewall + cache before serving your site's content.

so they reduce my bandwidth fees? I still have to pay for my server hosting?
>>
>>103527246
>Is there even point in solving them ?
>Will leetcode help you grow and improve ?
For "something" surely, but for webdev, specifically frontend, these kind of tasks probably aren't too useful.
Especially since you could technically solve them while writing completely unmaintainable spaghetti code.

Writing maintainable, easy to read components and handling state in a way that won't blow up in your face, when you have to change something later on, is one of the most valuable skills when working in frontend imo.
>>
Do CSS :root variables affect performance on their own? Or the amount of variables rather. Long story short I ended up with more than 200 variables (includes embeds and stuff) and and I really don't want to rewrite that shit, so I'm wondering if it matters at all. Google doesn't turn up with much info on the subject.
>>
>>103527728
They really shouldn't affect anything.
Some projects may be using multiple huge CSS frameworks with all kinds of bloated stuff and I never heard of performance being the specific problem in that regard. (apart from sending that data over the network, but a few lines of variables won't make the difference)
>>
>>103529378
>>103527728
nta, but if a page takes 2+ passes and switches styles, it's dead cringe to me, my guess is that it is somehow loading multiple styles at different load times, but damn, that's fucking ugly
>>
>>103496772
React is deprecated technology. It came around in the era of Internet Explorer and had to do a lot of slow, optimized stuff in order to deal with IE's shortcomings, and now it is permanently stuck in that state forever because of backwards comparability reasons.
>>
>>103529477
react sisters?
>>
>>103526602
Fake it 'til you make it. Keep reading docs and articles on shit you're weak on.
>>
>>103527306
Yes, they reduce your hosting fees by having less traffic actually go to your origin server, especially for assets. So yeah much less fees and less CPU usage.

If you want to go a step further, you could also set up a firewall (or AWS security group) to make that your origin server is set up to only accept connections from CloudFlare IP addresses. So that you can avoid having any malicious users try to directly access your server by it's IP.
>>
>>103527246
if you want to get more into the CS aspect, maybe
but you would be better off using your time using CS books instead

other than that, lc is only meant to help you pass retarded interviews
if you do not need to prepare for interviews, your time would be better spent studying something else
>>
bump
>>
I'm shit at design and have no creative sense, but I'm a good dev. Any tips or resources? Are there any AI models that can help with UI/UX?
>>
Best vue3 course?
>>
>page 10
Bump
>>
>>103525063
Why do you want to escape Node and use Python instead?

Personally I prefer Node
>>
>>103536347
Because Python has a lot of cool stuff like math libraries, ML, and misc AI applications. I see it as a way to get started with it.
For web services I prefer Golang. Node's ecosystem is a clusterfuck that I only deal with if I my job requires me to do so.
>>
>>103536501
>Node's ecosystem is a clusterfuck
I think there's some decent packages out there

Go is very cool, I'm trying to learn it more. I like the easiness of Node though. If I had to make something quickly and performance didn't matter too much then I'd probably use a Node back-end
>>
>>
>>103538747
>get paid
this, like the rest of the story, never happened
>>
>>103534378
>Best vue3 course?
"How to adapt to breaking changes"
"Marriage, Divorce, Vue Upgrade - handling important life decisions"
"React for people with special needs"
>>
>>103538919
It's okay to prefer React friend, but no need to hate other frameworks.

>>103534378
The official docs are pretty good imo.
There is also vuemastery.com which is kinda pricey though. Sometimes they have free weekends where you can use something like yt-dlp to just download everything at once, but it's probably no use if you want to learn right now.
>>
>>103510987
Use a real browser
>>
>>103540205
nta, chromium uses less memory, but it is extremely garbage
>>
trying to transfer all my vanilla dummy code to my node files, config, controllers, middleware, models, routes and my server.js
what am I in for as a /nocoder/?
>just learn to code bro lol
I can't...I can only use chatGPT
https://nodejs.org/en/learn/getting-started/introduction-to-nodejs
This shit is gibberish
Why does everthing need a CRUD?
>>
>>103540310
There's always Firefox
>>
>>103540785
how would you be a nocoder and yet also have dummy stuff that would map to those kind of things?
Did you make up some large application in 100% in-depth pseudo code?
>>
>>103540785
>Why does everthing need a CRUD?
what are you asking
>>
>>103540785
you're lucky that gpt now can spit multiple related files, I guess you should learn what makes a good structure of the project, and then just follow it, combine chatgpt with fishing for github projects that are worth its weight
>>
>>103541189
I asked chatGPT to piece together this webpage
Now I have this yuge block of code I can't even really test cause I have to use POSTMAN and MongoDB
Looking pretty grim
>>103541252
I don't know how to dissect my post function from its other functions like creating a textbox after transferring it to a node function in server.js cause it's a CRUD route and the other functions are just for making textboxes appear and stuff
>>103541334
I'm just copying 4chan but I don't have access to the source code
>>
>>103539299
>It's okay to prefer React friend
It is not, buddy.
>>
>>103541533
make it easy on ya, learn how to make 1 (one) thread and post to it, once you have that figured out, figure out have to have multiple threads you can create and/or post to, once you have that figured out, then it's time for creating boards, yes you will have to re-do the DB multiple times to adapt to this, but your knowledge will be more solid this way, final step is admin role and security
>>
>>103541573
>see that guy?
>he uses a different front end approach than you
>:[
>>
>>103541595
i don't think i can post to it using postman to input posts into my mongodatabase, i tried and it didn't work, plus i want images and stuff
is there another way to test posts?
>>
>>103541755
node + express + mongoDB
the node + express set up a back end env from where you'll be able to:
1. conect to DB <= you're here
2. create an API endpoint from your backend that inserts a row into a table (hardcoded data)
>>
>>103541533
oh shit, I didn't see that used ChatGPT.
Yeah this shit is never going to work.
The AI code you have might not even work properly in the first place.
Trying to build something with ChatGPT will literally take longer and be 100 times more frustrating than if you were to simply learn that stuff yourself.

listen to >>103541595
Make a ridiculously simple page where you can post things to, save it in localstorage or wherever.
Then maybe network it and make it persistent on a server. No auth, simplest endpoint in the world, save that stuff in a JSON file, doesn't matter how shitty you make it, since you won't know any better and redo it later anyway.
Just expand from there.
>>
>>103541785
>>103541755
forget the postman shit until you've been able to connect to DB first, then after that make a post to the DB from BE, and after that you can start making API endpoints, that you'll be able to hit from postman
>>
>>103541785
>>103541795
>>103541880
the database stuff is really confusing, I've got db.js, server.js, config.js
controllers>postController.js, replyController.js, threadController.js
models> post.js, reply.js, thread.js
routes>posts.js, replies.js, threads.js
that I've got to put code into so it will interact with the database, not to mention creating a schema.
it's so different from vanilla javascript I don't even know where to begin with a single function, looks like I have to branch out and hit all the different bases each time just to do one thing
>>
>>103541944
I don't even know where to begin or what files to use to create a single post
>>
>>103541880
I thought mongoDB and node didn't use SQL?
>>
>>103541944
>>103542021
as far as I'm aware you can make an API with both SQL and NoSQL
that's not the point, the point is that you have like 4 or 5 files, and you're not going to make all of that work, because it takes some wiring between the files that you don't know yet how to create
1 file, it launches the express server, and it connects to MongoDB. That's it that's where you should start
>>
>>103541944
sorry man, but you really should start from scratch.
>it's so different from vanilla javascript
this doesn't even make much sense in your context. What about the code isn't vanilla?

>>103542021
>node didn't use SQL
Node is a JS runtime. You can use any database that you want with it.

Please just throw everything out and make a minimal example that is 5% of the code that ChatGPT gave you.
What you have will go nowhere.
>>
>>103542041
>>103542021
I think you need to simplify it even further,
1. launch an express server that just says hello world in the console
2.create A DB with mongo, create a table, and input a row to it
the table is basically this
data <= name of the table
id (autoincrement, primary key), text (string/varchar)
>>
so this is the power of chatGPT coding
>>
>>103542055
I'm using MongoDB Compass and it seems like it's a bit different than PHPmyadmin when it comes to creating tables, they have collections instead which is confusing to me, not sure where all the data goes in these collections...specifically the data that I add from the BE
>>103542050
I think I have to transform a lot my vanilla JS into Express, Node and JSON
I want to keep my code thougheverbeit, gotta say that creating connections from scratch helps a lot though, thanks frens
>>103542041
I think I can do this
>>
>>103538146
There are good packages. The problem is not the packages themselves, but npm, and how JS is such an incomplete language that you need a package for every small thing. You end up with a huge dependency tree that is impossible to maintain on any semi serious project.
> If I had to make something quickly and performance didn't matter too much then I'd probably use a Node back-end
This is a good usecase for it in my opinion. The moment you introduce webpack, TS, or whatever, you are better off switching to a statically typed language with a decent STL and package management.
>Go is very cool, I'm trying to learn it more
I seriously recommend it, it is a very enjoyable language. There is some weird shit within its community, but just ignore that and focus on the language.
>>
>>103542278
>I think I have to transform a lot my vanilla JS into Express, Node and JSON
please don't take this the wrong way, but a lot of the stuff you write really makes no sense.
You have to go back some steps and actually learn what these things are and how to use them.

Make a clean Node project.
Create an express server with a single GET endpoint that serves a simple Hello, World string or something.
There is so much wasted energy in what you are trying to do right now.
>>
File: file.png (1.47 MB, 850x1093)
1.47 MB
1.47 MB PNG
I know Spring.
I'm about to get into Vue.
My question: Is Nuxt a meme?

As someone who will have their own decoupled REST apis for the backend, do I even need Nuxt? Should I learn it?

Thank
>>
What about using SQlite for rate limiting instead of Redis or Valkey? Has anyone done this?
>>
>>103542881
Simply get used to Vue for a start.

Once you got a good handle on things, Nuxt will do some of the lifting for you in some areas.
Vue files in the pages directory automatically become routes, auto imported components, modules you can import that are ready-to-use for a Vue environment, and so on.

It's not like with React, where even the React site recommends you use Next.js right from the start.
Starting a project with just Vue instead of Nuxt is probably the right thing to do in most cases. You can always copy things over and make the jump up to Nuxt later.

https://www.youtube.com/watch?v=dCxSsr5xuL8
>>
>>103543061
Thanks man, I appreciate it.
I'll focus on Vue for now.
Would you recommend learning the composition API?
The official vue guide kind of makes you choose one or the other.
>>
>>103543096
To a degree it's personal preference, but the composition API with the <script setup> syntax is the more modern choice imo.
Vue 2 only had the Options API and it's still there now for compatibility.
Most examples you see will use the composition API though.
>>
>>103543145
Big help. I was being a bit indecisive. Thanks again.
>>
>>103542307
>node packages clusterfuck
>python good (because that was the original claim)
really? like really? pip install my arse
>how JS is such an incomplete language that you need a package for every small thing
you do NOT need that. people are just lazy for no reason. And once you start importing X you also get [A-Z].
>You end up with a huge dependency tree that is impossible to maintain on any semi serious project.
I agree. But Python is simply not better in this regard at all. Yes, you generally end up with "fewer" deps, because you do not get so many minor packages, but they are not better when it comes to updates, management and sane versioning.
>>
I will answer your AWS or SQL questions until I have to start wrapping Christmas presents.
>I've been reading and reading and I want to read more to learn, what should I read?
don't. build.
>sell me on using AWS instead of a VPS
I'm not a salesman and you haven't given me a use case.
>>
>>103543513
How can I maximise my chances of getting a junior web dev job (a job which may or may not involve using AWS and will likely involve using SQL)?
>>
>>103543513
based anon

thanks for sticking around this general btw, you've answered quite a few of my questions a few months ago after our business just went in to using AWS
>>
>>103543791
I’m not a great resume writer, hiring one may be a good start. 80% of SQL can be learned in a weekend, the remaining 20% takes 15 years. Know 80% and you’ll pass most sniff tests. Understand grouping and aggregates is usually good enough for a junior. As far as AWS, the only real answer is practice. Build a website using cloudfront, s3, and then add CodePipeline and CodeBuild to deploy it. Keep iterating from there, add a server component.
>>103543843
Thank you, very happy to hear that. I hope i can continue to help and i hope the migration is going smoothly.
>>
>>103544029
Thanks for the answer, I appreciate it
>>
>>103493347
I'm looking to develop my first website, I've done shitty little static pages in school and toyed with databases in school, but I haven't had to make a real-world site and am now out to do that on my own. I've made Wordpress sites and set up hosting on static sites easily enough, but that's not nearly the same as a real deal website.

The first thing I noticed on the sort of websites that I'd like to make are ENORMOUS stylesheets, usually several on the index page, and a ton of scripts without an immediately apparent purpose. Are these the result of some general templating that I'm not aware of or are people just casually producing these 250k character (whitespace removed) stylesheets by the half dozen for real-world sites?
>>
>>103544506
I haven't really worked with Wordpress, but my assumption is that it's one of those environments where developers don't really have a lot of control over the final result.
Someone decides to use a certain template, a few trackers, a bunch of plugins, and suddenly you end up with what you described.

You can have a lot of control and you can do a lot of optimizing on the CSS and JS the user is loading in the browser, but can't really do that in a website builder style environment.
While people like to make fun of web stuff being comically bloated, there are also some people that put in a lot of effort to really get the bundle size down and shave off a few more kB. (but it's not what most devs are tasked to do in their jobs...)
>>
>>103543350
I did not call Python good. I think it is useful for AI and ML. Because that is where it all is with TensorFlow, numpy, PyTorch, etc.
Like I said, I prefer Golang for web services, which is what I would be using if given the choice.
>you do NOT need that. people are just lazy for no reason. And once you start importing X you also get [A-Z].
Come on man, the JS STL barely has anything in it. You have to import shit for almost anything worth a damn. A simple CSV import to run calculations on decimal numbers is doable with the STL in most other languages, but in JS you need an npm package. Maybe dependency hell is a real issue in Python as well, but I only got started with it so I cannot comment on that.
>>
What the fuck is going on with the wordpress guy? he's gone insane.
>>
Do y'all split your react components into different files? I'm a never splitter, but lately it's getting harder to read my single jsx file...
>>
>>103545147
the hero webdev deserves, but not the one it needs right now. so we will hunt him. because he can take it. because he is not our hero.

he is right in every aspect. And as we see, the legal system does not do him justice. Of course he is insane in the sense that we all saw him not getting through with this simply from a legal point. But that does not mean that he is not right.

wordpress is gpl. The gpl was made for users, but corporate entities are not the users, if they sell *instances* of the software under the name and brand that the creator of the software used. Of course you should license that.

if I sold you "original mcdonald's" burgers, you'd bet that I better have a deal with them.
>>
>>103545080
>the JS STL barely has anything in it.
Which STL in the first place? It's a language that was made for the browser. Are webAPIs part of the STL? Is the DOM part of the standard? Compare that to stdlib: It is not part of C in the kernel, in embedded C... it's posix C. That's a huge difference.
>A simple CSV import
I would never have considered that to be something that a STL needs.
>Maybe dependency hell is a real issue in Python as well, but I only got started with it so I cannot comment on that.
It is. It looks different, but it is.
>>
>>103546644
>the hero webdev deserves, but not the one it needs right now. so we will hunt him. because he can take it. because he is not our hero.

no no no no no, that's not how the meme was, raise a fix PR for this commit ASAP
>>
>>103502202
if you want to get out of the pajeet tier tech employment, learn a compiled language

>>103507992
Haven't tried it. I do enjoy bun. It has built in nodemon and .env functionality which means I can whip up shit fast before I worry about npm and other dependencies
>>
File: newtab.webm (2.83 MB, 1280x720)
2.83 MB
2.83 MB WEBM
the vanilla js localstorage-only spa is slowly coming together. eventually its going to graph things like link usage and modifications over time. sort ordering is implemented, but i just havent gotten around to making the forms for changing it. im hoping to also implement profiles and custom colors, but those would need to wait until the settings page is worked out.
>>
>>103547196
>vanillaJS SPA
it cannot possibly be done, said all of wdg ever. so not believing you unless code is posted.
>>
>>103547726
nta, but where is the issue according to you?
>>
File: windower.1.webm (1.95 MB, 1280x720)
1.95 MB
1.95 MB WEBM
>>103547810
im guessing hes memeing about framework dickriding. between things like nested css, custom elements, and lots of the newer html/js features, vanilla isnt terrible like it used to be. frameworks are always going to be faster to build with because thats their ultimate goal, but if a framework can do it then by necessity it can be done in vanilla (or god forbid wasm).
>>
>>103545147
The other company stole the trademark he owns.
>>
>>103548028
you made me think of something, that jQuery made css selection a thing, when that didn't even exist. I wonder what wizardry were they doing under the hood
>>
>>103548028
>>103547810
>oh noes, you cannot not use a framework
>you'll just build your own (tm)
>you'll transpile, minify, uglify, shittify anyways, so the build pipeline is already there (tm)
>only frameworks scale (tm)
>also: unemployed (tm)
of course I am memeing, about what, that is the question.
>to be faster to build with because thats their ultimate goal
Is it though? It is one of the claims that is always thrown at the party, but I have yet to see proof that they actually deliver. And then you get the next claim:
>if they would not and were not better in all regards, nobody would be using them!!!
(written from my iPhone)
>windower.1.webm
I like what you are doing, but a "window manager" in html is just appending the click target as lastChild with absolute positioned children, so...
that don't impress me much
Been there, done that. In like 2007 or so.
>>
What's the best practice for running a simple web app on a VPS?

user's computer --> VPS[Reverse proxy (Caddy, Nginx...) --> Web app (Go + HTML/CSS/JS...) --> Databases (Postgres...)]
>>
>>103546644
I understand his anger that WP Engine doesn't contribute to the project

But I guess that's what you get when you open source your project

>>103548418
If that's true then surely a judge will rule in favour of WordPress but they haven't done so yet
>>
>>103497045
Yeah, angular sucks
>>
File: 7ajlfimbte7e1.jpg (34 KB, 538x615)
34 KB
34 KB JPG
>>
>>103548601
you take this way too personally, yes, vanilla js is perfectly doable, but it requires work WHEN we're talking about a big project where multiple devs will work with the stuff, that's not a deal breaker, it's just something the finance department might deny
>>
Does anyone here use PHP in (soon) 2025?
Do you like building things with it in a work setting?
>>
>>103550102
>But I guess that's what you get when you open source your project
This is not about opensource software. There is a huge difference here: The are not selling the software, the are not handing out copies (which they are allowed to), they are selling running instances branded under his trademarked/copyrighted name while also eating resources on a free service that wordpress.org is offering.
Yeah, I mean, the gpl did not see any of this coming, but surely this was not what the gpl wants. If anything, this is against the idea of the gpl, because the resellers are not really giving you control at all.
So this is not about open source in the first place. It is just that they could have paid for the use of the name *by providing* to the open source project.

But of course he must be stopped, because money. How dare him try to work against all that? Of course he is insane when he believes that he will "win" this way. But hopefully he does not stop, because that would be a win for open source software: Tell users to run the software themselves, which is the only thing that would actually provide any freedom at all.
>>
>>103550855
>in production
I don't get it. In my company this would have never been out in the wild without an AbstractCompareBooleansAbstractFactoryCreatorInterface.
What is this bullshit code?
>>
Holy shit what the fuck is this React mental illness that they call JSX??
(ignoring things like keys or "n" not being the same as 0-based indexing for this)

Vue
<div v-for="n in 8">{{ n }}</div>


Svelte
{#each { length: 8 }, n}
<div>{ n }</div>
{/each}


React
{[...Array(8)].map((_, n) => (
<div>{ n }</div>
))}
>>
>>103551696
it'd be way more readable without that _, it threw me off big time
>>
>>103551696
>>103552222
>loop for thing in constant
how about simply writing html instead?
>>
>>103552222
>more readable without that _,
yeah, but it's just the argument of the map function
>>103552376
If you dont understand why someone would want to render something via a quick loop instead of autistically copypasting the same exact row 10 times then please dont reply.
>>
>>103551072
I do, my company uses an old version of Zend but has been upgrading it quite a lot.
I don't like it, but it werks, and pays well.
>>
>>103552522
>but it's just the argument of the map function
yes, but the symbol makes it look as if it were something else
.map((n, i), way more readable imo
>>
>>103552551
ah yeah, I get what you mean.
It's just that depending on linter settings it might give you a message or warning about a declared but unused variable, if you don't explicitly use a _ there.
>>
>>103552613
nice, had no idea
>>
Web dev isn't real programming. If you've ever committed code generated by "AI", you're also not doing real programming. Simple as.
>>
>>103552717
your nocoder ass doesn't make the rules, simple as
>>
>>103552717
>Web dev isn't real programming
Tell that to the engineers making big bucks to build Facebook, Instagram, Xitter, etc
>>
I will learn Go
>>
>>103553273
go sounds really good
>>
>>103549070
yeah thats about the gist of it. putting in a second reverse proxy/load balancer/cdn on your edge is also considered good so that your static files can be cached and you dont hammer your vps.
>>
File: file.png (14 KB, 1025x633)
14 KB
14 KB PNG
Could a simpleton like me learn how to make and maintain a simple website? I want to write about books and I want to have a website that looks a very specific way (very simple, just a navigation bar on top and a horizontally centered grid of books, when you click on a book you can read what I wrote about it, it doesn't need to be a modal window but I'd like it to open in that same page instead of a new tab)
I know I'll have to learn at least HTML, CSS and JS, and also how to upload that to some kind of web host and I feel like I'm a low IQ monkey and it'll take years till I have something usable, while the alternative is to pay whatever ridiculous amount of money Squarespace wants for their wysiwyg editor plust hosting.
How hard would be if I decided to do it by myself?
>>
>>103554850
Use version control (git) for your codebase and there's hundreds of hosting providers out there that will hook in to your github repository and automatically deploy it, like Vercel, Netlify, CloudFlare Pages, GitHub pages.

Depending on how exactly you want the site to function (e.g. authentication, user accounts, databases etc) it starts to transition from a simple website to kinda tricky if it's your first go.
>>
>>103554901
That's a good point, I forgot to write that I don't need any kind of user interactivity, it's basically just a fancy blog, I'm even willing to manually write my entries in plain text or markdown, don't even need a CMS or anything. It's just a pet project of mine.
The first thing I thought of was Wordpress but I couldn't find any template I liked, and it seems like creating/modifying Wordpress themes it's harder than just writing plain HTML and CSS for a basic grid and some links, right?
>>
>>103554850
That's actually a cool project to learn webdev basics.

You already have a good mockup, so you know what elements you'll approximately have in your HTML.
You can actually do this in pure HTML and CSS if you want, no JS necessary here.
(It could possibly end up being a bit tidier and later help you with managing your blog-content, like automatically turning your markdown into HTML, but try doing it without it first)

And honestly while version control is super useful like the other anon said, I maybe wouldn't bother with it until you have your first version of your site, so you can get up and running quicker.
Static hosting sites like Netlify simply let you drag and drop your folder with your HTML and CSS into their site and give you a public URL, where your website will then be available on.
>>
>>103553273
I will never willingly write in a non-functional language again
>>
>>103555724
Functional programming is a meme
>>
>>103555808
just say you got filtered, it's ok lil bro
>>
>>103555724
what do you use?
>>
>>103554965
A CMS like wordpress is kind of tricky to set up because you're using a server language (PHP) and a database (mysql) which will need you to figure out how you're going to host it.

If you're wanting to do your content in markdown I'd probably just reach for a static site generator like Astro so you don't need to use any server languages (like PHP) and databases. It may be a bit too advanced if you've never worked with HTML/JSX before though.

Anyhow, here's a template to get started:
https://vercel.com/templates/astro/astro-blog
https://github.com/withastro/astro/tree/main/examples/blog
>>
>>103545748
same file if the components are inherently linked and/or small enough to justify it, otherwise split
>>
Why ts gives me errors on this? How do I do default value and a type guard with jsdoc?
/**
* @template T
* @param {number} rows
* @param {number} cols
* @param {T | ((i: number, j:number) => T)} value
* @returns {T[][]}
*/
export function createMatrix(rows, cols, value = 0) {
if (typeof value !== "function") {
return Array.from({ length: rows }, () =>
Array.from({ length: cols }, () => value),
);
}
return Array.from({ length: rows }, (_, i) =>
Array.from({ length: cols }, (_, j) => value(i, j)),
);
}
>>
>>103493347
im looking at making a dumb media server in golang but the idea is that i want to encrypt everything on server, what material should i read to learn more about encryption thingis?
what i want to do is

>every file on disk is encrypted with a master key/password
>when user client requests media, file is decrypted on server and re-encrypted with a client-media-session key on the fly, so even if it is a bad actor client, it can only decrypt the single media it requested, it should not be possible to decrypt anything else with that key.

what encryption standard should i look at for the files on the server?
the only thing i know for sure is that for the client-media-session keys im kinda stuck using AES-128, since that is the only one supported in hls standard.
>>
>>103558623
The typeguard is simply not correct. What if I provide (a,b,c) => a+b+c as value parameter? That's a function. So we use the second return, right? But you cannot call this "value" with just two params.
>>
>>103559491
I guess you are correct, but the problem was that ts can't use typeof function as a type guard for some reason. This works:
/**
* @template T
* @param {number} rows
* @param {number} cols
* @param {T | ((i: number, j: number) => T)} value
* @returns {T[][]}
*/
export function getMatrix(rows, cols, value) {
if (value instanceof Function) {
return Array.from({ length: rows }, (_, i) =>
Array.from({ length: cols }, (_, j) => value(i, j)),
);
}
return Array.from({ length: rows }, () => Array(cols).fill(value));
}

But I still don't know how to implement a default argument.
>>
>>103551696
<>
{[...Array(8)].map((_, i) => (
<div key={i}>{i}</div>
))}
</>

Is just a handier way to write
React.createElement(
React.Fragment,
{},
[...Array(8)].map((_, i) => React.createElement("div", { key: i }, i)),
);


The point of JSX is to be transparently transpilable into plain js.
>>
>>103559724
>was that ts can't use typeof function as a type guard for some reason
Yes, it can! If you try to do value() within the typeof === check, you will see that your IDE does not like that, because it knows that value is not a function at that point. Therefore the IDE also knows that after the if block, value IS a function. typeof is perfectly fine.

The actual problem is that you are simply not narrowing anything down with the typecheck except for making sure that value is a function after it. But that does not mean, that you can call it *that way*! typeof ... == "function" makes absolutely no implication about the parameters that a function takes, but you want to call value with exactly two number params. Because of the T generic, a function that has more, none other params IS a valid T but also a function, so the code does not get typeguarded and you get an error at runtime.

As for the "getMatrix" version:
This does *not* work. "Function" is class in JS. A specific constructor. You are checking FOR ONE specific thing here and it is not what you think. "value()" will create a new Function object.

And sure it does at runtime. If you run
getMatrix(2, 2, function abc(a,b,c) { return a+b+c }
that returns [[NaN,NaN],[NaN],[NaN]] - because the typecheck takes the second path and therefore it fails at runtime, without an error...
 @param {T | ((i: number, j: number) => T)} value

Seems to imply that if you provide anything that is not (i:number,j:number) => T is still valid AS T, but then the return type of (i:number,j:number) => becomes this type, too, so that is another problem.


Typing dynamic languages after the fact is a bitch.
>>
File: .png (170 KB, 1901x846)
170 KB
170 KB PNG
>>103558623
https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#param-and-returns

two ways to have optional params, adding an equals sign or square brackets
>>
>>103560429
Yeah, looks like it doesn't work for generic types.
>>
>>103559950
yeah, I know that it's "just JS", but it is unnecessarily verbose especially in cases like this.
Why stick with plain JS syntax for templating though, but then allow this mixing of HTML as function outputs.

Not even touching on the points of reactivity opt-ins and -outs and inefficiencies of the React approach of just re-rendering everything by default.
I think Reacts approach is fundamentally flawed and makes a lot of things worse, just so they can claim that it's plain JS (which in the end it makes it neither plain JS, nor normal HTML)
>>
>>103560429
That is not the problem that anon is facing. JSDoc can handle default params that are only defined in the function signature pretty well. The problem is the fact that a default param implies that the actual value is "undefined". Because of anons generic typing with T, the value of that becomes "undefined | (i:number, j:number) => undefined)" - providing a default of "0" clashes with this.

It's the generic typing itself that is the problem at this point, because the whole {T | (i:number, j:number) => T} thing simply does not make that much sense in the first place. At first it seems to do, because it matches with our expectation of what we want to return. But it totally does not anymore if you consider that T=string implies (i,j) => string, too. A generic WILL show its behavior everywhere, even if that cannot happen at runtime.
>>
>>103551072
PHP has some really good good potential. it stuck in a web applet and similar, low significant SAPIs. im flexing its console/terminal ability. Python for example started as CLI and gained much more attention to this day because of that. also i uncorked it to windows 7, because modern PHPs, like 8.3 and up became a bit troonified
>>
>>103560302
Pretty weird that instanceOf Function and typeof === "function" behave differently here:
https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABMAjAHgCoD4AUBDALkQwB9EccBKAXiw0ssQG8AoRRGYcgQhygE8ADgFM4XPImpTEAIlCRYCGQ0QAnYVBCqkeFgHo9AASgBnALTCAHiOgXVquKrZqNWnVX17239gD0A-CwAvizy0PBIwABMmLiExGQUNHQqrOycPPgcYCZQeJCiXABi4OEIKuqa2oi67JVuNR4GPt4BwaGlipEAzPhEYCAAtgBGwqokSbSIAyNjDGkcXDi8AiJiNZLScp0Ryoz11bUuVe6Uni1+gSFhXcgALH3TQ6Pjk1hPs6rzzhnLWTA5PIFdYlBQRCquQ7OA6nc4XNrXHYIZAAVlijwAopYIAAbEAAE2EmAANIhQWUwO9ElRJO96IwFr8VkJChspNRZDddhCTjVPMZzFYbFA7A4nHVIbDmvCrh0wcjgAA2dHxLG4glEjCk8ldKnkGlTenMH5LXgSAG5fIQVk68H7SV8iW8vBNLwy4JAA
Also I understand that T can be some function at it will break my code at runtime, but this is not ts's reasoning. As you can see, Exclude Function still doesn't work here.
>>
>>103558623
new anon here

Does a generic type even fit in with those requirements?
Shouldn't the return always be of type number[][], like this?
export function createMatrix(
rows: number,
cols: number,
value: number | ((_: number, __: number) => number)
): number[][] {
if (typeof value !== "function") {
return Array.from({ length: rows }, () =>
Array.from({ length: cols }, () => value))
}
return Array.from({ length: rows }, (_, i) =>
Array.from({ length: cols }, (__, j) => value(i, j)))
}
>>
>>103560481
I do agree they could add a new tag for loops like <> for fragments, but calling it "fundamentally flawed and making a lot of things worse" is a bit of stretch. Do you have any other problems with JSX other than having verbose loops?
>>
File: 1716642538704183.jpg (41 KB, 509x720)
41 KB
41 KB JPG
>>103560633
I admittedly was mixing the way reactivity works and JSX in my critique there.
Reactivity is an area where I think that React does not offer a great developer experience. React isn't what I use daily, but from what I gathered you basically have to take care of rendering optimizations yourself and consider where to use useMemo, while I expect a frontend framework to take care of that by itself.

With JSX I just don't like the way it ends up looking.
The "for n" rendering is an extreme example, but even with an "arr.map()" it's still verbose.
Overall I feel that JSX appears very cluttered and fragmented when I read it.
Having ternaries that insert full HTML or using the && operator as an if-statement makes the code look very different from anything you'd normally expect. (and if you ever have an else-if scenario, this will likely just compound)

Since you can use anything that JS allows you to, instead of the frameworks templating encouraging a specific way, I'd imagine that it also leads to more varied JSX styles between projects and developers, which may make it much harder to read and get into other peoples React components.

And don't get me wrong. I am not a hater, but just stating my observations.
I am happy that everyone can use their framework of choice.
>>
>>103558623
I also tried to set two type variables, one extending union of all primitives (creating a matrix of references to one object is useless anyway) and the other is something a function returns, but it fucks up return type.
So this >>103559724 while not correct, works the best.
>>
>>103561007
I wish js would allow to use code blocks as an expression, it would fix the ternary and && abuse issue.
>>
You have an endpoint, "/items", it returns all items just as a JSON list of objects.
You need an endpoint to search items, it also returns items as a JSON list of objects, but their structure is different.
What path would you choose for the search endpoint?
>>
>>103561150
maybe use the same endpoint but with optional query strings?
/items?myFilter=beepboop&after=someTimestamp
>>
>>103561259
/items -> [{ "some": "field" }]
/items?myFilter=beepboop -> [{ "haha": "get screwed" }]
That would be jarring.
>>
>>103561150
yeah >>103561259 is the only sane way to do it
>>
File: 1719866251977594.png (14 KB, 224x227)
14 KB
14 KB PNG
>>103561007
>Reactivity is an area where I think that React does not offer a great developer experience.
I partially agree, even the React team agrees because they're making a compiler so you don't need to juggle useMemo and useCallback usage anymore
>Having ternaries that insert full HTML or using the && operator as an if-statement makes the code look very different from anything you'd normally expect
>normally expect
This is subjective. I assume you're vue-first user. Appending elements together looks fine from a view of vanilla or jQuery user. And HTML would be stored right in JS too most of the time.
>You can use anything that JS allows you to, [...] which may make it much harder to read
I work on a Vue project and the code there is terrible. Bad coders will write bad code. Opinionated frameworks just give you a bit more time until shit code gains critical mass.
>>
File: json.png (31 KB, 684x251)
31 KB
31 KB PNG
Lol
>>
Enough defending, here's a couple of JSX benefits
>Can comment HTML attributes
<div class="myClass" {/*disabled=true*/}></div>

Vue and svelte can cope by renaming to non-existant attribute
>Can define multiple components in a file
Some people don't like it, I do. Svelte 5.0 has snippets but they don't have behavior
>>
>>103561885
>>Can define multiple components in a file
Why would you do that
>>
>>103562518
Components that don't need to be exported. Mostly used for list elements or some conditional render wankery
>>
MOAR code snippets, less faggotry
>>
like for example, can anyone that has used it in PROD q;^), explain the real world functionality of the proxy pattern?
>>
>>103563615
console.log('hello world');
>>
>>103564365
ebin
>>
>>103564365
>>
File: 1727066671722233.jpg (100 KB, 1280x720)
100 KB
100 KB JPG
>>103564365
Look at those subtle single quotes. The tasteful thinness of them. Oh my god, it even has a semi-colon
>>
>>103564838
clearly a top tier programmer, 300K starting just writing vanilla CSS
>>
File: j4zu24q28n7e1.jpg (238 KB, 1220x1675)
238 KB
238 KB JPG
>>
>>103565069
w h e w
>>
>>103533959
bump
>>
>>103533959
got the pasta for you my lad, hope it helps


/*design*/
https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886

/*desing inspiration web*/
https://dribbble.com/
https://www.uplabs.com/
https://www.behance.net/
http://www.goodweb.design/
https://onepagelove.com/
https://www.awwwards.com/
https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886
https://codepen.io/nicolaspavlotsky/full/ZJPXgy
https://hype4.academy/articles/design/glassmorphism-in-user-interfaces

/* fonts */
https://fontpair.co/

/* design theory */
https://www.ibm.com/design/language/illustration/flat-style/design/
https://www.ibm.com/design/language/
>>
What does /wdg/ listen to while webshitting?
I feel like this song helps me write CSS: https://www.youtube.com/watch?v=LksjZWQWoqY
>>
>>103565803
For me it's this

https://www.youtube.com/watch?v=jGDXjY8ARLY
>>
>>103565803
"deep roots reggae" on yt, on very low volume, that shit has helped me tons to cope with grinding, working, etc.
>>
>>103551072
Yes, been using Laravel for a number of years now. Not really using it for front end work (using react/astro/next.js) but more as an API server, emailer, queue runner (using AWS SQS), and scheduled cron job runner.
>>
>>103565992
>emailer
nta, how does laravel emailing works in almost 2025? that shit mindfucked me big time, when I tried to find a way years ago
>>
>>103566674

Using Laravel kind of necessitates that you use their CLI scaffolding commands, e.g.:

php artisan make:mail MyEmail --markdown=mail.my-email


and to email it:

$user = User::find(1);

Mail::to($user)->send(new MyEmail());


and to preview it:

Route::get('/email', function () {
return new MyEmail();
});
>>
>>103567060
damn, that's simple as fuck, was it that easy 5 years ago or so?
>>
>>103565803
https://www.youtube.com/watch?v=82dmO9l6nNU
>>
>>103544577
Sorry for the super slow response: I don't think the website that I particularly have in mind is Wordpress at all, though it does use some analytics sites (fullstory, google analytics, etc). I haven't tried parsing the huge stylesheets to see what exactly they are in charge of.
>>
>>103565803
Soma FM. Usually listen to Drone Zone, recently tried cliqhop idm and it's great
>>
To all the frens in the thread, How feasible is it to master html, css, and JavaScript in one month while mastering a framework in the second month? I am looking at the op links and the plethora of info for css docs/tricks/info and it looks incredulously long, that’s besides the fact that JavaScript is even more loaded. Would like a realistic timeframe for someone with nothing better to do, free 24/7 with the exception of sleeping ofc.

Help desk background, very little programming knowledge. I know I’ll have to learn a real language eventually for backend
>>
>>103570726
>to master ... in one month
if you think that you can master anything except for the most absolute trivial shit in one month, you have not mastered not being dumb yet.
>>
>>103570726
You might be able to master html/css in a month but you won’t master javascript in one month unless you’re already experienced in another language. I’d say 3-4 months to become proficient in all 3 and another 3-4 months to become proficient in a framework. Mastery will take longer.
>>
For those of you with jobs outside of FAANG, what was your interviews like?
>>
>>103571737
>>For those of you with jobs outside of FAANG
>basically everyone.
>>what was your interviews like?
>Yo, u liek them coding?
>yes
>we actually do not and that's why our stuff sucks and quality is non-existent, can u cope with that?
>yes
>here you go
>>
>>103571737
went for a beer with a issashiburi friend and turned out he has a company and i'm out of a job.
>>
>>103507992
God, I hate the new logo. It looks like a bent thumb.
>>
File: 20241219_171539.jpg (414 KB, 1080x1212)
414 KB
414 KB JPG
Redpill me on state management libraries in react. If I dont have fast moving/fast updates on a state that is being consumed by alot of nested components, do I really need a state manager? Sure the ShadowDOM gets updated but its not like the entire actual DOM will be changed(isnt that the expensive part of re rendering?). Idk ni/g/er bros I feel like web devs see a shiny package for react and then they insist on using it on everything. (Picrel for attention)
>>
>>103516473
8 is shaping up to be really good with the mostly-done auth and the new tutorials
I don’t like or hate Ruby but I’m slowly becoming a fan
>>
>>103527728
Probably not
You should profile first, but I’d worry about slow selectors first
>>
>>103529477
You misspelled “query”
>>
>>103572195
>If I dont have fast moving/fast updates on a state that is being consumed by alot of nested components, do I really need a state manager?

you're right, you don't. a lot of state management shit is pure bloat and leads to states that are difficult to reproduce in case you run in to errors.

here's a pro tip that makes js-only shitters seethe: your URL is a great source of state: you have paths, query strings, and fragments. Utilise URLs correctly and most of your state management needs vanish.
>>
>>103543038
>SQLite instead of Redis
DHH, the Rails guy, is a fan of doing this in general now that m.2 SSDs are just that fast
You’d need to benchmark though
>>
>>103554850
https://32bit.cafe/cyowebsite/ will help
You can do this
It’ll just be ugly for a while
But you can make it better
>>
>>103554850
2 approaches, 1 full static
Maintain a website html index of links to books
2, back end mode
Have a db with entries that represent book instances
fetch from the db and print a paginated version of the list, this will allow you to search hy title, category, author, etc. But the level of complexity is way bigger than the first approach

So my advice would be, start with approach one, once you have that sorted out, work in v2.0
>>
who else shitting on paid time? I fucking love taking a big shit in the morning and technically getting paid for it
>>
>>103567060
I'm guessing this still does require an email server, aka 3rd party service most of the times, correct? what are the options there?
>>
>>103572497
don't you have an email on your hosting server?
>>
File: 849v4dmqoq7e1.png (908 KB, 1080x1350)
908 KB
908 KB PNG
>>
>>103572597
I guess that was the issue all along, it was on local with no server
>>
>>103572650
lels, but there's a place for epic deeds, just kill a rich and powerful man, doing the world a favor
>>
>>103572735
you can have it work locally, depends on your setup. you can also intercept emails with mailhog, mailpit etc
>>
>>103572764
interesting, do the docs cover this? if not, any worthy resource covering this?
>>
>>103573029
you mean laravel docs? sure
https://laravel.com/docs/11.x/mail#mail-and-local-development
if you use sail, i think it sets up all the containers for you
>>
>>103572479
twice!
>>
>>103571737
Couldn't recognize a pattern so far. Every company completely does its own thing when it comes to interviews.
Interviewing with some HR filter woman is almost always a disaster. The best ones are usually when you can talk to someone who is also actively involved in the day to day dev work.
And a lot of it comes down to personal chemistry. The one I got a job offer from most recently said multiple times, that they really like my calm and soothing voice.
(I think it helps a lot, if you go into the interview with some decent equipment and not some $5 shit microphone. Also make sure your lighting is okay and your background looks nice. Yeah, I know, should be obvious.)

Weirdest interview I had was with a company that's a state subsidiary and the interviewer suddenly started asking all kinds of personal questions like what my hobbies are, what my family situation and relationship status is, what book I have read most recently.
Didn't really take a good turn from there, since I'm single, used to be a long-term NEET in the past (and hence a bit awkward in some situations still now) and told him that I didn't want to talk about what I read since it reveals too much personal details about someone.

That was the only time though. Most other companies just want to know what you worked on in the past in other jobs, and if you can package that in an interesting way then that trumps basically any other details.
>>
>>103573288
good to see things are solid in laradocs nowadays
>>
>>103571737
I got the job for:
1. being disabled/schizo
2. btfoing the rest of the "bootcamp" of disabled people hard
>>
>>103572650
I hate Jira so damn much you wouldn't believe.
There was no other thing that killed productivity in the same way.
>>
>>103571737
>how the tech interview went
>we yse this and this and that
>next round
>hey I tried this and this and that and I made it werk
>oh nice that's good
>whut bout mobile first?
>it's done this and that way
>what about accessibility ad seo
>this and that
>do live demo on running google lighthouse and making sense of reports
apparently there was another dude that BTFOd me at everything but since I did research the meme buzzwords they mentioned me then I got the job, the other dude seemed to be "overqualified" aka not needing an internship role with minimum pay
>>
How's the industry doing lads? Is it still 99% vacancies for seniors? 900 jeets applying for every role? Laqueesha and Jessica fiddling on figma balls for 5k p/m with a degree in gender studies while you eat ramen noodles and argue about the best distro and js library on anime boards?
>>
>>103573294
>what my family situation and relationship status is
ye that's illegal in most reasonable countries
>>
>>103573381
go for a company that has a product that prints money, you'll find epic faggotry but good pay as well
>>
>>103573294
>and told him that I didn't want to talk about what I read since it reveals too much personal details about someone.
basically you're telling him you just finisged reading mein campf, be less socially retarded anon, wake up, we're trying to get mony for a living here
>>
>>103572650
fighting an enemy actually worth fighting against has never been easier or more necessary, and as recent events have shown you will even be applauded by your peers if you do it.
>>
>>103573641
now mention the name of which specific political movement was born from this practice, pro tip , just a few hundred years ago
>>
>>103572251
Based retard storing user auth in query params
>>
>>103573800
nta, who said you can't combine query parameters with back end checks? if you do business logic in the front ur cooked
>>
Tips to learn java?
>>
>>
>>103574875
java is easy, and even enjoyable. Spring is where shit gets weird.
>how
Follow a programming course on github or gitlab or wherever that targets java and follow it. Idk if cs50 has one for java specifically for example.
>>
>>103574895
*puts bullshit googles on*
>you get the watered down version for free, for the real deal, pay up, poorfag
are my bullshit googles lying to me?
>>
>>103574948
>>
>>103573709
Maccabeanism
>>
>>103574948
you forgot to mention that they're training copilot on your code without paying you anything for it
>>
>>103575060
3 jewish 5 me
>>
>>103575087
it's the other way around, my code is being trained by foolish seniors that fell for the github meem
>>
>>103572650
Nobody's stopping you from dying for Israel right now.
>>
File: 1719169015160062.png (274 KB, 600x600)
274 KB
274 KB PNG
>>103574932
thanks anon, i've found one that looks good, any aditional info about the graphical aspect? I've seen everyones shiting on that part of java
>>
>>103574932
Your thought on https://dev.java/learn/?
Most guides online still teach Java 8. This one isn't pajeet written (mostly), has a lot of content and uses modern java 20
>>
>>103574895
Thanks MSFT, AI slop is just what I wanted for Christmas
>>
I am having trouble choosing a solution on authentication for angular.
There is also no easy or comprehensive to learn solution for it recommended by angular's main page.

Can you guys and gals please help me choose one?

Since I started my retraining as an it specialist I have been losing my mind on just writing comprehensive powershell scripts to automate my todos away at work.
>>
>>103574635
I don't get what you mean
>>
>>103576289
You WILL review the pull request.
You WILL enter the discussion why the code can't be merged like that.
You WILL argue with other developers who are not approving your code and posting their AI snippets instead.
>>
>>103576351
oh wow, someone actually using Angular.
But on the topic, isn't all auth kinda independent from your frontend framework?
What exact step are you stuck at. Do you just wonder what provider to choose or what the best auth library might be?
>>
>>103576404
Generally just test out some library or something that has a good angular section for me to start with.
I already was able to connect and deploy a working backend-frontend solution with C# and sqlite and angular.
Stopped it when I got and still get really caught up with my studies.

Just something to dip my toes into by following it and then read into the nitty gritty when I am able to catch a break or something.
>>
>>103575520
I used a graphical library for java once, while learning, top lmao experience, throwing deprecated errors on loop while the UI was lagging like 3 seconds on interaction. but to be fair that was my only time with java + GUI
Spring just, well it looks ridiculously complicated for me, esoteric even. But take my advice with a grain of salt, since I know the basics and a bit more about java and close to nothing about spring.
>>
>>103576610
what about the Auth0 Angular SDK?
>>
>>103556131
clojure
>>
>>103572096
>>103573294
I’ve never had a job in tech, and my last job was over 10 years ago. I have practical skills in web dev though, it’s been a hobby for the majority of my life. I could answer most questions like when to use array vs set vs map etc. and what is a closure, higher order functions etc. I’ve deployed vpses, proxied shit with nginx etc. I also have a knack for design. I’m fairly certain I could build something like bigcartel.com 90% on my own and could explain how. However I seriously doubt myself when it comes to answering ds & algorithm questions on the spot without being able to google my way through it and I’m not confident more studying would help. I am a high functioning retard. Basically what I’m wondering is how cooked am I? Do I stand a chance?
>>
>>103577124
leetcode style or algorithm problems have never been part of any interview or test-challenge I ever had.
The thing they wanted to see is that I can write a minimal example application and produce components and styles in such a way that it's not unmaintainable spaghetti, but actually decent to read through.
Basically that you aren't just doing "import solution from solution.js" (even though you may in prod, but write as much as you can yourself when demonstrating skills), that you don't just copypaste AI code you don't actually understand, and I guess that your stuff is reasonably modern and you are not floating elements left and right suddenly or ignoring modern syntax when you could use it.
Just my impressions.
>>
New Thread
>>103577339
>>103577339



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.