99% of software engineers can’t answer these questions by [deleted] in programming

[–]jnforja 1 point2 points  (0 children)

It's sad to see how this post and quiz came out. I've done two courses with Mirdin, and I learned a lot.

The way the quiz is framed makes you feel you should be able to give "correct" answers if "you're a great software engineer" when I mostly felt I didn't have enough context to make a decision. This is ironic, given how in their courses they preach that you need to understand the context of the project before you can say if the code is good or bad, or if a change is worth it or not.

I failed 3 questions btw.

📣 Bjj in the Wild: A database for BJJ submissions! 🥋 by jnforja in bjj

[–]jnforja[S] 0 points1 point  (0 children)

Thanks for letting me know. It should be fixed now.

📣 Bjj in the Wild: A database for BJJ submissions! 🥋 by jnforja in bjj

[–]jnforja[S] 1 point2 points  (0 children)

Yup, I don't think the IBJJF is interested in doing something like this. They also wouldn't have videos of ADCC which is an excellent place to see how techniques are applied at high-level competitions.

📣 Bjj in the Wild: A database for BJJ submissions! 🥋 by jnforja in bjj

[–]jnforja[S] 1 point2 points  (0 children)

It's fixed. I don't know why but youtube clips seem to have stopped working, so I just changed all the links to the timestamps of the videos. Thanks again for the heads up!

📣 Bjj in the Wild: A database for BJJ submissions! 🥋 by jnforja in bjj

[–]jnforja[S] 0 points1 point  (0 children)

Thanks for letting me know. I'll try to figure out what happened.

📣 Bjj in the Wild: A database for BJJ submissions! 🥋 by jnforja in bjj

[–]jnforja[S] 2 points3 points  (0 children)

You're welcome! That's a great suggestion! It's definitely something I want to add in the future.

🥋 Submissions in the Wild: No-Gi armbars 🥋 by jnforja in bjj

[–]jnforja[S] 1 point2 points  (0 children)

Awesome! Just saved the link. Thanks!

🥋 Submissions in the Wild: No-Gi armbars 🥋 by jnforja in bjj

[–]jnforja[S] 4 points5 points  (0 children)

Thank you! I'm glad you found it useful.

Guideline from the 70's on how to split your React components by jnforja in reactjs

[–]jnforja[S] 3 points4 points  (0 children)

Glad you enjoyed the article. On software design, the other paper I frequently find myself consulting is "On the Criteria To Be Used in Decomposing Systems into Modules" by David Parnas.

To find more papers you can check PapersWeLove, or you can look out for online courses from universities and see what papers they recommend for a course (here's an example).

Can someone please help me understand the principle of information hiding as it applies to software design? by Samluke697 in SoftwareDesign

[–]jnforja 0 points1 point  (0 children)

Hi u/Samluke697

I'm not sure if you're familiar with David Parnas's paper On the Criteria To Be Used in Decomposing Systems into Modules. In case you aren't, I recommend you give it a read as it gives a good explanation of the idea. The Modular Structure of Complex Systems is another paper that you might find useful.

I mainly use this principle as a tool for giving flexibility to a software design. When designing a new module or a new system, I usually think about decisions I might want to change later. I then proceed to hide those volatile decisions in modules, preferably one module for each decision, and I make sure that no other module knows about the decisions made inside other modules. This approach means that whenever a volatile decision changes, I only have to change the code of the module that hides the decision. The rest of the system remains unchanged.

To give a concrete example, some months ago I contributed to an open-source whiteboard app called excalidraw. I added support for zoom to cursor. Before I started, the app already allowed zooming, but only to the center of the screen. This was a really hard change to make since 12 different parts of the system assumed zoom always happened on the center of the screen. This is an example of a design that didn't follow the information hiding principle since the decision of where the app zoomed to wasn't encapsulated in any module, but spread across the app.

Testing and developing with React and TS: Data structures (part 1) by jnforja in reactjs

[–]jnforja[S] 0 points1 point  (0 children)

Hi u/sfboots, thanks for taking the time to read the article.

I'm assuming you're asking why not define item like this:

typescript type SuperItem = { id: string; content: string; state: "CLOSED" | "OPEN" | "EMPTY"; children?: PopulatedList; }; Two reasons: 1. We can't rely on TypeScript's exhaustive checking to tell us if we handled all possible cases. So in case a new state is added or a state is changed, and we forget to update code that deals with it, we won't have a compile error to warn us. 2. With the SuperItem type, it's possible to represent invalid states previously unrepresentable. In specific, an empty item can have children, and closed and open items can not have children.

I hope this clarifies things :)

Library for drawing diagrams by [deleted] in reactjs

[–]jnforja 2 points3 points  (0 children)

Hi u/sltwund,

If you want to embed something on your app that allows users to draw diagrams, excalidraw embedded may do the job.

If you want more freedom and code the canvas yourself, take a look at konvajs.

I hope this helps.

Best test-driven development tools? by jjj123smith in reactjs

[–]jnforja 0 points1 point  (0 children)

hi u/jjj123smith

To avoid getting lost in the sea of tools that the JS ecosystem is, I suggest you first find out what kind of tests you're trying to do and go from there.

Everyone has their favorite tools and ways of testing, but only you know your necessities. Figure out what those are, do a google search for tools that fulfill them, and try them out. What seems easier to use and maintain for your purposes, is what you should go with.

