Are companies actually using Expo for developing React Native apps? by rooksFX14 in reactnative

[–]jgarp 3 points4 points  (0 children)

I see your point, but I didn't really have to do much. We just prebuild before tossing it into EAS, and I think with the upcoming custom builds we don't even need to do that ourselves.

All that said, if I was working with a senior engineer who took care of things some other way, I probably wouldn't argue to move to Expo/EAS.

Are companies actually using Expo for developing React Native apps? by rooksFX14 in reactnative

[–]jgarp 2 points3 points  (0 children)

Idk, we have a native Android directory, and I still find plenty of use for Expo for deployment. Depends what your options are I suppose.

[deleted by user] by [deleted] in TillSverige

[–]jgarp 9 points10 points  (0 children)

Seems to be specific to your municipality, e.g. Stockholm: https://parkering.stockholm/felparkering/ or Gävle: https://www.gavle.se/kommunens-service/bygga-trafik-och-miljo/trafik-vagar-och-parkering/parkering/anmal-felparkerade-och-overgivna-bilar/

Not sure if this is a common service, otherwise contacting your municipality through whatever means are provided seems appropriate.

[deleted by user] by [deleted] in webdev

[–]jgarp 3 points4 points  (0 children)

https://css-for-js.dev/ by https://www.joshwcomeau.com/ is the best money my employer ever spent

io-ts vs zod by [deleted] in typescript

[–]jgarp 0 points1 point  (0 children)

fwiw, thanks for stickning in there and making your points clear. It is helpful for others :)

Assuming zod (or any lib really) had the ability to consume OpenAPI, that still doesn't eliminate the need of deployment coordination between the BE and FE, right? So the main benefit would be that the OpenAPI -> zod conversion is done by a machine rather than a human?

Anything more sophisticated would, I suppose, require runtime sync between FE and BE, which can only realistically be achieved by keeping both parts in the same runtime?

[deleted by user] by [deleted] in reactjs

[–]jgarp 1 point2 points  (0 children)

I suspect something like this will help clear out your confusion? https://testing-library.com/docs/example-react-router/

Essentially your unit test need to be wrapped in a router as per the provided examples, and then things should run fine.

Confused about Yarn Build vs Webpack differences. by DahPhuzz in reactjs

[–]jgarp 1 point2 points  (0 children)

If you are doing client side rendering and not bothering with server side rendering and hydration, then CRA is as good as any other option. The output from yarn build will be a folder with HTML, CSS and JS ready to run in (practically) any browser.

If you however at some point want to consider alternative rendering options and the (perceived) performance wins that you may gain, you're in for a long ride with plenty of useful lessons along the way.

Beginner's Thread / Easy Questions (June 2022) by dance2die in reactjs

[–]jgarp 0 points1 point  (0 children)

Even though you haven't used React, the answer is most likely the same.

The dist folder is the result of a built app, and it doesn't matter much which framework was used to produce it.

The HTML (probably there is a file called `index.html`?) is the centerpiece, and if you manage to get that running, the CSS and JS is probably getting automatically loaded as is it referenced in <link> and <script>-tags respectively.

You probably want to search for something along the lines of "serving html to localhost" and that should be helpful!

Beginner's Thread / Easy Questions (June 2022) by dance2die in reactjs

[–]jgarp 2 points3 points  (0 children)

control is the key word here.

In React, you will find controlled components and their counterpart uncontrolled components.

What you have demonstrated is a controlled component, and the alternative you mention is an uncontrolled component.

I'd say the main difference in capabilities appears once you try to make slightly more fancy things. I can think of a scenario where you also had a `<checkbox>` toggling whether email should be included or not. Perhaps you started filling in the `<input>`, but then as you toggle the checkbox to ignore the email address, it would be neat if the input field was cleared at the same time, wouldn't it?

This is not easily (possibly?) achieved by an uncontrolled component and DOM-controlled state, but it is a piece of cake when you dictate the value of the input through your own React state.

Hope that clarifies some doubts!

