[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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: Web_browsers--v1704981784.jpg (126 KB, 1920x1080)
126 KB
126 KB JPG
>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 (go to the "See also" section for other Mozilla approved tutorials, like The Odin Project)
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://flexboxfroggy.com/ and https://cssgridgarden.com/ - Learn flex and grid in CSS

>Resources for backend languages
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

>Staying up to date
https://cooperpress.com/publications/ - Several weekly newsletters for different subjects you can subscribe to

>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: >>102172122
>>
business idea: pc only websites which kill your battery life + overheat your phone on purpose
>>
>>102255881
But why? I want many people to use my websites, even if they choose an inferior browsing device

People should be able to use my sites while they're taking a shit.
>>
>>102255881
only if that feature is geofenced around india/asia
>>
>>102255881
We already have that: It's called JavaScript frameworks.
>>
>>102255881
We have this already, it's called ads
>>
>>102256932
>he doesn't use an ad blocker
Why
>>
https://lo-th.github.io/phy/docs/index.html#manual/Installation

I don't suppose anyone else here could try getting this to work? I followed to a T and it just says engine not found no matter what engine I use. I want to use Havok engine :(

Pic unrelated, it's the Ford f150
>>
>>102256991
I won't help you but that's a cool truck
>>
>>102257016
Thanks I saved a bunch of pictures of the Ford f150 so when I reply to people they have something to look at. All men enjoy big trucks and no one cares what women enjoy.
>>
>>102256991
well did ya try installing the engines?
>>
>>102255797
>intentionally block every single browser that doesnt have chrome user agent
'em
>>
>>102257172
I assumed they came with the library, but now that you say it like that it seems like I should definitely try that. That's a good idea. Shame it's my bed time, I really want to play with Havok physics in the browser.
>>
>>102257359
i think they assume it exists in your local system, that would be my guess anyway. good luck ford guy
>>
>page 8
It's over
>page 1
We're back
>>
>>102258363
we should be contributing to jQuery, to make a new golden era of vanilla js happen again, but here we are installing trillions of npm dependencies
>>
FUCK SSR
>>
>>102259050
SSR is good for many things. But don't use Next because it's bloat.
>>
>>102259075
What are you using? I just feel repulsed by next atm I want to try something else
>>
>>102259050
yes indeed they are ultra rares so you have to spend a lot of money to pull one
>>
>>102259216
nta, but every back end can print html, which is ssr
>>
>>102259050
When do you even get to use it? Especially the nextJS one, it's neutered server-side rendering.
>>
>>102259050
Why are you concerning yourself with shitdev meme fads? They constantly come and go, pick something and stick with it instead of chasing wokie trends.
>>
>>102261035
>SSR is a meme fad
...
>>
>>102255881
We already have that: It's called web design.
>>
>>102261195
SSR is a meme - at least in the context of frontend javascript frameworks.
Meanwhile for all the normal people "SSR" is actually called cgi or php.
>>
>>102261752
I like remix but the others suck.
>>
>>102259216
>Next.js
In 2024 even our web frameworks are transgender
>>
>>102261752
>php
Disgusting
>>
>>102262685
>>102261752
I would love php if the language itself wasn’t such a mudball with the ugly syntax, naming inconsistencies, the incorporation of OOP, etc. The simplicity of the core idea though is great and I wish there was a modern equivalent that learned from its mistakes.
>>
where the fuck is /dpt/
why is my beloved board dying so fucking rapidly?
>>
>>102263398
Out of all the 20+ languages I have used I have never needed to install a separate package to print hello world.
>>
>>102261752
>normal people "SSR" is actually called cgi or php.
Literally every single backend language can do SSR out of the gate. Learn your industry you dumb JS zoomer.
>>
Fellas, I need a hosting alternative to Render. It doesn't support IPv6 and it is giving me a hard time to use along with Supabase.

What other options are out there? I am looking into fly.io, but looks quite expensive
>>
>>102263720
```// server.mjs
import { createServer } from 'node:http';

const server = createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World!\n');
});

// starts a simple http server locally on port 3000
server.listen(3000, '127.0.0.1', () => {
console.log('Listening on 127.0.0.1:3000');
});

// run with `node server.mjs`
```
You don’t need express. Also a lot of the “baked in” functionality of php like pro are packages that are just installed by default on most hosts.
>>
>>102263816
You can bitch as long as you want, that still does not make javascript (or any javascript dialect like ts or jsx or whatever subdialect of jsx next is using these days) into a viable backend language. I'd rather go back to perl than adopt the hot mess that is a "fullstack" reactive javascript framework
>>
>>102264240
>that still does not make javascript (or any javascript dialect like ts or jsx or whatever subdialect of jsx next is using these days) into a viable backend language.
Never came close to implying that's true, because you're right
>>
bump for the Sirs
>>
I'm trying to choose a frontend to use with Django ORM & api views to make a niche social site with extra functionalities.
I would like it to be usable with javascript blocked but have a nicer ux when it's allowed.
Do you think svelte(kit) will work for this if I supply html alternatives to javascript for user inputs via method overrides?

Or I could just use full stack django with something like alpine.js and make a separate API if I do a mobile app later, but that seems less clean and will possibly be more work.

Any suggestions?
>>
Anyone have any kino no-js personal web type sites for inspo? Looking to make my personal website aesthetic, but I can’t find many that are CSS only
>>
Do you really need a German address for a .de? Really want one but you need extra shit?
>>
>>102266100
Just depends on the level of JS interactivity you want for your site. Use sveltekit/next.js or whatever if you intend to make a dynamic site, with Django or whatever python backend as your API. Otherwise if it's simple like a marketing site then you may just want to go full Django.
>>
SAME ORIGIN POLICY CAN LICK MY NUTS WHICH ONE OF YOU WEBSHIT FUCKS IMPLEMENTED THIS CHASTITY CAGE MASQUERADING AS A PRTOCOL FUCK YOU
>>
>>102267572
Just turn it off in your browser if it's bothering you.
>>
>2M users but no money in the bank
Common railstard L
https://exercism.org/blog/september-2024-restructure
>>
Ajajajaj
https://x.com/t3dotgg/status/1831900775095922763
>>
>>102267989
hallmark of a jr dev is to care about synthetic benchmarks like this lmao
it rarely matters what backend lang you use because I/O is going to be the major bottleneck
>>
What's your best tips for keeping the types between frontend and your backend in sync?
I use Typescript on the front and back side, and I was planning to use a monorepo and import the types from a shared sub project or something like that.
>>
I've been doing web dev for ~20 years now, but only been in the business professionally for like 4 years. Yes, I am in fact employed (if that statement actually means anything to you).

Absolutely everything in web dev feels like a gigantic hack and mess to me. I fail to see the usefulness of 90% of all "solutions" that get adopted/thrown at at a code base when tackling a problem.
This is a shitshow. And influencers like >>102267989 are making everything worse for everybody.
>>
DO NOT REDEEM THE SYNTHETIC SARS
https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Ruby/rails
>>
>>102264183
>You don’t need express
By that logic you don't need Node, or even C, because you can write your entire server in machine code
>>
>>102269164
Rails was made by a Danish guy, not an Indian guy
>>
Page 9 Sirs
>>
>>102268993
Anon, just about everything in software development is a gigantic hack. Occasionally people come up with fresh simplified takes which end up being popular, but the trend on generic platforms has mostly been "innovate" first, fix up the "bloat" later on.

We try to kid ourselves that following formulated design patterns and project management techniques is going to be the winning formula, but the simple fact is hype and marketing are what end up winning. And thats because devs are only human so they succumb to such shallow carrots on strings.
Even the trend of chasing lean and mean "lightweight" solutions ends up being supremely dumb because you almost always need to add a hell of a lot more bloat (you know, the stuff they omitted to make the benchmark look good) in order to get a functional product.

We're doomed and it's great.
>>
>>102270807
I have done embedded before. Shit was not even close to being such a mess. I also did lots of Java and while that certainly varied in quality depending on the team, it generally was not as much of a clusterfuck either.
>>
>>102270778
Thank you for rescuing the thread
>>
>the lead dev of GORM, an ORM for Go, is Chinese
Welp, that's another project I can't use
>>
>>102270829
Both embedded and java are comparatively boring and more consolidated, which exponentially decreases the chance they end up being a mess.
I think also it doesn't help theres been a perfect storm of javascript being terrible and web frameworks being slow that have led to all these bizarre alternative frameworks and platforms springing up hoping to solve everything and simplify and reduce costs. And they never get everything right.
>>
Go > Java/C#
>>
I made a website in Vue that I was happy with and then I put it on top of a Wordpress site, so using WP dashboard, but the Vue links. However, if I do it like that, WP is useless, I can't use its post and page editors and the traffic statistics only point to the front page (even if you navigate through the pages, to Wordpress it is as if you never left the front page).

So I tried something different, I created the pages in WP normally, and then loaded only the Vue app I made inside of the pages. It works, but now it takes too long to load each page and the Vue routes are useless.

Is there a way to properly combine the two?
>>
File: Benchmarks.png (132 KB, 1783x1212)
132 KB
132 KB PNG
Go bros we got too cocky!
>>
>>102273665
Ah great, another artificial benchmark so I can feel happy about bottlenecking the "framework" with even worse code on top of it.
>>
I want to use a VPS on Digital Ocean but I would like to destroy the instance when I am not using it to save money. Is there a way to backup the entire VPS and reupload it when needed?
>>
im shit and new. I do not want to host on vercel in case i screw something up and get a bill so i want to be safe

What are some hosting options where if I screw up i dont care and only stand to lose a small amount of money? I dont mind paying monthly and I don't want to host on my local machine. thanks
>>
>>102273665
So you tell me that there is basically no difference between any of these?
>>
>>102273665
Nobody ever claimed that Go is the fastest language

The point of Go is that you get nearly all the performance of something like C, but you also get garbage collection and an easier language than C.

There's that quote from Rob Pike saying that one of the design goals of Go was to make it easy to use.
>>
so can I just rename my js files to ts and it will continue to function as it was and I can incrementally sprinkle in ts features a little at a time or will shit break right away?
>>
>>102277359
Give it a go, see what happens
>>
>>102278037
That sounds like a threat
>>
>>102278314
You better believe it is, or else
>>
2/3 of this page is just blank space. I fucking hate modern web design.
>>
ok boys, absolute retard here, take a look at my userscript

// ==UserScript==
// @name Unnamed Script 132716
// @version 1
// @include video website
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @grant none
// ==/UserScript==

var badDivs = $("span.value:contains('0')");
badDivs.parent().parent().parent().remove();


now how can I check if span.value is not a '0' string but a value, say <100?
>>
>>102278718
at least the margins aren't filled with ads and autoplay videos.

Multi-column layout would be nice in theory. Are they actually usable these days? I remember looking at css multicolumn a decade ago and there were all sorts of weird caveats.
>>
File: ads.png (2.12 MB, 3840x1994)
2.12 MB
2.12 MB PNG
>>102278821
This is what it looks like with Ublock disabled.
>>
>>102278732
What are you trying to do?
Chances are your script is doing more than what you want. By using "contains('0')" you're selecting any span that has a 0 anywhere in its inner text.
>>
>>102272913
The usual way to do this is to build a single page app that fetches data from the wordpress API. That will still throw out any wordpress analytics or plugins because you're just using it as a data storage device.

If all that wordpress stuff is important to you then you need to put it in charge of running the page. You can get the speed by doing partial pageloads in Vue, but for just that function it's overkill. Either use HTMX or write the load/history code yourself, it's like 20 lines or so. Have your WP Theme check for the header to render full page/fragment and its analytics should work.

>>102278732
Just don't do it in CSS and iterate over all items to check in JS?

>>102278821
It's way, way better with flexbox and grid now. We still do them at my company, but now some sites are designed only for mobile and nothing else.
>>
>>102278932
hide the div of videos <100 span value (views)

>>102278939
$(".thumb-container").each(function(i) {
var test = $(this);
alert(test)
});

alright boss I'm iterating
trying to figure out how to access this.span.value now, my JS syntax understanding is abysmal
>>
>>102278988
I got the $(this).html() now I could search into it as a string and parse it into a value, like a savage that doesn't know how to jquery into a defined object
>>
>>102278988
Honestly, I've completely forgotten how the jQuery syntax works because I've been using document.querySelectorAll for years. But I think if test is your span then it should just be test.value, or test.getAttribute('value');
>>
>>102279119
brothers I have chosen the dirty path and it works
$(".thumb-container").each(function(i) {
var vid = $(this).text();
var test = vid.replaceAll(' ', '');
test = test.replace(/^\s*\n/gm, "")
test = test.replace(/\d\d:\d\d\n\S+\n\S+\n/gm, "")
if (test > 100){
alert(test+" oy vey")
}
});

I do not know jQuery magic, I only know regex
>>
>>102278939
>flexbox and grid now
I'm specifically thinking of https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_multicol_layout , i.e. where inline stuff flows into the next column instead of down the page. I know flexbox and grid are actually usable now for when you want stuff in specific columns, but it still seems the sort of flowing multicolumn is really really rare, even when you have the horizontal space to do it.

I'm guessing that it's really weird to think about scrolling multicolumn stuff when you have too much stuff for one page; you can in theory scroll horizontally, or flip between pages, but both are awkward.
>>
>>102279426
I've never encountered that in my 8 years in the job. Most designers I work with struggle comprehending that a page title might have a linebreak somewhere in the 200.000 product names it can display, so I'd say multi-column text is truly dead.

Most designs I've encountere go single column mobile version -> single column desktop version, but with tiny sidebar.
Development goes just desktop version, then management calls my company two days after the page went life to save their asses.
>>
bump
>>
I FUCKING HATE THE JS ECOSYSTEM
FUCK THIS SHIT AND FUCK EVERYONE INVOLVED IN IT
FUCKING NIGGER SHIT
>>
when is it even smart to use mongodb? I'm trying it now on a real project, and while doing the schemas might be faster, fetching the data and populating shit is really really fucking annoying. Especially when you are trying to referencing different tables
>>
>>102280275
this but it's actually cracker shit
stop blaming my brothas for the shit YOUR limp-wristed people did
>>
>>102262685
it's not 2009 anymore PHP is pretty decent now. But if you don't like it replace with go+templ, Python+jinja2, C#+razorpages, etc. anon's point is this shit is nothing new and frontendtards reinvented the wheel in a 10x more complicated way for no reason
>>
>>102255797
I ran my websocket server on ec2 and it said it ran out of memory. What do i do get a bigger instance? I’m using free tier
>>
>>102281633
are you using micro or nano instances? anyhow, you probably want to play around with this CLI option: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
>>
What’s your value proposition when pitching a website to a business that is looking for one?
>>
>>102281921
very simple. convince them they will make more money with your website
>>
>>102281684
I’m using t2 micro
>>
>>102274631
>What are some hosting options where if I screw up i dont care and only stand to lose a small amount of money?
Use any of the rent a VPS (Virtual Private Server) services. You rent a VM and setup everything yourself. It is not that hard, but a little overwhelming in the beginning.

This will cost you around 5$ per month. It is a fixed fee, so no surprises.

Just read the Digital Ocean guides on how to setup Nginx and Let's encrypt.

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04

Cheap VPS providers
Contabo
Vultr
Digital Ocean
And more...
>>
>>102277359
>so can I just rename my js files to ts and it will continue to function as it was and I can incrementally sprinkle in ts features a little at a time or will shit break right away?
Depends on your TS config, but yes. If there are any issues it should happen during compilation.
One thing that can happen is that your JS files are not properly imported and you get a runtime error, so just make sure the production build runs and test the various paths just to be extra safe.

You can configure the Typescript compiler to allow JS files as well if you don't know. And then incrementally change the files to TS as you work on them.
>>
>>102255797
I miss old Opera. New Gamer Chopera is lame.
>>
>>102281633
>I ran my websocket server on ec2 and it said it ran out of memory.
Setup swap memory. It is disabled by default on EC2 Ubuntu. For some reason, my instances became unresponsive if they used too much memory. Swap fixed the issue.
>What do i do get a bigger instance? I’m using free tier
You can't get a larger instance if you want to keep it free.
>>
>>102279426
No, can do, Bob: https://bugzilla.mozilla.org/show_bug.cgi?id=549114
>>
test scrape + post
>>
I hate web dev so much it's unreal.
>>
>>102286028
Web dev isn't responsible for the moron writing those commit messages
>>
I wish Go had try/catch so I don't have to write this cursed shit all the time

if err != nil {
log.Fatal(err)
}
>>
say you want to have a site that saves millions of user-uploaded files. is it enough to have a database that stores the hash of a file and its relevant metadata (uploader id, slug filename, date added, etc.), and a fileserver that saves each file in a directory based on a mask of its hash (e.g. `cat.jpg` has an md5 of `f21cb2d2f8e62e38453fab019fa8f79f`, it would be stored as `/data/f/2/f21cb2d2f8e62e38453fab019fa8f79f.png`)? i understand that filesystems have limitations on filecount in directories, but ive never really read about the subject of saving obscene amounts of files so im not sure how someone would go about doing this themselves. ofc this is assuming i dont want to use something s3 or the like.
>>
>>102286192
oh, also, there has tp be software that already does this; what terms would i search for this?
>>
>>102286208
Generally the practice nowadays is to have a S3-compatible API for the I/O.

For OSS, you'd probably want to look at these two options:

https://github.com/minio/minio
https://github.com/seaweedfs/seaweedfs
>>
>>102286600
nta, but what's the deal with s3, why not just upload files to a filesystem, is it about the volume of files being uploaded and hosted? What's the comparisson with previous non s3 approach?
>>
>>102286600
thanks, seems like its a mature problem with mature solutions. do you know of any books/pdfs/ articles that might expand on this? i like wikipedia, but its definitely not exhaustive and its sources are usually lacking.

>>102286813
i assume companies like s3 because its easily expensible and has support baked into its cost, as well as an obscene amount of engineering behind it, making its re liability expected and "insured".
>>
File: 1712190286572812.png (235 KB, 1000x1000)
235 KB
235 KB PNG
https://jsfiddle.net/3da4tgeh/

This prints
"aa","bb","bb","dd"
on most devices.
Except on most android phones, regardless of browser, where it prints
"aa","bb","bb","cc"


FUCKING WHY it's like it ignores bindAttribLocation
>>
>>102287187
Uh, you're glsl precisions? You've left them on device defaults.
>>
>>102287187
maybe try setting explicit location ids in the shader?
>>
>>102287249
it's unrelated to precisions
but nvm I just figured out, it's an unspecified behavior they left out in webgl2, spooky shit, ain't it.
bindAttribLocation makes you need to relink the program afterwards according to GLES3 specs.
ANGLE and WebKits validation layers don't catch this, leading to discrepancy between devices.

>>102287276
I specifically didn't want to do that
>>
File: 1724567127679518.png (67 KB, 528x197)
67 KB
67 KB PNG
>>102287286
thanks google
>>
>>102287187
You making a browser game or something?
>>
>>102287297
Why futz with locations and hoping the order is correct when you can just get the auto assigned ones?
>>
File: the other half.png (83 KB, 865x600)
83 KB
83 KB PNG
>>102287324
cont.
>>
>>102287319
yeah i wrote a typed abstraction layer to automatically assign texture units, check texture formats/dimensions at compile type, and attribute location based on how vertex buffers are combined to provide all attributes required by a shader.

>>102287324
>hoping the order is correct
It's not, it's supposed to use bindAttribLocation based on some other generated code because shader code shouldn't have to dictate where your attributes are, array objects do.
>>
I just use fixed location ids in my projects, then I don't have to write >>102287357
>>
File: nextjs.jpg (4 KB, 250x249)
4 KB
4 KB JPG
breaks the internet
>>
>>102269450
framework hater btfo
>>
>>102273665
Someone in this thread should write a back-end in Nim
>>
>>102282253
>very simple. convince them they will make more money with your website
What if they want you to measure that? That sounds like a Legal landmine to navigate ur you’re ensuring more money because of a new website. Kind of difficult to measure that with in person purchases
>>
>>102288420
>next
Why
>>
Did some work on my Go app today

What about you guys?
>>
>>102255797
Sorry if this is the wrong place to ask my question.
I'm not too familiar with 4chan outside of a few specific boards.
I currently have a long list of dynamic rules for ublock origin and I was wondering, would it be safe to globally noop certain 3rd party requests such as cloudflare, cloudfront, fastly, gstatic, googleapis, jsdelivr, jquery and jwpcdn.
I see these everywhere and don't want to redundantly noop them for each and evey site.
Again sorry if this is the wrong board/thread.
>>
>>102290725
Learn to business. You show metrics like visits, seo score, speed score, ect. You'll do a search on them your self before you offer your services tho, because they have to have a decent product that actually sells.
>>
>>102291717
I know where you should ask your question: lycos.com
>>
>>102291831
Isn't this just a common search engine and are you just trying to troll?
>>
>>102291855
>Isn't this just a common search engine
Yes it is!
>>
>>102291486
Added an entire major feature. No matter how much I get done I feel like I haven't made enough progress. It's very close to done, though.
>>
>>102291486
Finally figured out how to make a character controller work in Cannon. The secret was to remove all friction from the world and doing it myself on each tick.
There's still some odd bouncing where corners touch, but hopefully having more refined geometry gets rid of those.

>>102290725
Obviously you can't give them numerical targets, some random outsider doesn't even have the insight in their business to do so. You need to show them the way, not the result

>custom website feels more premium, attracting higher-value customers
>pre-empt support and fruitless sales talks by providing customers information
>far better experience for introverts(like us rich tech guys)
>more visibility(google maps and co. are not reliable)
>just having an old date on those facebook posts give the feeling your business is dead, even if all the info is still current
>another way of marketing(very good if store is not in prime location)

And then you add some more stuff that's business specific. There's a reasons businesses order custom 3d software just so that end users have an easier time deciding which tarp fits their pool and whatnot.
>>
bb
>>
I have an API where the user can check if there is data from different dates. Should I return an error JSON response if there is no data for that date or an "empty object" response (keeping the JSON format for when there is data)?

Which one would you prefer if you would use this API?
>>
>>102295515
errors should be explicit, but a query having no results should be an empty object or an array of zero items depending on what your response structure is.
>>
Just watched a livestream of that Theo guy go through using Laravel and all he did was use LLM shit, read through a blog post and take chat suggestions for how to fix his bugs

I swear he's ragebaiting lmao
>>
File: 1723932824990725.png (217 KB, 345x545)
217 KB
217 KB PNG
I've made a upload website that abuses discord for free storage and it's pretty good
>>
>>102297360
refreshing the url args every day must take a while
>>
>>102297395
I only refresh when the file is requested
>>
>>102278939
Thanks for the reply on the Vue + WP thing. Will look into it
>>
>>102297444
still takes a long time to iterate message history async with rate limit if ur doing like 100GB in 25MB chunks
>>
File: movie.png (3 KB, 280x38)
3 KB
3 KB PNG
>>102297841
Definitely wouldn't scale well if I was getting tons of requests a minute, would run into rate limits for sure but it's decent
>>
>>102297970
>paypiggy upload size
>>
>>102298040
What? Also I wonder if using telegram would be better
>>
>>102286813
>nta, but what's the deal with s3, why not just upload files to a filesystem?
It should only be a problem when you have lots and lots of files. You need backup for when things go wrong, and if you have lots of traffic you need to somehow spread/load balance the requests to different storages. Then you also got security etc.

You can implement this yourself, and then make your implementation S3 compatible or not. Or just use some OSS program that have implemented this for you. Only really needed if you plan to scale beyond several harddisk, or want to make money. Everyone knows the S3 API, so it is easy to implement for an company that uses your product.
>>
>>102291486
Working together with a friend on a project and we will meetup today to see what is missing before we will launch the project.
Just a little bit more before we have a MVP.
>>
File: 1695789648117695.gif (423 KB, 498x328)
423 KB
423 KB GIF
hey I'm studying react and let me see if I get this right:
Components can not directly alter the state but they can call methods that do so, right?
So should I make methods for every entry that state keeps track of?
>>
>>102298706
you "can" directly alter state, but you shouldnt because it skips the side effects that the state management methods enact, fucking up the react rendering pipeline
>>
>>102298047
you need nitro to upload to discord in 500MB chunks

or are you merging the 25MB parts dynamically while serving to client?
>>
File: 1425416752222.jpg.png (100 KB, 452x330)
100 KB
100 KB PNG
>>102298777
>>
File: 1683242177025997.png (900 KB, 911x972)
900 KB
900 KB PNG
Starting my new job as a Full-Stack in a month.

Wish me luck.
>>
>>102298706
Replace "can" with "should".
You should use the "useState()" function and other "useX()" functions for handling state and side effects.
These "useX" functions can be called from your components, for example clicking a button to update a counter, then the onClick event should call the function to update the state, probably you would call this update function "setCounter".
Example:
const [counter, setCounter] = useState(0)
>>
>>102298272
cristal clear, thanks for the insight
>>
File: .jpg (298 KB, 719x745)
298 KB
298 KB JPG
what are you developing today, Sirs?
>>
>>102299732
Xenophobia
>>
>>102299732
developing a script to keep this thread from going to page 10 it seems
>>
>>102298840
Merging dynamically, I think I fixed the progress bar as well https://framed-alt-eastern-front.trycloudflare.com/
sample big file at /file/08398516-b3e9-4f84-8fb0-277d25f0b17c
>>
Trying out Elixir with Phoenix right now coming from languages like Java, Golang and JS/TS. When does the confusion stop?
>>
>>102299975
/wdg/ is a family-friendly thread

>>102302395
I've never tried it. Did you just want a challenge?
>>
>>102304523
>Did you just want a challenge?
Seems to be the right tool for the job for a project I'm planning, which involves content streaming.
>>
>>102306017
>content streaming
nta, but that sounds exciting
>>
File: 1581758658902.gif (1.09 MB, 498x340)
1.09 MB
1.09 MB GIF
In react, if a child component has a variable or a method how to I pass it to the parent component?
>>
Just told my boss that the third party solution that we are going to adopt in its newest version (again) sucks ass.
We have been in this project for a year now and we absolutely must write our own thing, because the third party thing is not meant to be customized that heavily.
>Well, that's a shame. How am I supposed to sell this to our customer? Why has nobody told me before?
The answer is of course that I have no fucking clue, mostly because I am getting paid way too little.
>>
File: 1718796431144878.png (247 KB, 512x512)
247 KB
247 KB PNG
>trying to perfectly edit photos with no knowledge of photo editing to get the most optimal OCR reading

Is this a waste of time?
>>
>>102309675
>The answer is of course that I have no fucking clue, mostly because I am getting paid way too little.
That's completely normal, nowadays you're expected to just know everything even when you're min wage. Just keep playing the game until you've skilled up for the next job.

The sad truth is that this mess happened because your boss sold stuff no one in the company really understood, but you can't tell that to them. Not realizing that sooner is on you, again you're supposed to know everything, past, present and future. Distract him with some plan to catch this stuff earlier in the future.

As for your customer:
>Feature X requires going out of the standard of 3rd party software
>this will break our abillity to upgrade in the future and that's a massive security issue
>also expect additional maintenance cost of $bullshitnumbner
>we've asked 3rd party to add our requirements and they want $bignumber
>alternatively, we could roll our own custom thing for $much smaller number
And then you let them decide. Make sure to get some legal stuff signed if they decide to go with an unsecure solution.

>>102309776
Yes. Coders cost more than graphics guys, so your boss will get mad at you for doing it, even if it's just 5 minutes.
>>
>>102309776
things you can use, graphically:
. levels
. curves
. contrast
>>
File: frfr.png (4 KB, 348x34)
4 KB
4 KB PNG
>>
I might do it lads, I might ask for my old job back

For the moment it makes sense for a few reasons

Then I can move onto something else, potentially, in the future
>>
>>102311472
good luck
>>
alright, so in next js I am banning users. Would it be smart for me to write a rust thingie that runs a task every minute to the backend to check if the ban is already gone or is there a smarter way to do this?

just not trying to rely on external service
>>
>>102308484
Parent components should be passing through props.
Antipattern: through refs (useImperativeHandle)
>>
>>102308484
pass methods to the child
if there is more complicated variable or a function, you might wanna use useContext. You pass that from a parent to any of the clients you want to provide that value. Usually you do that in main
>>
File: terry.jpg (110 KB, 1080x957)
110 KB
110 KB JPG
>>102255797
What is the least niggerliscous tech stack for a small website with Stripe elements integration?
I need a home page and a donations page.
It seems like node/express.js is Stripe's default for backend?
Also are there any good resources for trying to understand backend programming? I swear the webdev ecosystem is the most incomprehensible clusterfuck in the history of computing.

t. brainlet graphics programmer
>>
>>102313225
if you want something, possibly minimal but new. You might opt for htmx and go
>>
File: 1590685642175.png (45 KB, 300x250)
45 KB
45 KB PNG
>>102312446
>>102312517
I understand but I feel my parent component is getting bloated.
>>
>>102313385
then restructure it or use context. If it isnt like many hundred lines, (I say around 200 lines of code is not that much and is optimal but not strict) then I wouldnt worry about it
>>
>>102313415
as long as its readable and manageable then no reason to change the component anyway
>>
Asking here because you might use typescript
Let's say I have a type
export type a = "b" | "c";

Then I want to define either an enum or a const object like this:
export const myConst: Record<a, a> = {
b: "b",
c: "c"
}

Then I can use the constants of a specific type in my program, without having loose strings hanging around. But it seems kinda stupid to make a const object like this and have it map directly from the same type to the same type. Is there a better way?
>>
>>102315931

TypeScript has enums, but it's kind of discouraged to use. Instead you should probably implement it like the following:

export const MyEnum = {
b: "b",
c: "c",
} as const;

export type MyEnum = keyof typeof MyEnum
>>
>>102316507

And for the object values you can use this, if it differs:

export type MyEnumValue = (typeof MyEnum)[keyof typeof MyEnum]
>>
>>102313225
>I swear the webdev ecosystem is the most incomprehensible clusterfuck in the history of computing.
What's so difficult and incomprehensible?

If you want documentation, find the most popular backend framework/library for your language of choice and read the documentation for that thing.

Normally you need to know and handle
- Routes
Routes a URL path + HTTP method to a controller
- Controllers
Handles the request and response. Usually does little except validate the user input and calls the relevant services to process the data for this route and returns the result.
- Services
The business logic usually goes here. Controllers and optionally other services calls/uses the services to do the things.

Those are the main building blocks.

My pro tip is to ask ChatGPT on how to get started.
>>
>>102308484
>>102313385
>In react, if a child component has a variable or a method how to I pass it to the parent component?
I use a state library like Jotai.
Then any component can modify the state and it will be globally set and available. Then there is no trouble to pass the state to or from a child/parent component. Just change it wherever and use the value wherever.
Jotai is easy to use, it is more or less like useState, except now the value is global.

I prefer this over useContext.
>>
File: POOPROGRAMMER.png (1.13 MB, 1009x1048)
1.13 MB
1.13 MB PNG
web-dev, a job so easy that a junior Poopesh can do it



[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.