<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Peter David Carter</title>
    <description>The latest articles on DEV Community by Peter David Carter (@peterdavidcarter).</description>
    <link>https://dev.to/peterdavidcarter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F229409%2F85007792-92f6-4dde-93fa-ef930df2ade0.jpeg</url>
      <title>DEV Community: Peter David Carter</title>
      <link>https://dev.to/peterdavidcarter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peterdavidcarter"/>
    <language>en</language>
    <item>
      <title>Why Do Developers Argue Over Trivial Things? </title>
      <dc:creator>Peter David Carter</dc:creator>
      <pubDate>Fri, 20 Sep 2019 18:52:47 +0000</pubDate>
      <link>https://dev.to/peterdavidcarter/why-do-developers-argue-over-trivial-things-3378</link>
      <guid>https://dev.to/peterdavidcarter/why-do-developers-argue-over-trivial-things-3378</guid>
      <description>&lt;p&gt;Seems to me there are a few reasons for this.&lt;/p&gt;

&lt;p&gt;The first is that sometimes seemingly trivial things really do matter.&lt;/p&gt;

&lt;p&gt;The second is that some devs lack empathy and can't understand other's preferences.&lt;/p&gt;

&lt;p&gt;Following on from these, to non-techies the one can look very much like the other.&lt;/p&gt;

&lt;p&gt;Bad devs will often argue personal points on genuine trivia because it makes things nicer for them personally, and since there are likely few real world consequences they don't have to worry about being wrong. Or they just can't tell the difference between important and not anymore having found the things they previously didn't care about actually did affect the project... &lt;/p&gt;

&lt;p&gt;Good and great devs will often still argue trivia for the reason outlined: non-techies and bad devs often can't tell the difference, and being seen to be knowledgeable in general can establish them in a position where they can improve the project as a whole, rather than deferring to bad or mediocre devs who would create an inferior product. &lt;/p&gt;

</description>
      <category>codequality</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>How I Hacked Big Data Using Only Google Chrome (and a little bit of Postman)</title>
      <dc:creator>Peter David Carter</dc:creator>
      <pubDate>Mon, 16 Sep 2019 18:34:37 +0000</pubDate>
      <link>https://dev.to/peterdavidcarter/how-i-hacked-big-data-using-only-google-chrome-and-a-little-bit-of-postman-lpe</link>
      <guid>https://dev.to/peterdavidcarter/how-i-hacked-big-data-using-only-google-chrome-and-a-little-bit-of-postman-lpe</guid>
      <description>&lt;p&gt;Ok, so, a little while ago I was looking over a website my friend works at. She's a Junior Developer and so clearly thinks I am magic and can hack anything. Of course I wanted her to think that, so I started poking around on the site she works on.&lt;/p&gt;

&lt;p&gt;After a few failed, very obvious opening moves, (nmap seemed to show lots of open ports, but it was just a cluster) I noticed something odd. There were a bunch of requests -- a huge volume actually, with a particular signiture, let's call it 'cp5' to keep this anonymous. This struck me as odd so I looked through the network requests to see what was being sent. I noticed something even odder.&lt;/p&gt;

&lt;p&gt;Nothing about the request seemed to include any proper validation information. It was clearly a big data collector that wanted to report everything I was doing on the website back to the owner. So I did what any normal person would do and crafted a packet telling it that I'd done something I hadn't.&lt;/p&gt;

&lt;p&gt;200 OK.&lt;/p&gt;

&lt;p&gt;Well then! Surely, I thought, if I send it thousands upon thousands of packets, all telling it I did things I didn't really do it would reject these as false.&lt;/p&gt;

&lt;p&gt;Nope.&lt;/p&gt;

&lt;p&gt;It accepts them and tells me everything is fine. There is nothing in the code-base that filters requests after that, unless they are badly crafted, which my fake data was not -- it was crafted to look like something it wasn't.&lt;/p&gt;

&lt;p&gt;So I can tell a multi-million pound florist that vastly more people are navigating their website who aren't (not that I would; my data would have seemed like a blip, nothing more, and done no real damage to their business) and it just accepts my word as gospel.&lt;/p&gt;

&lt;p&gt;So that's how I hacked big data with just Postman and Chrome. I'm not going to tell you all the details of which program it is, or how the owners of that program tell me it can't be fixed, even though they charge around $2000 a month for it, because then everyone would do what I did.&lt;/p&gt;