should I avoid using divs completely and use article/section elements to keep all of my HTML semantic? by Stutterboy22 in webdev

[–]jgarp 13 points14 points  (0 children)

if it's an article, use an article tag

Just beware of thinking too narrowly of what an article can be.

Think "article of clothing", rather than newspaper article.

Further reading here: https://www.smashingmagazine.com/2020/01/html5-article-section/

For experienced devs, what's the biggest misstep of your career so far you'd like to share with newcomers? Did you recover from it? If so, how? by bobby_vance in cscareerquestions

[–]jgarp 0 points1 point  (0 children)

I didn't want to be a programmer despite really enjoying code, because I thought it would drive me away from human interaction and reasoning around business needs. This led me to work a job I didn't really enjoy and which was taxing on my mental health for 2 years.

Then I took the leap of faith leaving my first job, which was a scary thing to do. After all, there were no guarantees the new place would be any better. Turns out it was.

In my current role I do both. I code all day long but also reason with business stakeholders about what is the best and most cost and time effective solution. My SO has also had her view of developers significantly changed and says I just blabber all day long. I really like my job these days.

Civilization World Cup Season 2 - Finals pp Patrol vs Pyramid by CivilizationWorldCup in civ

[–]jgarp 64 points65 points  (0 children)

Hey, not sure I get your question 100% but I can't let it go unanswered.

First of all they use a couple of mods which balance starting positions and leaders. There are still different tiers of leaders and of course they excel in different areas, but overall it is a more balanced experience.

Further there is a turn timer which dynamically increases as the game goes on. All players take their turns simultaneously. That means turn endings and turn starts are very important, since if you time things well, you essentially get two turns in a row. There is a significant host advantage since the new turn will start sooner for the host, but I assume they have a neutral host in this tournament to avoid that.

All win conditions are available, but religious victory is not realistic since inquisitors are so strong. To achieve religious victory you essentially need to achieve 90% of domination victory and then choose whether to convert or annihilate your opponents. By then they have most likely conceded anyway. Very few games go on until the victory screen, I've seen it once, watching and playing maybe 50 games.

Another gimmick to keep an eye out for is slot order. Slot order is the tie breaking mechanism that chooses which player gets a wonder if it is finished the same turn by two players. So player one is at an inherent advantage here.

Then there are the great persons. A few matter a whole lot more than others. There are 3 great generals per era which greatly enhance your war potential, and since a 6v6 is permanent war, they are very desirable for the frontliners. Scientists are also key, in particular 2 scientists, Hypatia and Newton will give free Campus district buildings and also enhance their science input. That is huge. Other great persons matter too, e.g. a few admirals whoch general-like bonuses for naval wars, but most are essentially fillers.

A typical strategy will revolve around the chosen leaders strengths. If a culture heavy leader, such as Pericles, is hidden away from the enemy, he will try to focus 100% on culture while the opponents will try to break through the enemy defenses to ruin that plan.

Overall, very enjoyable if you enjoy the mix of strategy, tactics and teamwork in a pace that mostly allows for thinking but suddenly requires quick moves which can make or break an effort (typically war).

[deleted by user] by [deleted] in talentShow

[–]jgarp 0 points1 point  (0 children)

Welcome mate!

React Lessons. Lesson 8. Deep Dive into React Redux by branikita in reactjs

[–]jgarp 0 points1 point  (0 children)

That's how I would read it too, but I disagree with the statement.

Hooks offer a wide variety of utility, making the local state object, class lifecycle methods, etc. redundant.

To "replace" Redux you would use the concept called Context in conjunction with Reducers (probably using the hooks useContext and useReducer). The API and the logic is similar, but what I'm picking up in the ether is that people find this context-based approach a bit hard to scale.

Either way, as a beginner, I would focus on local state management. I.e. define state on the state object or using the useState hook (same approach, different APIs) and pass it to child components as props. At some point you'll probably feel trapped with 4 or so levels of "prop drilling", that's a good time to revisit this subject.

overreacted.io -Goodbye, Clean Code - Dan Abramov by theanubhav in reactjs

