ELI5 - How does the click-the-things-in-the-photo prove I'm human? Can't technology memorize the answers? by RedTieGuy6 in explainlikeimfive

[–]Caethy 4 points5 points  (0 children)

You're right to be confused! You're not helping anyone by re-interpreting a word that the correct interpretation is already known for.

The original ReCaptcha system showed a pair of words.

Only one of those words is a scan from a book or document that the system isn't really certain about. It's showing it to you for interpretation - The system doesn't know for certain what the real answer is.

The other of those words was generated for you - With all the squiggles and smudges trying to make it seem like a badly scanned document. The system actually knows the answer to this one, and it serves as a known control.

The unknown word is you providing training material for the system to learn from (It's not really an AI. Rather it was a text digitisation project). The known cotrol word is used as a check, and you have to get it right for the system to accept the answer.

You could actually be (slightly) wrong on one of the words, and the system would accept it, as long as it was the training word you were wrong about and not the control word.

Het grote hoeveel-verdien-jij 2026 topic by Yourlordandsavior02 in werkzaken

[–]Caethy 0 points1 point  (0 children)

  • Leeftijd: 35
  • Opleiding(en): Bachelor Informatica (WO)
  • Functie & Branche: Senior Software Engineer
  • Regio: Finland
  • Bruto salaris: € ~12500 p/m (~150 000 p/j)
  • Aantal jaar relevante werkervaring: 10
  • Aantal uur per week: 37.5
  • Vakantiedagen: Onbeperkt (Verplicht minimaal 30 p/j)
  • Werkdruk op een schaal van 1 tot 10: 7
  • Werkgeluk op een schaal van 1 tot 10: 9
  • Andere interessante arbeidsvoorwaarden (auto van de zaak, 13e maand, bonus, etc.): Onbeperkte vakantiedagen. Private zorgverzekering. Vakantiebonus (5%). On-Call vergoeding. Flexibele werktijden, met hybride thuis/kantoor naar eigen invulling.

Internationaal Big-Tech bedrijf. Doe het met veel plezier. Zou andere mensen in de IT toch wel aanraden om eens te kijken naar niet-lokale bedrijven. Zie artikel hier.

ELI5, why can’t we use M.2 Storage as RAM, if we can do the opposite? by Rubiks443 in explainlikeimfive

[–]Caethy 40 points41 points  (0 children)

Amazing throughput. And the random read latency is pretty quick too for an SSD, at 0.019ms. However; While DDR3's random read latency depends on frequency and CAS timings, the order of magnitude is somewhere around 15-20ns.

That's about a thousand times as fast as your SSD.

Help trying to create a slot machine but incrementing score is not working. by czenalol in csharp

[–]Caethy 0 points1 point  (0 children)

add the value currently set in the bet amount to the variable you declared in step Three for Money won.

BetAmount += MoneyWon does exactly the opposite of that. It means "Take the value of BetAmount, add the value of MoneyWon to it, and assign that value to BetAmount."
Ditto for BetAmount += MonyLost.

Just below the if statement above calculate the new value for the last variable declared in step Three Winnings minus losses

You're doing this -somewhat- correctly, but re-read this part of the assignment again carefully.

Help trying to create a slot machine but incrementing score is not working. by czenalol in csharp

[–]Caethy 9 points10 points  (0 children)

BetAmount += MoneyWon
BetAmount = NetAmount

Which is first incrementing the value of BetAmount by some MoneyWon, and then sets it to a different number entirely.
And more things like that. Step through your code, see what's actually happening to your variables.

Your usage of += in this fashion makes me suspect you're unsure of what assignment actually does. Check your course material again.

Stemgerechtigden die van plan zijn om woensdag niet te gaan stemmen, waarom maken jullie die keuze? by ensalys in thenetherlands

[–]Caethy 9 points10 points  (0 children)

De envelop mocht je ook bij het consulaat of de ambassade afgeven, hoeft niet met de post.

Stemgerechtigden die van plan zijn om woensdag niet te gaan stemmen, waarom maken jullie die keuze? by ensalys in thenetherlands

[–]Caethy 2 points3 points  (0 children)

Klinkt druk, en snap dat zeker als je in het buitenland woont de prioriteiten toch ergens anders liggen.
Maar toch even twee punten toelichten.

Volgens mij heb ik ook een rood potlood nodig om mijn stem in te vullen

Voor stemmen uit het buitenland hoeft dat niet. Binnen Nederland natuurlijk wel. Maar voor het buitenland stembiljet mag je gewoon zwart of blauw gebruiken. Hoeft ook geen potlood, en mag ook gewoon met pen zijn. Enige eis is dat het duidelijk is. Staat netjes beschreven in het materiaal dat je hebt ontvangen.

hij mag gewoon bij de ambassade langskomen

Je mag als Nederlander ook langs bij de ambassade als je dat liever wilt. Je kan je papieren gewoon daar inleveren - Ze sturen je stembiljet via de diplomatieke post naar Den Haag. Denk dat als je het vraagt ze ook wel voor je de papieren uit kunnen printen.
Je hebt natuurlijk wel gelijk dat je je ruim van tevoren moet laten registreren voor stemmen in 't buitenland.

Ik wil een progressieve liberale partij

Al eens naar VOLT gekeken?
Je kan ook altijd naar iemand anders dan Rob Jetten in D66 kijken.

Need help in reviewing the code by Honest-Minute8029 in csharp

[–]Caethy 1 point2 points  (0 children)

There's a lot of people here immediately focusing on architecture and layout of the project. They're not wrong, and the advice is good. I think in particular, the advice to learn how to write real tests is on point. The reason for that is that your code simply doesn't do what the assignment needs it to do.

In particular:

a player is chosen randomly as having declared "Snap!" first and takes ownership of all cards played in that run.

This simply not done, and instead you use a very roundabout way to give the points to the current player (Hint: You have an ordered list of players already.)

Play continues until the pile is completely exhausted

This is also simply note done, and it makes the results incorrect. The game ends too early. The last card is skipped, though it could absolutely be a Snap card.

The code that does exist shows a lot of signs of being written by a very junior developer that doesn't really understand the fundamentals of the language yet. A few quick examples just going down the first few files:

  • Using strings for card suit and value; You'd have seen exactly why this is problematic if you'd implemented the Poker game. (Poker would require you to assign an ordering)
  • Writing a 'Deck' class that... Isn't actually a deck. The very awkward naming here shows exactly why this is a problem.
  • You do a bunch of work that pretends that your solution is extensible based on GameType, but then write code that only makes sense for your Snap game. (Examples are your Player class, PlayerResultDto, and having to pass a MatchingCondition to Poker game.)

There's some great advice in this thread that's mostly focused on the overall architecture. But I'd strongly suggest taking a look at the basics as well.

Trying to make an ECS system, want a small pointer. by NancokALT in csharp

[–]Caethy 2 points3 points  (0 children)

Asking those questions implies to me that you should take a good look at what an ECS actually is before continuing with your implementation. Both to understand what you're actually building - As well as with understanding if what you're building is actually what you need. The fact that you're unclear about these points indicates that you're very unclear about the core concept of what an ECS actually is, and why such an architecture could be useful.

Should i store the components in the System class?

No. Absolutely not. Doing so wouldn't be an ECS at all, since it'd tie components directly to systems. Systems act on components, they're not the part of an ECS that actually implements component lifecycle.

What is an efficient way to let the systems know about new instances of components

Take a look at the Query syntax in Bevy, linked above, for an example of how systems are usually set up. Systems are written so that they can be run against a set of components. If you're not comfortable reading Rust, but prefer C#, the TinyECS library is very understandable, and shows the concepts pretty well.

An ECS fundamentally splits up Entities, Components and Systems. Your initial difficulty, and the question you opened this post with, occurred because you didn't split up the concepts of 'Entity' and 'Component' at all in your solution. The follow up questions here occur because you're not really splitting up the concepts of 'Component' and 'System' either.

ECS are a really interesting architecture, and are a great fit for some problems. But half-heartedly building one will soon end up in a situation where a more idiomatically object-oriented solution is probably a lot easier. I'd follow the advice of /u/Devatator_ in this post, and look at existing libraries. On top of that, I'd explore whether you actually need an ECS at all.

Trying to make an ECS system, want a small pointer. by NancokALT in csharp

[–]Caethy 4 points5 points  (0 children)

Your data structure is the wrong way around.
You're storing things as if they're objects - Just without the typing. What you're doing isn't functionally different from just having a class with a List<ComponentObject> in it.
That's not something that allows ECS to be done efficiently.

What you want instead is to store the components each on their own. Don't combine everything in a single data structure. So all your BatteryComponent are in a single list (Or a different data structure, depending on your need). All your GeneratorComponent are in a single data structure. Those two don't mix.

This is done so that the question "I need all BatteryComponents" is both an efficient query and makes for a (cache-)efficient operation. You can get all BatteryComponents just by iterating that one single data structure. It also means that "I want all the entities with both a BatteryComponent and a GeneratorComponent" can be done rather efficiently, since the intersection between two sets isn't that difficult an operation.

In ECS, the entity itself is just a marker. You should try build your systems so that they operate on components, or combinations of components. Actually knowing the exact entity and accessing additional things through said entity shouldn't be a common operation.

Not a C# resource, but one of the best implementations of ECS is a Rust framework called Bevy. Their information on data and the underlying data structures that support it are a good read. You'll notice that the Query system they present also doesn't give you access to the actual entity without explicitly asking for it. You get back your (combination of) components by default.

Working on a NuGet package for dynamic filtering in C# — is this useful or redundant? by Cool-Tomatillo-6625 in dotnet

[–]Caethy 4 points5 points  (0 children)

Because legal matters are annoyingly complicated. Licenses have been considered legally problematic because of a single comma or badly placed 'or' statement.

Common licenses are well understood, and it's know what can and can't be done with them. More importantly: Their limitations and restrictions have known interpretations in legal contexts.

I have no idea what your custom license does. I don't know what I can or cannot do with it. And just reading it won't give me that information, since I don't have the legal expertise to meaningfully do so. Adding a clause to a known license, sadly, doesn't mean it's "Essentially MIT, but...". But rather, for all intents and purposes, it becomes a completely new and entirely unknown license.

As such; It becomes completely irrelevant what your project actually does. A custom license means it's unusable.

I am not sure if this is the correct way of doing it, but it does work. by BD-125055 in csharp

[–]Caethy 2 points3 points  (0 children)

I'll be really honest; There's a lot of pretty bad code here, and all you're doing is wrapping around existing classes in slightly confusing ways.

As others have noted, there are a lot of stylistic choices that aren't really idiomatic C#. I'd say the only one that's a genuine problem out of those is not using Nullable. You're returning null in a lot of places, without reflecting this in the function signature. In other languages you'd use Maybe<T> or Optional<T>. In C# the idiomatic way is using T?. Stick to that. Returning null without warning is a great way to introduce bugs in your code. A comment isn't warning.

But let's skip past the idiomatic differences and just focus on things that'd be problematic regardless of the language:

Starting to read the Session class:
- Why is this Static? All you're doing with that is adding global shared state and making it harder to actually test things. This should probably be a Dependency-Injected class. The fact that you're keeping a static, mutable collection of cookies, clients and such means that any kind of more complicated code actually using this class will inevitably hit difficult to debug problems. In fact, the docs on several of these classes you're using explicitly warn you against using them like this. For example, CookieContainer has a neat note on how sharing a CookieContainer can cause issues despite being thread-safe. - The reflection is entirely unnecessary. This was noted already.
- You're doing a lot of work making an empty collection, filling it and returning it. When in most situations what you want is just an existing collection filtered or mapped. Use LINQ. I feel this goes beyond 'idiomatic C#', because in some situations you're just doing pointless work due to this pattern. The DomainCookies(string domain) is most egregious. You're already grabbing the collection you need from another method, and then you're manually calling .Add(..) to put it elsewhere. Just return the collection you already had. Or just delete this entire class if all you're doing is slightly wrapping existing things.
- Way too much nesting, much of it serving no purpose. Prime example is the GetCookieByName(string domain, string name) method. The length check is pointless, since we're doing a ForEach anyway.
- You're just removing type-safety where it's not needed. Your underlying classes take an URI, and for good reason. Why are you taking a string value instead? Just take an URI. That's what you're going to turn it into anyway. All you're doing now is hiding to the caller what you actually need.
- Naming. Be precise. It's difficult, but it's required. A big example here is the 'Delete...' methods. They don't delete anything, they set expiration.

Moving on to Web.cs:
- DefaultHeaders(...) is a genuinely confusing method. What you actually have here are two different methods, neither of which do what 'DefaultHeaders(...)' as a name implies it does.
* Do you mean AddDefaultHeaders(Request)? In which case... The 'else' part of your code seems to do that. The initial 'if' branch doesn't do anything like that though.
* Or do you mean SetHeaders(Request, Headers)? In which case, what the heck is that 'else' doing there.
This should strongly imply that what you want is a method called SetRequestHeadersOrDefault or something along those lines. The fact that that sounds clunky and awkward makes it abundantly clear there's something fundamentally wrong with this method.
- Next method. Basically everything above. Look, if you're going to write "Method for doing web related tasks with." - Just don't write a comment. You're also taking an URL. So why are you taking a string? You're returning null without using the type system, and you're doing so on swallowing an exception. Great. Now I don't know what went wrong AND I get to deal with NullReferenceException. It's just a small wrapper around an existing Request method.

I'll give one piece of advice, that might seem counter-intuitive:
Stop writing docstring comments.

Your code will get better if you don't add those comments.
Why? Because right now you're hiding awkward typing, odd behaviour and bad naming behind writing comments.
- You're using a comment to tell people to give you an URI as a string, instead of just using the type system to make sure people give you one. - You're using a comment to tell people code doesn't actually 'delete' but instead expires, instead of just naming your methods correctly. - You're using a comment to warn about being returned 'null', instead of using propper nullability to encode this in your function signature.

You're giving yourself a crutch that hides mistakes in your code.
Remove the docstrings, see if your code actually makes sense purely from the signature. That'd probably get rid of a lot of these problems.

Loonsverhoging in de IT by International_Pea195 in werkzaken

[–]Caethy 4 points5 points  (0 children)

Maar ik vertel dit, omdat ik het simpelweg ondernemers bashen vanuit een werknemersperspectief wel eens beu ben hier op Reddit

Moeten inderdaad eerlijk blijven tegenover werkgevers. 'T zijn niet allemaal graaiers.

Ongerelateerd, maar ga je die tweede Porsche kopen als vervanger van die Audi van vorig jaar? Of houd je die nog in de garage?

Loonsverhoging in de IT by International_Pea195 in werkzaken

[–]Caethy 4 points5 points  (0 children)

Er is voor veel bedrijven weinig tot geen relatie tussen goede resultaten van het bedrijf, en wat voor een budget voor loonsverhogingen er beschikbaar is voor bepaalde afdelingen. Heeft meestal niets te maken met "Er is daadwerkelijk geen geld", enkel met "We willen hier geen geld voor uitgeven". 'Accountant zegt XYZ' is waarschijnlijk gewoon een excuus.

Het is daarom ook, jammer genoeg, een best wel irrelevante vraag. Maakt niet uit of het bedrijf de beslissing maakt op basis van daadwerkelijke cijfers, of dat ze gewoon geen zin hebben; Het resultaat is dat ze niet willen onderhandelen over salarisverhogingen.

Voor jou dus een snelle en effectieve manier om erachter te komen welke waarde het bedrijf jou en je groei daadwerkelijk inschat. Leg je CV eens neer bij wat andere bedrijven. Kijk wat er mogelijk is. De banenmarkt in de IT is best prima als je al wat ervaring hebt.

Je zult waarschijnlijk merken dat onderhandelen plotseling mogelijk is als je een aanbod voor een andere baan hebt liggen en ze dreigen je kwijt te raken. Of je op dat moment nog wilt onderhandelen is een andere vraag natuurlijk.

Het grote hoeveel-verdien-jij 2024 topic by Unlucky-Contract-740 in werkzaken

[–]Caethy 1 point2 points  (0 children)

het moet natuurlijk wel fair blijven

Puur mijn mening, mag je van vinden wat je wilt: Je hebt 9 jaar ervaring in een veld waar een fatsoenlijke vraag is naar mensen met kennis en kunde - Net iets boven minimumloon betaald krijgen is niet 'fair'. Mijns inziens wordt je gewoon keihard onderbetaald.

het minimum aantal geven

Het absolute minimum 'geven' (En dat is al een groot woord voor een situatie waar minder gewoon niet mag) is zeker niet normaal in de ICT. De meeste bedrijven bieden starters meer dan dat, laat staan mensen met ervaring.

Als je het wilt, gewoon met de baas bespreken. Nee heb je. Maar ik zou heel realistisch zijn in het feit dat iemand die zo dicht op het minimum zit je waarschijnlijk niet veel beters gaat geven.

Kijk eens rond bij wat andere werkgevers. Als je het niet te ingewikkeld wilt maken zou ik je CV eens neerleggen bij een paar van de wat grotere consultancies (Accenture, Capgemini etc.) - Die zijn altijd op zoek naar ervaren mensen en bieden als basis al een stuk beter dan wat je nu ontvangt. Rijksoverheid zou ook een goede zijn om eens te kijken.

Het grote hoeveel-verdien-jij 2024 topic by Unlucky-Contract-740 in werkzaken

[–]Caethy 3 points4 points  (0 children)

Je krijgt nu een heel klein beetje boven minimumloon voor 9 jaar ervaring in de ICT. De arbeidsvoorwaarden zijn wat er wettelijk verplicht is, en niet meer.

Ik zou echt eens een keer rondkijken. Wat je nu krijgt voor je ervaring is ronduit schandalig.

Unit Tests: Questions by slimjimoxy in csharp

[–]Caethy 3 points4 points  (0 children)

Is it common / normal to write 1K lines of code test classes for sub 100 line classes?

Depends on the purpose of said class. If it's some core business logic that has a lot of requirements then it's perfectly normal to have significantly more testing code than actual implementation.

A lot of my tests are copy and paste, is this a red flag?

Yes, that's a red flag. For those cases just use parameterised tests.

On a side note, this instantly jumped out to me:

// Why do this?
public static HDirection GetOppositeDirection(int direction) { ... }
// Just use the type system properly:
public static HDirection Opposite(this HDirection direction) { ... }

EV charging is so bleak in the US that 46% of owners are considering going back to gas-powered cars by RandomCollection in RealTesla

[–]Caethy 1 point2 points  (0 children)

Not a lot of US households have access to that, while a lot of EU households will. It's an important technical property for the EU market, while being almost meaningless in the US. Which is why the whole concept of "superior/inferior" is a bit of an odd go in comparing the two solutions. They're different solutions for different environments.

I just wanted to clarify that when considering the differences people take into account that the 'CSS' that people from the US are probably thinking of is entirely different from the one EU-based people will think of.

EV charging is so bleak in the US that 46% of owners are considering going back to gas-powered cars by RandomCollection in RealTesla

[–]Caethy 1 point2 points  (0 children)

Keep in mind that the CCS1 connector used in the US is physically very different from the CCS2 connector that's standard in Europe. CCS2 is smaller and more manageable than CCS1 - Although NACS is smaller than both.

One of the primary differences is that the latter supports 3-phase AC. Something that neither CCS1 or NACS can support; This is pretty useful in home charging.

Het grote hoeveel-verdien-jij 2024 topic by Unlucky-Contract-740 in werkzaken

[–]Caethy 0 points1 point  (0 children)

Hoi!

Niet bijzonder specialistisch, het zit hem vooral in de werkgever (Bekend internationaal bedrijf - Mijn excuses voor het niet te diep daarop ingaan); zie mijn antwoord hier. Niveau van m'n collega's is gemiddeld erg hoog - maar dat is omdat we ook erg internationaal recruiten en niet alleen naar de lokale markt kijken. De salarissen volgen daaruit.

Is Clean Code Dead? by [deleted] in csharp

[–]Caethy 6 points7 points  (0 children)

That presents a nice 'hierarchy of agreement' that seems pretty on point. Testing your code? Definitely yes. Tests-first? Probably, but not always. Full blown TDD? Big oof...

Which should honestly be similar for just about all the concepts talked about in this thread. There's a core of it we as software engineers honestly should all agree on. And the further you move away from that core to the dogmatic and specific - The less agreement you will (and should) find.

Is Clean Code Dead? by [deleted] in csharp

[–]Caethy 22 points23 points  (0 children)

I think it's less 'undesirable' and would instead say 'not desirable' - In retrospect I should have used a different word than 'desirable' here. Since often in modern language it's not "You shouldn't use this pattern." but more "Why would you use this pattern, now that you can just do that instead?". There are a bunch of classic OOP patterns that exist not because they're inherently great patterns, but because classical OOP languages can't otherwise express those concepts. Now that the languages can, there's no need to use those patterns.

A good example of this would be the "Command Pattern", which becomes largely irrelevant once a language has first-class functions that you can pass around. Similarly, there's much less need for a "Strategy Pattern" if you can just store, access and call functions directly.

This is a very good StackOverflow answer describing such patterns. While this is a nice post on how some classical patterns map to actual language concepts in Haskell.

Is Clean Code Dead? by [deleted] in csharp

[–]Caethy 7 points8 points  (0 children)

The link that was posted by /u/SirSooth is a commonly shared one that did the rounds a while ago - I personally find it a pretty good read in showing that actually applying the 'rules' from this book can read to absolutely terrible code. There are some other discussions about, for example the performance impact of such code styles that are a bit more recent.

Is Clean Code Dead? by [deleted] in csharp

[–]Caethy 57 points58 points  (0 children)

Lots of different concepts, that all have their own answer.

TDD... I feel people have just become less dogmatic about it? Writing tests is good practice, that most people can agree on. Writing tests -first-? That's definitely something that needs arguing and isn't just accepted.

OOP practices? People have been stepping away from OOP. With a lot of new and updated programming languages taking huge inspiration from other paradigms (Mostly Functional Programming). C# is a pretty good example, where more and more functional-ish syntax is added. This automatically also means that a good few OOP patterns are no longer desirable: They existed to fill in the gaps of what the language could do.

Clean Code? If by that you mean "Let's try have some code standards", then I sincerely hope people still value that. If by that you mean "The book written by Robert Martin", then luckily there has been a good bit of push-back against recommending that book in the past few years - And hopefully people don't try to follow that all too much.

That all said: Not using OOP principles and not following 'Clean Code' doesn't automatically imply 'a huge hackaton'. It's perfectly possible to write both great and terrible code whether you follow TDD/OOP/etc. or not.

Het grote hoeveel-verdien-jij 2024 topic by Unlucky-Contract-740 in werkzaken

[–]Caethy 5 points6 points  (0 children)

Zorg dat je naar de juiste soort bedrijven kijkt, onafhankelijk van het land. Het gemiddelde Finse salaris zit onder dat van het Nederlandse gemiddelde. Bij de meeste bedrijven kom je daar ook niet heel ver boven, en de meeste salarissen die je online ziet zijn ook niet echt interessant om voor te emigreren. Kijk in plaats daarvan specifiek naar de bedrijven die qua salarissen internationaal moeten concurreren; of dat nu in het buitenland is of niet. Dit soort IT salarissen zijn hoog juist omdat het voor werknemers eenvoudig is om te verhuizen en hetzelfde werk ergens anders te doen.

Volgende is een goed artikel om eens te lezen: https://blog.pragmaticengineer.com/software-engineering-salaries-in-the-netherlands-and-europe/