&lt;p&gt;But... what is the thing you use to clear snow away?&lt;/p&gt;

&lt;p&gt;Hhhhmmmm. I've said too much.&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>javascript</category>
      <category>security</category>
    </item>
    <item>
      <title>Angular Style Encapsulation: You're Doing It Wrong</title>
      <dc:creator>Peter David Carter</dc:creator>
      <pubDate>Sat, 14 Sep 2019 08:31:54 +0000</pubDate>
      <link>https://dev.to/peterdavidcarter/angular-style-encapsulation-you-re-doing-it-wrong-3ol9</link>
      <guid>https://dev.to/peterdavidcarter/angular-style-encapsulation-you-re-doing-it-wrong-3ol9</guid>
      <description>&lt;p&gt;Style encapsulation is a neat idea... I mean, we're banishing all those crazy collisions in the shared global, just putting your styles where you actually need them, right?&lt;/p&gt;

&lt;p&gt;😂&lt;/p&gt;

&lt;p&gt;The fact is, on any enterprise scale project you're likely to end up with a hodgepodge approach, with some stuff in the shared global, some in the component and some passed through into class bindings, or even in exceptional cases as dynamically generated and injected custom s/css objects. That's not &lt;em&gt;necessarily&lt;/em&gt; bad, but in practice it often is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc4q6elw3n7ef3hgiaf8e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc4q6elw3n7ef3hgiaf8e.jpg" alt="Look, this fancy new tool! Let's use it at random with no forethough, tackling each problem as if it exists in isolation! What could go wrong?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The issue for those who see encapsulation as a magic bullet that's going to fix all your styling woes by forcing things into the correct place is that it absolutely won't do that. If you're lazy and don't think through your strategy at a big picture level it can and will bite you in the ass. Repeatedly. And you won't enjoy the process. You have to be strict, you have to be rigorous and you have to expect that switching encapsulation on will, far from reducing your cognative overhead, actually likely increase it. This is because you can't just place your styles in the component that needs them in every scenario. There are many, many different situations, each of which require a different approach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fz61jpym3dt6nzqihxdh3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fz61jpym3dt6nzqihxdh3.jpg" alt="Developer you think you are, hhhmmmm?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Firstly, and this should I hope be obvious to everyone: if a styling is genuinely applied over the whole app, and particularly if you expect to change it globally, it belongs somewhere shared. Now, you &lt;em&gt;can&lt;/em&gt; use shared global css/scss files for this. You can also create a shared component that contains the styles within in. In many ways the latter is preferable, since you get all those lovely reuse benefits, but something to consider when doing it is this: every time you want to customise your component on a per page basis, you're going to have to mess about with input variables and bindings which, in a really large application, could be as much as 3 or 4 or even more layers deep. How much are you going to be customising, and by doing things this way, how much hassle are you going to create for yourself vs the old-school approach of s/css shared over some or part of an application? This is something specific to your application and you should know as a professional developer what the best way is in each scenario. You &lt;em&gt;have&lt;/em&gt; to go through that mental process if you want your application to scale correctly.&lt;/p&gt;

&lt;p&gt;Secondly, you might think that the little component you're making is just for the page you're on, but is it really? If you want to use those styles elsewhere, they're now stuck in a box. Did you really want to do that? Maybe you did. If you're certain then encapsulating them to a single, per page component was the right call. Again, though, you need to understand the complete design, not just the little patch you're working on.&lt;/p&gt;

&lt;p&gt;Thirdly, and probably most importantly, there are no absolute rules you can follow for using styling encapsulation but you absolutely &lt;em&gt;cannot&lt;/em&gt; do things at random and hope for the best. What you'll end up with won't just be a spaghetti mess, it'll be a system that actively forces you to create a spaghetti mess that gets worse and worse each time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5jkkflwi2zmdu2g2nbpj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5jkkflwi2zmdu2g2nbpj.jpg" alt="Bending your mind around other people's encapulation choices is a bit like understanding The Matrix."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't do that.&lt;/p&gt;

&lt;p&gt;If there's one thing you take home from this article it's that every time you make a call about where to place a style, you should consider from every angle available what that will mean.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>css</category>
      <category>refactorit</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