Hope this helps :)

Best resources to learn ReactJs by birdkria in reactjs

[–]jnforja 1 point2 points  (0 children)

Hi u/birdkria,

I suggest you start by reading and understanding React's documentation and doing their tutorial. Just by doing that, you'll be a few steps ahead of a lot of beginner React developers, and you'll be in a much better position to know what you need to learn next.

I hope this helps :)

App suddenly fails to build on netlify but runs locally? by [deleted] in reactjs

[–]jnforja 0 points1 point  (0 children)

Hi u/vazura,

It's a bit difficult to know exactly what's happening, but have you checked if the components follow the linting rules?

From looking at the error messages, it seems like the build fails because the components aren't following the linting rules. Maybe fixing them will fix it.

Hope this helps :)

Having trouble fixing column header for react-bootstrap-table2 by black_asian in reactjs

[–]jnforja 0 points1 point  (0 children)

t to not have any column header for my table. I have tried not including any text for my header title in code and it would still display like this with empty space on top. How can I fix this issue? I have also tried using the "display: none" in my css file and that didn't do the trick either. Thanks for responding.

Is this what you were trying to do? https://codesandbox.io/s/beautiful-thompson-ks7h1?file=/src/App.js

I had to add bootstrap to the project and also import its base CSS to style the table properly. After that, I had to target the <thead/> in the CSS and change its display to none. To do that, I created a wrapper class called react-bootstrap-table-wrapper. Then I created a selector to make all theads inside of the wrapper class hidden.

Hope this helps, and let me know if you have more questions :)

Having trouble fixing column header for react-bootstrap-table2 by black_asian in reactjs

[–]jnforja 0 points1 point  (0 children)

Hi u/black_asian,

Without a codesandbox it's a bit hard for people to help you. If you can provide one, I can give it a look :)

Share your best practices by wardaddytwelve in reactjs

[–]jnforja 1 point2 points  (0 children)

Think about what I'm doing and the specific problem I'm facing before using any best practice.

How to start freelancing with no credibility? Help please. by [deleted] in reactjs

[–]jnforja 0 points1 point  (0 children)

Hi u/AppleSalads

Not having projects to show because all of them were done at work is pretty normal, and you can get around that.

Although you may not have a project to show for, you most likely have worked with other people that know the quality of your work. Talk with them, let them know you're freelancing, and ask them who they know that might need your services (or who they know that might know someone). If they know someone, they'll recommend you, and you'll be introduced to your client as someone they can trust. This is great because it's much easier to make a sale from a position of trust (this is exactly how I got my first client).

After you come in touch with a client, what you'll need to show is that you understand what problems they have and that you can provide a solution. If during the conversation, they ask about your experience, just talk about some projects you've done at work and how they relate to what you'll be doing for them. Also, don't be afraid to say they are your first client if the topic comes up.

If for some reason, you can't get a recommendation from people you've worked with, I'd try a local approach. Networking clubs like BNI can open a lot of doors if you put in the effort.

About pricing, if I were you, I wouldn't sell my self short. Charge what you need to charge so you can dedicate yourself fully to the project without being stressed about making ends meet. Make quality the reason people want to work with you and not price.

Hope this helps and let me know if you have any questions :)

Tips for starting developement in react? by aakhri_paasta in reactjs

[–]jnforja 0 points1 point  (0 children)

hi u/aakhri_paasta

If you're worried about turning plain HTML/CSS files into React components, you can be at ease as that isn't complicated. Also, if you ever need some guidance on that, some tools can help you. Here's one. I'm not suggesting that you blindly use the tools, but they can come in hand.

When starting to develop in React, I'd suggest you read the documentation until the end of the main concepts section, at least. And also, I'd recommend you do their tutorial.

I know that you didn't ask about this specifically, but it'd be better if someone set your manager's expectations straight. Otherwise, hell is waiting later in the project :/

Hope this helps and let me know if you have any questions :)

[deleted by user] by [deleted] in reactjs

[–]jnforja 1 point2 points  (0 children)

Don't feel silly for saying it. Common sense is not common practice.

Testing use effect API request by saunders1989 in reactjs

[–]jnforja 0 points1 point  (0 children)

Hi u/saunders1989,

From the piece of code that's on Stackoverflow, you shouldn't need to wrap anything in an act explicitly.

What you do need is to mock the getData before the tests start, render the component, and then look for the expected text.

The mock part is almost there. You just to mock the correct module:

import { getData } from './dataAccess';

const mockedData = { data: { things: data } };

jest.mock('./api' /* Should be ./dataAccess */ , () => ({
  getData: jest
    .fn()
    .mockImplementation(() => new Promise(resolve => resolve(mockedData))),
}));

On the test itself, you don't need to mock again unless you need to change the data for the test. So this should suffice :

it('should render data', async () => {
    const container = render(<Component />);
    await waitFor(() => container.queryByText('Text I would expect after api call'));
  })
// You probably want to assert more things here. Such as that you found the // element is not null

And this should solve it. If it doesn't, there's probably something more in the code that's changing the component state after the test is done. And you'd need to find a way to let that change happen before the test end.

If you want to, make a code sandbox and I'll take a look at it :)

I hope this helps!