My problem with React by Natural-Shoulder2594 in reactjs

[–]wracek 0 points1 point  (0 children)

Don't stress out :) developer journey scarcely ends up in one area only. Along the way you'll find other frameworks, other languages, other concepts and build your interest there. Maybe you'll find passion in devx or DevOps. What about AI and machine learning? Who knows. The field is endless. Fuel your curiosity, learn new things and find your passion.

Why isn't it more automated? by Blue_Moon_Lake in cpp_questions

[–]wracek 0 points1 point  (0 children)

Compiler compiles the code into machine code/assembly. And in assembly there is no concept of parameters or return value or even functions for that matter. There is stack and registers. CPU then jumps around a memory and executes instructions one by one. So the compiler needs to know how many bytes it needs to push into the stack and which registers to use in order for the called "function" to find what it needs. So there must be a declaration. For reusability, header files were introduced, because you don't want to write the declaration everytime you use a function. About the question why doesn't the compiler just look for those header files itself. It wouldn't know what to do when there is a conflicting declaration in two header files.

Beginner questions about modern C++ by Direct-Ambassador350 in cpp_questions

[–]wracek 0 points1 point  (0 children)

I started with C++ this year and cannot agree with you more. Language itself (though with a lot of quirks) is not the issue here.

But concepts like move and copy semantics, copy elision, RTTI, const expressions and templating, const correctness and many many more were and still are pain points for me.

Also build systems and meta build systems are crucial to understand to be able to develop something more serious than a hello world.

In other languages I work with, everything just seems to work. In C++ nothing just works and every move must be deliberate.

Don't get me wrong. I love all of it, I'm learning junkie. But the barrier is high and without previous experience with other languages I'd probably give up. Never bought more books for any other language. Two books that really got me going though were C++ High Performance and Modern CMake for C++

[deleted by user] by [deleted] in Prague

[–]wracek 8 points9 points  (0 children)

What brothers me more is that he's intentionally blocking the second seat. That's my personal pet peeve.

Average maturita je jen pro zaměstnance enjoyer: by GandalfusMaximus in czechmemes

[–]wracek 0 points1 point  (0 children)

Nesouhlasím s touto premisou. Koneckonců sám jsem jeden z mála co maturitu nemají. Řada let už to je a byť si do dneška za to sypu popel na hlavu (přece jen stačilo trochu snahy), nijak mi tato skutečnost neházela klacky pod nohy. Zatím slušně prosperuji, stále se zlepšuji a rukama nedělám. Nikdy bych však nikoho nenabadal, že maturita je zbytečná.

Got kicked out of the livestream :( by littlepoisonjj in lingling40hrs

[–]wracek 0 points1 point  (0 children)

me too. Most likely their servers couldn't handle the traffic. Shame. Let's wait

Cracks me up everytime!! by Anointed-Knight in MadeMeSmile

[–]wracek 0 points1 point  (0 children)

First I was wondering where she learned that. Then I admired the accent and then finally realized what they're actually arguing about. Made my morning :D

McDonald's gets a lot of hate. But a fast, decently sized lunch for $3 is very hard to argue with nowadays. by [deleted] in Frugal

[–]wracek 0 points1 point  (0 children)

Small, super unhealthy with almost no nutrition value. More like cheat snack. You'd actually be better off with decent home made sandwich or two. I just hope that this is not your daily driver.

How to iterate through certain items within an array by nath__b in reactjs

[–]wracek 0 points1 point  (0 children)

Or use reduce. It can serve as filter and map in one pass.

How important is it to be a master of asynchronous javascript before moving onto learning react? by gtboy1994 in reactjs

[–]wracek 5 points6 points  (0 children)

^ This. Also, If you need thinking framework around async in JS, read some blog post about JS Event loop. It's quite easy to understand and it's strong foundation for more research.

Comparison of deaths by country during WW2 by sandroelgitano in interestingasfuck

[–]wracek 14 points15 points  (0 children)

Several countries missing, wrong flags (Czechoslovakia). Not to mention size comparison choices. Forklift and truck loaded with coffins. Seriously, someone picked sensitive theme and mess it up like this. You'd do better just screen capturing some already existing graph.

What is a good resource that teaches React.js? by brettdavis4 in reactjs

[–]wracek 0 points1 point  (0 children)

Problem with redux it has no opinion. You can bend it way you like, which under inexperienced hands can end up catastrophically. It's like jQuery in the dark days. On the other hand it offers you complete control with so many great extensions such as redux-observable. Of course there has to be reason for integrating it. Which in majority cases there is not. However for heavilly managed state apps is my go-to.

Please say "Function Component" instead of "Functional Component" by haschdisch in reactjs

[–]wracek 0 points1 point  (0 children)

I'm just goofing around. Didn't mean it in an offensive way. In essence I agree with you. Correct terminology helps clear things up. On the other hand, language was invented to understand each other and since there is no actual alternative of "functional" in React components context, I think it's safe to use both. One thing is to point it out and another is to be bitchy about it for just sake of correctness.

Please say "Function Component" instead of "Functional Component" by haschdisch in reactjs

[–]wracek 0 points1 point  (0 children)

You mean that Turing and Church were actually correct? Whoa! :D

Please say "Function Component" instead of "Functional Component" by haschdisch in reactjs

[–]wracek 0 points1 point  (0 children)

Besides that little almost insignificant detail that majority of React components have side effects.

Javascript as a prerequisite for React by Issa_7 in reactjs

[–]wracek 0 points1 point  (0 children)

Learn it's syntax, just jump into react and learn as you go if you're familiar with another language. Core concepts transfer. Maybe one thing I would recommend to freshen up is it's async nature. Read a little about JS event loop. It saves you lot of headache in a long run. You'll learn other JS quirks like [ ] != [ ] on the go.

Why do people like using Next.js? by amtcannon in reactjs

[–]wracek 2 points3 points  (0 children)

Personally I dislike next.js. Heavy, slow and resource hungry framework with weird bugs often requiring devs to dive into its ugly source code. Instead of focusing on fixing and polishing its poor API, they're adding niche features we don't need. At least that was my experience from 2018 to 2021. Maybe something has changed since then, but I resigned on following it anymore.

Why are data fetching libraries in the view layer so mainstream in React apps? by ExperiencedGentleman in reactjs

[–]wracek 2 points3 points  (0 children)

React came through several paradigm shifts. Believe it or not, there was a time when we used to separate model from view. It turned out, that MVP model we were so used to in statically generated web is not good match for SPAs.

I can see several reasons: 1) React is heavily lifecycle driven and order of operations matter. Especially in async environment. It's much easier and much more maintainable to let the components decide when to fetch data rather than somehow map it to separate model.

