Professional Documents
Culture Documents
[Post a Reply]
08/21/20 New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17 New trial board added: /bant/ - International/Random
10/04/16 /vip/ - Very Important Posts
[Hide] [Show All]
Janitor acceptance emails will be sent out over the coming weeks. Make sure to check your
spam box!
:: 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
Although it only had one reply (from OP), and was deleted after 5 minutes, and it doesn't exist in 4chan's
archive.
>>92023007
Yeah, I was about to reply right
as it 404'd.
>>92023007
>>92023054
I deleted it because there is already a thread, albeit a shit one >>92021537 →
>>92023253
Yeah, but the idiot put the topic title in the post name, so it's not searchable by /wdg/.
Use this thread instead.
>>92023097
What language did you write the backend with?
>>92023491
I'm assuming he just used useState, maybe useReducer and did everything on the frontend.
Say I have some node scripts nested somewhere, how do I make em create files in the root directory?
Using stuff like "./name" or just "name" will create file in the directory from which I am running node but
that isn't universal
>>92023615
Bingo.
My fucking sides
>>92024021
I'd like to own a cafe. One of those dark places with barely any customers because I
don't like noise nor people. Maybe one day when I'll be old
>>92024197
Maybe in your ESL country that's a sustainable business model, but in most of the Western world you'll be
broke.
>>92024229
>your ESL country
You say that as if it was a bad thing
How to dynamically render an element and set its width to parent element width?
Is there a way without declaring new variables?
>>92024285
No need to be so hard on yourself man, english is great
>>92024355
Fix your fucking margins you dumb cunt, half the body of the page is dead space. <3
>>92024355
Last time an anon posted an altchan it was flooded by a scat spammer angry at OP for having a loli
board. Hope you won't upset anyone
>>92024371
I added ban tools on my side to stop that.
>>92024361
The replies are actually smaller on margin.
>>92024397
What are you gonna do with my IP now that I clicked on it?
>>92022875 (OP)
kek 10/10 OP, full stack chads raise
up!
>> Anonymous 03/11/23(Sat)11:17:25 No.92024436 ▶
>>92024407
I should actually add IP tracking again so I can add my old auth system back in. I have oauth now so
people don't create new accounts when they get banned.
>>92024397
> picrel
Google was trying to sell its search engine/indexer around that time. For several years following, they
were almost constantly on the verge of bankruptcy. The business model espoused in that picture was not
sustainable.
>>92024355
kill yourself
>>92022875 (OP)
Nice gun. Anyone know the make/model?
Why is webdev all about introducing and replacing framework X with Y every three months or something?
>>92025112
React is the most popular and widely used framework for 10 years, mate
>>92024290
width:100%
>>92025376
I guess so, but somehow whenever I take a look in this godforbidden place that is called /wdg/ it seems
like you people change (and shill) frameworks like you (should) change your underwear. Daily.
>look at this, it totally solves problem X
[a few minutes later]
>we've got this new anti pattern problem thing, we need a new framework/language/feature to solve this
[cycle repeats]
>> Anonymous 03/11/23(Sat)12:38:29 No.92025498 ▶ >>92025913
>>92025376
Just like jQuery used to be. React is showing its age, + it's made and maintained by indians
>>92023615
>serialize the entire client side state as a .json
>send it to the server as it is
>server saves it as a plain text in a bucket
>the next time the client is logged, server sends that .json back
GraphQL was a good attempt at allowing the client to determine exactly what data it needs to receiver. We
should take the next step and allow the client to completely define the database itself and make the server
just host the raw data. I'm going to call this BlobStore.
>>92025112
the only thing that stops all other software from being reinvented all the time is other things being built on
top of it, making it harder to change without breaking something important.
webdev is close enough to the top that nothing really "important" depends on it remaining the same
>>92025577
but there still has got to be some motivation for this. I cannot be the egos of just some devs, because
even they should get tired by this nonsense.
>>92025498
Care to explain how react is showing its age?
>>92025112
why are you blatantly lying? Are you that desperate for attention?
>>92025112
more like implementing project with X and then maintaining it while project X decides to have three major
updates and hundreds of breaking changes throughout a single year
>>92025954
How am I lying? This general always makes it seem like this is what is up. Use react? Replace with some
unknown shit like alpine or svelte. Use bootstrap? Replace with tailwind. Replace with tailwind with
bulma... Use rails? Replace with django. But replace django with express really quick because the snake
is le shitty amiright.
>>92025990
True, which is why in the real world only the major stuff gets used in the first place.
>>92025913
>Care to explain how react is showing its age?
The constant addition of "new features" which are just workarounds for circumventing design limitations
should be a hint
Should my scss files be somewhere like /src rather than /styles or /css ?
>>92026117
Which features do you mean? What design limitations are they hinting at? How are they handled better in
new frameworks? These are legitimate questions, I have no clue about this stuff but googling it is like
entering a black hole. Information won't come out.
>>92025596
just type what you wrote in google and press enter
>>92025596
leetcode, hackerrank
WHY NOW
>>92026180
Redux is an example. A react-based website needs a makeshift message passing mechanism to have basic
functionality.
>>92024015
top kek
>>92026176
bunch of anons here have recommended planetscale, haven't used it myself tho
>>92026421
You can't code for one second without it. You will be exposed by your boss soon.
>>92026421
I'm at that part of the project where I have to make sure everything is responsive and I
am hating every single second of it
>>92026767
i feel you brother. i used bootstrap but it was still not easy for me (brainlet)
>>92026767
I always start with this
@media (min-width: 1024px) {
html {
font-size: 150%;
}
}
>> Anonymous 03/11/23(Sat)14:27:25 No.92027167 ▶ >>92027313 >>92028755 >>92032783 >>92041973
>>92026767
Nobody builds their own responsive design. Use existing libraries like bootstrap, material ui, etc....
>>92026176
Heres how you nigger rig it.
Make a google spreadsheet and send post data to fill in cells with and also retrieve.
I did it for my portfolio site with email responses and notifies.
Its janky but works.
>>92026659
>You can't code for one second without it. You will be exposed by your boss soon.
Without stackoverflow development around the world would slow down for sure
>>92027167
>Nobody builds their own responsive design. Use existing libraries like bootstrap, material ui, etc...
Work at a start up that uses a mix of angular flex box and tons of custom styles.
Sometimes you got to write it.
>>92027299
this desu
>>92027273
nah thats autistic as fuck im not going that
>>92026176
Just get an ocean droplet and use it to host your site and db. It's like $5
>>92027167
I guess we know who doesn't know how to do responsive design, lol. I don't even do frontend and I know
how to do it.
remember to keep your pipelines flushed or it will bite you when least convenient
background: I've got a web server, outside my control, which creates HTML directory listings if there's no
index.html file in the requested directory. These listings are very bare bones and I'd like to apply some
additional styles etc.
If I can get a service worker registration, then I suppose I should be able to intercept the requests and
inject some style elements into the HTML directory listings.
I would like this to happen automatically, rather than having to specifically direct users to
/enable_pretty_styles.html or something.
>>92022875 (OP)
>MySQL
dropped
So Im working on this database for the like feature. Decided to add a tag system (I
was inspired by how cool databases are).
>page 9
Bump needed
I'm learning Javascript. The code in picrelated works for finding the oldest person in that
list of objects. But why is it that when I put "let one" and "let two" in to the curly brace
sections, rather than at the start, variable "one" ends up not being defined? I fixed the
issue by moving the "let" parts to the top but I don't know what difference it's making.
>>92031707
Why is the cursor confused?
>>92032027
think it looks cool and sovlful
For fellow employed web devs - how much are you getting paid and what are your working conditions?
My first job: $60K/yr, midwest US, fully remote, flexible working hours (it doesn't matter when I work), only
25hrs per week of work need to be logged. So it's a 25-hour work week but ends up being over 30 when
you include talking to clients and figuring out what they want, setting shit up and being able to focus.
I work with React, React Native, PHP, and a shitton of shitty custom WP themes for the smaller projects.
I have about a year of experience now and can do fullstack work completely alone.
Should I look to jump ship soon, or stick with this longer? I want more money but I don't want to work
longer hours. Anything except remote work is no-go for me, I'm not wasting 1-2hrs per day in a fucking car
>>92031707
As soon as I went on it my CPU started melting so I quit the tab
>>92032463
what cpu u got anon?
>>92031702
let and const are block-scoped, which (in simple terms) means they only exist within the block of code
denoted by curly braces
for example:
if (condition) { let foo = 5 }
here foo is only defined within the body of the conditional expression but not outside of it
if you were to use "var" instead, it would work as you originally expected because var is scoped to the
whole function in which it is declared. But you should not be using var in 2023. Try to use const wherever
possible.
In the code you provided, you can use const if you replace the if statement with the ternary operator like
this:
const one = a.yearOfDeath ? a.yearOfDeath - a.yearOfBirth : year - a.yearOfBirth
or even:
const one = (a.yearOfDeath ?? year) - a.yearOfBirth
Lastly, there's no need to sort an array if you only want to find the largest or smallest element. This operation
is O(n) if you iterate over the array only once while keeping the "greatest element so far" in a variable.
Update the variable when you encounter an older person.
What's the conventional way to "skip" variable declaration in a callback function? Say for example you are
looping like this:
>[...something].forEach( (item, index, array) => {} );
and I don't need index, what would you call that variable? There has to be a convention for this right? I
just had a nested loop pick the wrong iterator from the outer one because of the way I generally call my
variables during loops
>>92027167
said like a true coder
>>92032583
Not OP but this is from my mere
t440s. 4300U
>>92032790
works on my machine
i7-4700MQ
>>92032714
the convention is to use underscore as the first character of the name
[].forEach(item, _idx, arr)
of course if you only need "item" then you can just skip the remaining parameters altogether
Had my first round of challenges for a junior role today. I have a question about double precision floating
point in JavaScript. I know there's a hidden bit in the mantissa and I know the smallest distance between
floating point representations is an ULP. Luckily I knew how an ULP and machine epsilon differed in that
it's a constant whereas a ULP is relative (they tried to trick me). My question is moreso about the guard
digits. It was a kind of simple question:
Why does (square root of 2)^2 - 2 not equal 0. So I walked through the process of adding the exponents
and shifting the radix point which in turn increments the exponent. However I was a bit lost on how floating
point actually rounds. I just answered that since the 54 bit was 1 it was rounding upwards and it seemed
correct.
Also does anyone know if the ECMAscript specifies anything about twos complement integer encoding?
>>92032583
Some old Intel laptop chip, I'm on an old laptop at the moment.
Also everything I click on that site doesn't do anything, is that intentional?
>>92033053
Yeah, nothing yet works. Will update tomorrow
>>92032949
ecmascript doesn't have integers, everything is a double
Going through Odin Project now and learning about linting, is there any way to simplify an ESLint install
with custom rules every time for any future project I want to work on? Like automatically make the config
files include prettier, fix syntax on save, etc. I just don't want to edit config files every time it sounds
annoying, and I heard you're not supposed to install ESLint globally.
>>92024435
I cant imagine being a front end dev.
and I love the power that full stack gives me.
I know exactly whats going on (not to say that there are people that I see doing wizard things, but I
understand how they do the wizardry)
>>92026176
Get a vps you cheap fuck
>>92033105
Doesn't IEEE 754 use Two's Complement for subtraction?
:: passable-forum ::
dev:: passable
tools:: Angular, Java/Spring-Boot, Mongo, Node, Grpc, Keycloak, AWS Fargate
link:: https://passableprogrammer.co.uk
repo:: N/A
progress:: It's a forum with the main page similar to 4chan kindaish and threads similar to reddit but with
streamed comments. Free tier expired so gonna take it down probably within a month. Everything gets
auto purged every few days anyway. Mostly half works. Comments can be made anonymously but need
to create an account to post articles/create collections of tags.
I have been doing a Java course for fun on my free time (the one offered by University of Helsinsky), but I
see they also have Full Stack Open.
If I wanted to switch jobs into tech, which should I keep doing? Right now I don't have time for both. I
know Java is very versatile, so I can't go wrong if I finish it, right? I know I'd have to learn frameworks and
such after.
>> Anonymous 03/11/23(Sat)21:55:38 No.92034584 ▶
>>92034548
meant to start with www. well whatever.
Do you guys get the feeling that you have to know so much for something that is ultimately so small. You
put all this work just to make "web-applications". But these webapps are so small in the grand scheme of
things they are just websites that people click and type on.
Is the conventional wisdom that iterators are slower than just filling an array and
looping over that, antiquated?
>Setup
function getNumberArray(maxValue) {
const a = [];
return a;
}
function getNumberIterator(maxValue) {
return {
i: 0,
maxValue,
[Symbol.iterator]() { return this; },
next() {
return { value: this.i, done: ++this.i < this.maxValue };
}
};
}
let dummyCalculation;
const numIterations = 99999;
>Iterator
const iterator = getNumberIterator(numIterations);
for (let val of iterator) {
dummyCalculation = numIterations - val;
}
>Populate Array
const arr = getNumberArray(numIterations);
for (let i = 0, j = arr.length; i < j; i++) {
dummyCalculation = numIterations - arr[i];
}
https://jsben.ch/i5uNy
>>92034672
Yes. The only reason to do this shit is for money which is why I'm so lazy about actually doing it. I could
quite literally go build "apps" for small businesses that would massively increase their bottom line but I'm
just too fucking lazy because my non-tech job is fine and my income is alright so there's no motivation. I
tried to convince myself that because my apps/sites were insanely quick, not-bloated, served a purpose
and looked good that I was somehow making some kind of difference in this shit heap of an online
landscape but it doesn't lol
>> Anonymous 03/11/23(Sat)23:22:15 No.92035604 ▶
>>92034672
Many people have jobs with a small impact. Like someone who works stacking shelves in a supermarket.
Just one supermarket out of the handful in their town; just one town out of thousands in their country; just
one country out of hundreds on the planet.
Web developers (or any software developers) could work on small projects yes, or they could end up
working on products that are used by billions of people across the planet.
>>92035313
>done: ++this.i < this.maxValue
is this bait?
>>92034672
I am small in the grand scheme of things, who cares. I enjoy web development, would enjoy it even more
if I could get paid to do it, but it's not a passion. Caring about doing something important or wanting a
passion is gay and something women think about
>>92032949
Pretty strange question to go that deep into how floating point numbers are calculated. I guess it make
sense for a fresh grad to check if they remember what they learned. Any other frontend interview would
have you make a basic component or something.
In a react project, I have a potentially very long array of similarly structured objects (data from an API), if I
knew a particular field on those objects that I wanted speedy access to, I could obviously preprocess the
array of responses into a hash table keyed on that field.
What if I wanted to do this on any key of the object? The naïve solution is to make a hash table for every
possible key That seems suboptimal spacewise, but it would get the job done timewise. Is there a better
solution I'm not thinking of?
>>92036648
Since you just reference the original objects, you just copy each value one time. So you should just end
up with O(n) for the array + O(n * map objects) or something like that.
Basically just double the size and a bit more depending on how much extra a map object uses.
So it should not be that bad. If you can handle one array, you can probably handle the double the size.
I can't get a job. ~50 applications in and I've only gotten 4 rejections back so far. I
know that's not a lot of applications, I'm aiming for at least 400 by the end of the
month before I consider switching things up.
My main issue is just that I don't meet the experience requirements for any of the
jobs listed. Would it be feasible to apply for internships, or help desk/entry level IT
shit? I'm sure that things will get better after I get a few years of experience in the
tech industry.
>> Anonymous 03/12/23(Sun)01:36:12 No.92037101 ▶
>>92036648
What do you mean by "want speed access to"?
Like you want to get a list of every element of the collection where that key = a certain value? Or you want
to iterate the entire collection and get that value out for each element?
Honestly this sounds like a premature optimization unless you know this is an actual bottleneck. Shit like
iterating a list with 10000 elements takes microseconds on even a pretty slow computer. It'd probably be
faster with a for loop than with .filter() though. What is slow 99% of the time is DOM operations, API calls
or doing actual calculations.
But yeah, you can make an array indexed by the key you want to search on, if you use a string based key
then JS will just make a hash table automatically I'm pretty sure. And yes, it'll trade off space for
performance, but that's the nature of indexes.
React Query looks very appealing - anyone here ever used it? How is it?
>>92030117
not an expert on this by storing an IP address sounds like an issue. maybe generate an ID based on the
IP + something else?
*sighs*
ERROR 1:
In login.classes.php inside the getUser() method, I made two important typos that
will make your code not work. (WHOPS! ty Sentinel Corps for letting me know)
ERROR 2:
As someone pointed out in the comments, using rowCount() to check how many results we get when we
query the database, isn't a method that work in all database types. Instead you should use count() after
you returned the data. Make sure you do it ALL PLACES where you SELECT from the database.
SO INSTEAD OF:
if($stmt->rowCount() == 0) {
$stmt = null;
header("location: login.php?error=usernotfound");
exit();
}
$profileData = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $profileData;
IT SHOULD BE:
$loginData = $stmt->fetchAll(PDO::FETCH_ASSOC);
if(count($loginData ) == 0) {
$stmt = null;
header("location: login.php?error=usernotfound");
exit();
}
return $profileData;
>>92036623
I'm not a grad. Honestly all of my interviews have been pretty challenging. But I guess it's because I'm so
new. I had to do lexical analysis for a dataset and I ended up basically just building a Lexer like you would
for a language. I didn't touch regex tho.
I just want to finish this project, move on, and forget about this mess
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
What are some good books/courses/guides/etc for someone who can do fizzbuzz
and not much else? Resources I've used before have been either too boring and
verbose or too confusing and brief.
>>92040289
ChatGPT going to replace all of us
>>92040295
Yea, but its not happening right NOW
>> Anonymous 03/12/23(Sun)07:05:16 No.92040362 ▶ >>92040761 >>92057215
why bother learning this any further when it's quite unironically over?
>>92026767
same
>>92032949
I dropped out of CS because of this because they bored me to no end with math and
physics before letting me code anything. Is this really what junior web devs have to
go through or was just this company very particular with the hires they wanted?
Honestly scary if you ask me
>>92040710
Only this company thing. Most companies would ask you to do something more directly related to your
web dev job.
>>92040362
get a bullshit average wage frontend job
watch youtube and rice your desktop half of the time
>>92040263
Never mind I got it.
>>92040710
I mean that's pretty basic stuff to know. You'd be surprised how many people don't even know the
difference between unicode encoding formats.
If you can't work with something as basic as numbers then why even try being a programmer?
>>92040721
What kind of challenges did they give you?
>> Anonymous 03/12/23(Sun)07:54:45 No.92040897 ▶ >>92041460
>>92040852
>Why does (square root of 2)^2 - 2 not equal 0
Is very different from
>Why are there different unicode encoding format and which one do I pick if I want X
Maybe it's just dropout cope but I didn't sign up for a math theory class. I just want to find solutions to
problems, that's why I'm into programming
>>92040876
>Here is the Pokemon API
>Write a program that fetches 10 unique pokemons and displays them on a simple webpage. No
duplicate Pokemons.
That was my coding test.
Then during the interview they asked me JS questions and what I did at my previous jobs.
>>92040710
>physics
>cs
wut?
>>92041075
It wasn't as big as math but it was mandatory along with other classes. I think it depends on which
university you pick
>>92040959
Did you have access to google for the coding test or did you have to fly solo?
>>92040959
jeez those are some low standards they have
>>92040897
Floating point errors are very common. 0.1 + 0.2 = 0.30000004. It's basic shit.
>>92041460
When did a problem like this last occur to you?
>>92026767
You don't do testing while building?
>>92041546
When I needed positions of multiple items at once and had to do Arithmetic on them to update their
coordinates. The errors accumulate.
>>92022875 (OP)
I've been called back for a SEO focused webdev position. I try to look as hard as I can, but
every SEO guide out there just says
>Make your website not shit and not irrelevant
>Make it easy to find shit on it, like with a normal site
>Spend 10 minutes to check out keywords and put them on the site, but not as many times to
make it look like a scam from the 90s
>Strike a balance between too vague, and too specific
>Use Google Analytics and Tag Manager
with far far many more words, in usually long-ass vids by pajeets.
>>92033220
I wrote a five-line shell script that makes a .prettierrc.yaml file in the current directory
>>92041677
How long before checkpoints?
>>92041861
Generally when I get sleepy and it's 2am. I don't always follow my own advice
>>92041826
Websites are basically dead. Things like reddit, discord, YouTube and now chatGPT have taken over.
>>92028755
You sound like a faggot. I am not saying you are a faggot. You just do come off like a turbo faggot.
Is the sass npm module alright to use as compiler? Its page reports quite a few
behavioral differences from the ruby compiler (which I assume is the default one)
>> Anonymous 03/12/23(Sun)09:16:03 No.92041973 ▶ >>92042003
>>92027167
retard
>>92041973
Explain why
>>92032251
If you can round trip a form with validation front end and backend. You can be making 100k. People
making less than 100k are retards, jeets, or they have a second job.
>>92024912
Yes.
>>92041114
1 hour, take-home test.
So yes, I could search online.
>>92032251
Continued. Don't jump ship, just take on another job.
>>92041968
The Ruby one is old and busted
Dart is Google’s TypeScript
I’d use the NPM one
>>92042221
Alright I added it to my project. Relying on a vscode plugin was bothering me. I should have done this
from the very beginning. The article about starting a project with sass also made me add a script in my
package.json for ez watch and export of css files where I wanted as opposed to the addon I was using
that did everything in the same folder
"scripts": {
"sass": "node-sass styles/sass/main.scss styles/css/style.css -w"
},
>> Anonymous 03/12/23(Sun)09:52:30 No.92042445 ▶
>>92042003
Because that's only partially true. These libraries help for sure, but I think in majority of cases are not
enough. Eg. we're using React with MUI but still write quite a bit of SCSS.
Lads, I'm a FE dev with 4+ years of experience looking to go fullstack. Let's say I currently make
$100k/year, how much more would I get paid if I go fullstack ? ( I'm thinking Node + GraphQL )
How do you go about actually making a back-end service? I see a lot of tutorials about how to make APIs
but what if I want to take the request of the user and do some heavy processing, that cant be done in an
API right?
I think of APIs as gateways into my system but im having difficulty understanding how I actually make the
"system".
Wut
>>92041111
i'm guessing you also take calculus
>>92043009
Sure you could call external stuff from your backend but if you use a reasonable language/framework
there's really no need to do so, unless what you are doing is very heavy to process. For normal use? Just
use the backend itself.
>>92033220
if you use a framework and start projects with a template you could just customize that template (like
custom create-next-app etc)
>>92041460
no math is required to understand "floating point is inaccurate" which is something you can find in every
single basic programming course
>>92045191
Infra-red
>> Anonymous 03/12/23(Sun)12:54:13 No.92045244 ▶
>>92045191
git?
>>92045191
Burn the code onto minidiscs.
Made a board game in React and I wanted to try and use sockets to make it multiplayer but it's actually
been harder than making the game. I managed to get it where two people could join a game with each
other but because of react's re-rendering bullshit it disconnected both of the users from their room and I've
put in all of that work just to be at square one
>>92045489
This is a learning opportunity.
Why does react re-rendering disconnect users from their room?
>>92045645
it's because I'm using the auto-generated socket id to connect users, so when the state changes to reflect
a room being created it re-renders it, leaving the users from the game.
I just can't be bothered to go back and change everything again
>>92045674
What's the minimum you would need to change to prevent the issue?
>>92045753
well I'd have to persist Id's using something like uuid and cookies which is easy enough, but on the
backend socket.io automatically creates rooms for the auto-generated socket id so I'd have to write a
bunch of code that filters the auto-generated ones, on top of that I already have janky code as it is to
prevent showing users occupied rooms and I don't know whether react's re-rendering would still
automatically break up rooms that were previously connected by users. I guess I'd have to persist the
session somehow
It's been like 2 days of this constant trial and error and i'm just getting really tired of it
>>92045885
i was thinking more like have top level state for being connected, room id, etc. be separated from the child
components rendering the game
>>92046204
Any object inside a useRef is persisted between renders, and changing a "ref" variable doesn't cause a
re-render just FYI.
>page 7
Bump
>>92046990
le only le one le language, but node/express is really modern
>>92046990
Nodejs is actually quite simple to get up-and-running, tons of serverless support, lets you share
components between front and backend, and performs reasonably well. For 95% of jobs that require
building server backends, it's 100% sufficient.
>>92046990
why not?
>>92046990
nobody wants to learn a second language nowadays when you can do everything using js
>>92047041
>>92047052
>>92047109
>>92047122
My god.
So you're telling me that this entire field is
made to entice newfags?
>>92047143
Pretty much, yes
>> Anonymous 03/12/23(Sun)14:46:50 No.92047185 ▶
>>92047143
>always has been
The reason web development blew up in the first place was the proliferation of PHP and MySQL on cheap
VPS in the early 2000's. It allowed javascript-shitters to make "good enough" sites and web apps and is
the reason everything is on the web now. Nodejs was a natural evolution so pajeets had to learn one less
language to destroy. There was actually quite a nice sweetspot in history when webapps were largely
pure JS or simple jQuery and 90% server rendered with a little bit of AJAX when it served functionality,
rather than enabling a client framework to mimic MVC.
Go or ASP.Net core?
>>92047052
60% of the time it works every time
>>92047350
.NET, easy
>>92047352
I've been using it since 2010, and the amount of times I couldn't use it for a production application rounds
to 0. I almost abandoned it because callbacks were frustration-generators but async/await saved the
language.
>>92047423
>.NET, easy
Why? Not disagreeing, but I keep wandering framework to framework and I'm trying to convince myself to
stick with one to actually build something.
>>92046990
Why not?
> JS runtimes like node are much faster than python,php etc because they piggyback of performance
improvements for chrome.
> IO libraries are async by default so you don't have the clusterfuck of different async libraries mixed with
non async
> Ability to reuse type definitions and code between both
> Simpler tooling since you only have to deal with one language
> JS Ecosystem is massive, easy to find libraries for what you want and developers who know the
language
> Server side rendering is easier
> Typescript gives a consistent type system
Really the onus is the other way around. If we already have one language in the project, you should need
to justify adding another.
>>92047458
I've worked in both. I find the tooling around .NET easier to comprehend, I find it has some really nice
mature frameworks (Entity Framework being one), and I find its parallelism to be much easier to manage
and understand. You can also deploy it pretty much anywhere because it runs fine on linux now, and I don't
like Go's error handling.
>>92047496
>I don't like Go's error handling.
I've been looking into Go for a few hours today and this is really fucking annoying and I haven't actually
written anything in it.
>>92047569
Yeah. I get what they were going for, taking the C-ish route. I think it has the beginnings of a good idea,
but in its current form, it's worse than just throwing exceptions.
>>92045191
airdrop
>>92046990
JavaScript is the best, bud
>>92043009
>write function do_something()
>within the /mysite/whatever endpoint definition, call do_something() and return result as JSON in
response body
literally simple as
>>92043009
> heavy processing
Depends what you mean by that.
Usually, you want your API responses to return fast. But that's not always possible, if something complicated
is requested. So you have to make a judgement call.
If you have something heavy to do and you don't want the API response to be slow then your best bet is to
use a queuing library like rabbitMQ etc.
So you have
> API endpoint that creates a "task". This adds a job to the queue and then returns a unique ID for that job.
> API endpoint that queries the job, takes the ID from previous as endpoint and either returns the result, or
returns a "status" that tells you if it is incomplete to failed.
The other alternative is to have some kind of webhook or websocket that "pushes" the result when it is
complete.
Or you can just have a slow API response for some things, but you need to make sure this is properly
documented and make sure you don't have a timeout etc. You also probably don't want to have your UI wait
on the response.
>page 9
Bump
>>92035313
>Is the conventional wisdom that iterators are slower than just filling an array and looping over that,
antiquated?
maybe because the iterator doesn't tell the computer how much memory it needs and it doesn't have to
populate the array afterwards
however iterators are for iterating thought an indeterminate set, using them to gain a small
memory/processing advantage over array at a huge cost of readability in an era of excess memory and
CPU/GPU power, I just can't see the use case unless you're writing shit for NASA and every bit of memory
must be put to the best use possible
and I doubt even NASA have been that anal in a long time
>>92044392
"You don't need Math to explain how Math works".
>>92050651
Welcome to modern webdev, hope you enjoy your stay
>>92050651
Why does this have 4.4k stars?
>>92050651
Idk I'm going back to good old fashion SSR with raw SQL and good CSS transitions. Web apps are a
meme. Servers and modern languages can handle like 5 billion reqs a second ran on the cheapest single
instance VPS... We've all been made for fools
>>92050651
> He used 3 free libraries
Absolutely seething
>>92050651
>FUCKING SIMPLE APPLICATION
Can you give your version of a simple web app version of a hacker news clone? I would like to see how it
should be implemented according to you.
>>92051301
Not him, but I'd personally just do it as a fully server rendered PHP site and use a simple 10-30 line JS for
hiding/showing comment trees.
The page would respond with s-maxage/stale-while-revalidate headers so that pages are cached on
CloudFlare. Lighthouse metrics would be 100.
You could get a little more complex and do it using Astro, it doesn't require any opt in to any UI library like
React/Svelte so you can just do raw JS. it's probably easier to deploy as well with providers like Vercel
and Netlify having full support for running JS on edge functions.
>>92046990
because its works. js sucks but the js ecosystem is great.
>>92052788
jQuery
can i get a non meme answer about if ruby on rails is the future or not?
>> Anonymous 03/12/23(Sun)22:00:38 No.92053591 ▶
File: hand.png (543 KB, 569x726)
>>92053367
>>92053378
Nope lol
>>92051301
Serve the content with a node js backend and use vanilla js for interactions on the frontend.
>>92053378
bruh ruby is dead
Is it possible to make a checkbox (or radio button) have a certain state (checked or not checked)
WITHOUT JAVASCRIPT? `checked` doesn't work; it needs to always be the same when the page is
loaded.
If so, how?
>>92053835
'checked' does exactly this.
>>92054070
No, it is overridden by the user's selection, even when the page is reloaded.
>>92053835
Well duh, you're going to need JS if you're going to do any interactivity. I'm not exactly sure what else
you're expecting. Otherwise you're just limited to what it's initial checked state is, e.g.
>>92052788
easily nextjs
Hey guys, I have a project with webpack which I try to get into production. When webpack builds, I guess
it runs npm install.
>>92054803
Never mind, just threw out the conflicting packages. What a pain lol.
later nerds
>>92022875 (OP)
Everyone share your websites! I don't mind if they are a WIP, I am just curious to see
what everyone is working on!
>>92055104
I am adding, expanding to my website at a rate of i quirky page per day lately. Really
looking forward to keeping it going.
going to spend some time learning webgl and three.js this week
I have a session cookie in my browser and Django session data in the database but there aren't any keys
I set earlier
>>92056943
Forgot to rename the key
>def my_view(request):
> request.session['test'] = 111111
> print(request.session['test']) # 11111
I'm a reducefag
reduce is such a cheat, man
>>92056989
reduce meaning?
>>92032251
Market conditions seem pretty rough now, but even then you should be able to make more jumping ship.
Might even be a good opportunity to get a good deal on some equity before prices bounce back. Take my
advice with a grain of salt though because I live in SV where living on 60k is unimaginable.
>>92057056
Array.prototype.reduce()
>>92057065
all of them are great - filter, map, reduce, some, every
I am learning react and trying to create an old fashioned desktop in the browser. I am having trouble
making a component draggable across the screen. This "process" component is the window in which
individual apps will be rendered in. At the moment I have all of the dragging logic inside this component. I
am keeping track of two states(MouseCoords, OldMouseCoords) and the mouse position (up/down).
Basically Movement is determined by compairing old mousecoords to mousecoords and figuring out
which way the box needs to move, then editing the css style to make it rerender somewhere else.
This feels like a really hacky way to do this, any suggestions? I'll reply with the component
>>92058357
type ProcessProps = {
exitApp: (processID: number) => void;
process: ApplicationProcess;
}
exitApp,
process,
}
) => {
const [MouseCoords, setMouseCoords] = useState({ x: 301, y: 301 });
const [OldMouseCoords, setOldMouseCoords] = useState({ x: 300, y: 300 });
const [BottomLeft, setBottomLeft] = useState({ bottom: 300, left: 300 })
const [mouseDown, setMouseDown] = useState(false);
>>92058357
>>92058377
A somewhat better way for this would be to use "movementX" and "movementY" of the mousemove event
IMO.
But generally speaking your approach is correct.
>>92040710
lol it took me almost 3 hours to solve a leetcode easy question that basically only used for loops & arrays
then, i got to a question that used trees, had no idea how to solve it, looked at the answers, had no idea
what i was looking at, and just gave up on leetcode entirely
i just accepted the fact that i will fail interviews that use leetcode questions
i'm hoping that they ask me work-related questions, or just give me take home projects
i can't be fucked to learn DS&A and git gud at leetcode, when 90% of my work is just fetching APIs and
handling JSON data, or updating CSS colors
i don't care if this makes me stupid, i'm just not wasting time on that shit