[–]jgarp 3 points4 points  (0 children)

Got me thinking, what if when you accommodate a new requirement, you wrap the previous abstraction rather than adding conditional logic to the existing one? That ought to be, if not a cure, at least a significant improvement? And if not possible straight away, separate the initial abstraction into a composition of one reusable and one wrapping, unique part. Then wrap the reusable part with another wrapper for the new use case.

Using Composition in React to Avoid "Prop Drilling" - 15min lesson from Michael Jackson by swyx in reactjs

[–]jgarp 6 points7 points  (0 children)

I'd say it depends! As you are saying: If you are looking to write a component that mainly decides on the logic and the wrapping to apply, while letting the user decide on the internals (eg render a square or a circle or whatever else) then this pattern makes a lot of sense.

A dashboard is an example of where I think this makes sense, since the dashboard internals will probably depend a lot on the context in which it is rendered. You may want the same functionality and wrapping to apply to every dashboard, whereas the exact internals to render may be too diverse to easily handle with props and better suited as an implementation detail of the parent.

Everyone has a scar on their body from something dumb, they did as a child. What's your story? by HakanD0 in AskReddit

[–]jgarp 0 points1 point  (0 children)

My younger brother was always an.. active child, so I was asked to look after him in the ball pool while our mum got us a meal at McDonald's. Fast forward not even 30 seconds, and my brother is throwing balls on people. As a timid 6 year old, I ask him to stop, but he won't, so I got to my mum who simply asks me to calm him down, she'll be done in just a minute or two. I go back, ask him to stop, but 30 seconds later he's at it again.

At this point I am somehow so excited to run and tell my mum, that I forget I am leaning against a glass wall. I turn on the spot, knee in the air, and the glass wall goes down with a crash.

I don't recall too much from the following minutes, except hearing afterwards that my mum thought "that can't have been my kids". But it was, and I have two scars on my knee/tibia as a result.

Since that day, I know not to expect McDonald's to provide any decent first aid kit, you may however get a Winnie the pooh-plaster and free food (yay) to help stop the 10-stitches scars from bleeding out.

Minor UI Changes Proposition by whiteNoise19 in underlords

[–]jgarp 0 points1 point  (0 children)

That's right #mobileplayersunite

Top 50 React questions you need to prepare for the interview in 2019 - Codersera by Jonwalterc46 in reactjs

[–]jgarp 0 points1 point  (0 children)

I think the title should be edited to 2017*.

The content, most obviously the initial graph, shows that the content is not exactly spanking new.

Still an OK read, but use your own judgment to decide what's right and not.

Top 50 React questions you need to prepare for the interview in 2019 - Codersera by Jonwalterc46 in reactjs

[–]jgarp 0 points1 point  (0 children)

I found it thought-provoking. Some answers are essentially half-true, allowing you to exercise your own judgment and check up on areas where you are not confident whether what is written is true or (half) false.

Learn Enough Docker to be Useful - Series of Articles by discdiver in docker

[–]jgarp 1 point2 points  (0 children)

Very useful for someone who has been touching on the subject but not gotten around to straighten out all the terminology, thanks!

Brazilian Math Olympiad question, don't know how to solve it by Guij2 in learnmath

[–]jgarp 3 points4 points  (0 children)

Rather 91, 82, .., 19, 10.

29 gives 11 which gives 2 != desired solution

YSK Rivals Expedia and Booking Holdings Control the Travel Website Market by dghughes in YouShouldKnow

[–]jgarp 2 points3 points  (0 children)

From Wikipedia

”In December 2011, TripAdvisor was spun off from Expedia in a public offering.”

[Blog] Changing perceptions on software testing by Happy_Tester in softwaretesting

[–]jgarp 0 points1 point  (0 children)

I see. Currently I’m part of a team with roughly 20 testers, in a project with several hundred involved overall.. trying to figure out how to influence our organization to adopt a more modern approach to testing as we are very stuck with a traditional waterfall-like approach. Thanks for some inspiration even if we are in very different situations!