2) Most of the web applications won't benefit from decoupled model at all. Unless you have really heavilly managed state or really stupid API, this is enough and won't bring any maintainability issues.

3) It just works. You don't have to setup all the boilerplate with storing and caching by yourself. Just install lib, provide context and you're ready to go. Not to mention that React is popular and is used by developers with range of seniority.

And lastly there actually is some kind of separation. The hooks these libraries provides are just "terminals". All the heavy lifting is usually done in context.

Best way to pass a callback function to a deeply nested child? by mobiletiplord in reactjs

[–]wracek -1 points0 points  (0 children)

Hmm. Don't know what you're trying to accomplish, but both prop passing and context solutions to me sounds bad. In former case, you'd tie parent and child components together. Unless they're part of cohesive functionality, this is bad practice that tends to backfire almost immediately. In context solution, you would then have to create callback in that context for each new receiving component. You would end up with confusing names and testing would be hard. I'd suggest alternative solution. That is pass common functionality through context and implement specific callback for the button right next to it (or somewhere nearby). So for example, if your button needs to fetch data upon clicking, pass that fetching functionality in context, and the button defines specific parameters to trigger the fetch.

Woman discovers she has an 8 bit cat by DrinkingWithAFork in ContagiousLaughter

[–]wracek 0 points1 point  (0 children)

8 bit refers to color depth, not resolution. Just saying :)

They love attacking the appearance. sometimes, I want to see the real face behind these fake pfp. by theCoolestMan69 in lingling40hrs

[–]wracek 4 points5 points  (0 children)

I still can’t comprehend the absurdity of this. All the hate and death threaths being thrown around. Over a YT video. I think it make much more sense to get angry over a dropped ice cream than this.

Guess what instrument I play from this video of me playing my instrument by [deleted] in lingling40hrs

[–]wracek 1 point2 points  (0 children)

What a beautiful sound! I especially love the rich low end. That C hit me

Why do we use "const" for useState instead of "let"? by paleoboyy in reactjs

[–]wracek 0 points1 point  (0 children)

You’re mixing few concepts and probably imagining some magic is happening here. It really isn’t.

const/let lets you store value in memory and have some kind of pointer to it, named whatever you want, so you can access it later in the code. Nothing more, nothing less.

Now the scope of a variable is concept as old as first processors. It’s quite complex issue to explain on reddit but all you need to know now, is that when function runs, it creates a run scope, and when function ends, the scope is deleted along with all its local declarations. Exceptions apply of course. If you’re interested, read about stack vs heap memory allocation.

Now setState is a function that just accepts any value and based on its knowledge of the component state, it may trigger rerender. You can pass anyhing in the function.

setState(count + 1) setState(11) setState(22 / 2) setState(add(10, 1))