u/CodeAndknives
CodeAndknives
CodeAndknives
Echoooooo....
CodeAndknives
In addition to the responses which talk about lazy loading and the canLoad guard, I want to provide my anecdote.
TL;DR: don’t guard everything.
I’m working on an app. We originally thought the entire site was restricted to authenticated users. Therefore, we checked auth status in the root component and redirected unauthenticated users to a third party login. Worked fine.
Then came the requirement to show an explicit logout confirmation message. Well, you can’t view it in the site if you’ve already logged out and have been redirected to the third party login.
To fix this, we don’t guard the root component ( which is mostly just a router outlet) or the new login component. The guts of the app are still lazy loaded and protected by our canLoad guard. Login component is responsible for redirecting to third party login and then redirecting to our guarded site content after. We also have a logout confirmation component that’s guarded so as to only be visible by unauthenticated users.
So consider carefully whether your entire route hierarchy needs to be guarded or only parts of it.
CodeAndknives
I always really liked the art in Karmaka
CodeAndknives
I’ve got a bit of a different perspective for you to consider.
Save it for later. Much later.
I’m not saying you shouldn’t ever learn about “how everything works under the abstraction that Angular provides”. I’m saying that your time is finite and that learning what Angular does and how you as a user should use the framework is probably more valuable at the moment if you’ve only been using it for a month.
You can drive cars your whole life, even very well, without knowing every detail behind how your car works. Are you trying to drive a car or build one?
It’s abstractions all the way down to the math and physics that define the chemistry that makes up the silicon used for the transistors. Abstraction layers help us to focus on what’s important at a given layer.
Knowing how Angular implements DI or compiles it’s templates is useful info, but maybe not right at the moment.
CodeAndknives
You don’t have to use dependency injection to reference a service class. You could instantiate your own instance if you wanted. The key benefit of injecting it is that, for a given injector, you get the same instance of the service.
Services, and other injectables, aren’t true singletons. When you declare that an Injectable is provided at root, you are asking the framework to instantiate a single instance at the root injector and to inject that instance as needed. This single instance acts as a singleton, but it’s very helpful that it’s not. You could add global objects to the window, but it’d be a nightmare for testing or any other case where you actually need separate instances.
CodeAndknives
I like the tips and info, but i wish it was a cohesive blog post instead of just talking about tweets. Feels more like an advertisement trying to get twitter followers.
I loathe the code samples being locked away in a Twitter link. It is a truly awful user experience for the blog reader. I can’t read the code on my phone screen and clicking on it takes me off the blog to mobile twitter. Then clicking on it again just gets me to a picture of code. I gotta assume you want people to use this code, or at least that you wouldn’t mind them copying it. I can’t do anything with a picture. I don’t know, maybe that’s the point. Then I’ve got to navigate back to the blog post and reload the whole page, all the while trying to decide if what you’re trying to say is worth the extra effort involved in reading it.
Put your blog post content in your blog post, please.
CodeAndknives
Art looks great. If you care about the resemblance to Skull though, I’ve got some ideas.
Is there any significance to the view angle on the skull?
For me the viewing angle is a big reason why it resembles the one used by the Skull game, other than art style of course. I think there’s absolutely room within the genre/art style of Day of the Dead for many board games. I have to admit though that my first thought on seeing your box was “cool, a new Skull expansion/release”.
I think that using a different view angle, perhaps semi profile, would set it apart more. Maybe even angled up or down or even laughing. Or even a full skeleton as the main image or as a secondary element. Definitely no skeletons in Skull.
Other elements being in view, related to the game, would also help. I’m assuming by the name that there are dice involved. Maybe use dice for the eyes. Or have dice falling out of the mouth. Or as the flowers.
Or don’t worry about it.
CodeAndknives
To pile on, being able to clearly communicate with people who aren’t as technically experienced as yourself is a crucial skill for software engineering.
When you end up leading a team, you have to communicate with your team mates, your management, and your customers.
Having someone like you is a very valuable opportunity to practice his “soft skills” with.
CodeAndknives
Probably not.
It’s not so much the number of components, but rather the shared state that will drive you towards a state management library.
A badge icon in a menu bar showing the number of todo items in a list would be a good example of shared state. The badge component needs to know how many items there are and the list does as well.
On a separate note, you may want to take another look at your single component to see if it’s make sense to break it down into smaller composable pieces.
CodeAndknives
We don’t have any internal projects. Customers pay for labor by specific people for specific customer projects.
CodeAndknives
I wrote basically the same library for a job. The use case was that we needed to extend a comment section feature to support reddit style threading without being able to modify the database schema in any way. The solution was to embed the new metadata in the actual comment text. I felt pretty clever for that one.
CodeAndknives
A mix of approaches might help.
Not every aspect of programming will hold the interest of an eleven year old. If the main interest is in creating games rather than in learning how to program, then a “hard way first” approach might smother it.
Hope y’all get there.
CodeAndknives
I’ve got two large 100lb doodles.
It doesn’t get that cold where I live.
I park my car on the end of a dog leash in the driveway and then hook them up. I use the hose. When it’s cold, I’ll hook the hose up to the sink in my garage for hot water.
My best tip though is using a car wash mitt to shampoo them. I mix shampoo and water in a bucket just like I’m washing a car and then dunk the mitt in. It works a lot better than trying to apply the shampoo with my hands.
Towel dry first and then I use a force dryer for the rest. That takes the longest.
CodeAndknives
*suffixed with $
CodeAndknives
The screen shots look very nice. Congrats!
Why have you chosen to work with Swing over newer UI frameworks like JavaFX?
Do you prefer Swing for any particular use cases?
CodeAndknives
Effects see all actions that pass their “ofType” filter. So if your effect logic is activating downstream of the ofType, then that means the target action was dispatched.
So now the question is, are you dispatching a bunch of LOAD actions?
Check your lifecycle methods. Also use the ReduxDevTools plugin with chrome to get a better look at what your stuff is doing
CodeAndknives
You’re right. I don’t need a library to have a singleton object for my state. I’d reject that option though because it doesn’t provide the safety that NgRx does. I’m a big fan of immutability and I like the one way data flow of the redux pattern. I haven’t attempted that sort of thing in a very long time, but I did once in java and got myself into some race condition nightmares.
Unfortunately, for my particular use case, it is about the ‘transient condition of the UI’. Slide outs, pop ups, partially filled out forms, current url route, they all need to survive the session being timed out, the user logging out, and the browser cache/storage being cleared.
If there is a simpler way to capture my whole website state in one go, then I’d be interested.
CodeAndknives
JavaFX is way better than Swing. And check out Kotlin and TornadoFX while you’re at it.
I think the first discussion though is wether you want to make a desktop app or not. The answer might be yes. I think there are still loads of good use cases for a desktop app. They are not as popular lately though and come with their own technical challenges such as distribution and update strategies.
Have fun.
CodeAndknives
some sort of quick release combo pry bar /pocket clip would be pretty awesome
CodeAndknives
I used java every work day for six years. It was my favorite language.
If working in the JVM, not just android but anything using the JVM, I’d pick Kotlin over Java without any hesitation.
Go with Kotlin
CodeAndknives
Could you comment on how this is different than using ngTemplateOutlet to encapsulate custom views and when to use each pattern?
One difference I see is that your pattern supports having different business logic implementations for strategy components. If the strategy implementation differences are purely presentational, would you still use a strategy component over NgTemplateOutlet?
The accordion wrapper with different items reminded me a lot of this recent talk: https://youtu.be/2SnVxPeJdwE
CodeAndknives
I’m not sure if your example code is actually complete enough to debug.
Nonetheless, a couple things jump out.
The variable “results” is an Action and It might be clearer that that is the correct Action if you chose to parameterize the ofType operator like this:
ofType<MyActionClass>(myActionTypeString)
Alternatively, you could map to your payload before your switchMap.
Remember that an effect must return an action, unless you mark it with dispatch false.
I can’t see the return value in your sample.
I can’t see the function definition for “find”. I’m assuming it isn’t the array.prototype.find function since you aren’t calling it from an array.
I don’t see a catch block.
You may want to use catchError instead of try-catch anyways.
CodeAndknives
Anyone else struggle understanding recursion?
CodeAndknives
I don’t have a master’s degree, but I’ve been involved in the hiring process for a couple companies now. Generally speaking, two years experience is considered equivalent to a master’s degree from an HR perspective.
Financially speaking, I don’t think that a master’s in CS makes any sense. In addition to the marketability being a wash after two years, you should also consider the opportunity cost of the salary you could have been earning while you were instead paying tuition for a master’s. That’s just my financial perspective on it though. Personally, if I were inclined towards getting more degrees, I’d go for an MBA with the goal towards preparing myself to start my own software company.
Yes!
Make your component selector “mycomponent[myinput]”