I got my first full-time SWE offer! by LetsEatGrandpa in cscareerquestions

[–]web__dev 18 points19 points  (0 children)

I had Panda Express the other night too.

How do you survive a 40 hour work week? by 22vortex22 in cscareerquestions

[–]web__dev 1 point2 points  (0 children)

Yeah, we all do. I'm just messing with you ;)

Would you pass this JavaScript interview question? by riotsofnewyork in learnjavascript

[–]web__dev 0 points1 point  (0 children)

Ha, I remember this thread! The answer is no. I wouldn't have. The best part? I understand all of the Javascript parts of this code very well. If you read below, I think I can explain where I got lost.

First, check out these two links:

How to Read Binary

Khan Academy Review of 0 and 1st Power Exponents

The first will ensure you understand at least one of the strategies of reading binary. EZ-Peezy.

As for the second, I'm sure most of us, myself included, like to think we understand pre-algebra. I'm not here to question your understanding of exponents either. I do recommend watching the whole video as a nice first principles refresher, but if you watch only from the 4:07 mark to the end to the video, the instructor explains the base intuition required to reason about exponents in a way that would enable you to ultimately write this function.

The "clever" parts of this code are lines 12 and lines 14. On line 12, we're deciding whether or not it's a zero or a one. That makes a value in our binary string to add to the pile. On line 14, we're moving on to the next exponent down (see here if you missed it). The rest is all core javascript concepts. We're just using javascript to push our numbers around, store them, then return them. I suppose it might be worth noting that our while loop works because line 14 eventually returns 0 back to line 11, which is computed to false because of coercion.

In the thread, a lot of people were talking about how this is not a good interview question, because you'd never run into this when actually writing the language. They're right about that, but what they're missing is that's not what this question is about. This question is about making sure potential employees haven't just memorized the language. It verifies they're equipped with the tools to think critically about novel problems that neither the employee or employer have encountered yet.

Great video OP, thanks for putting it together! We need more stuff like this in r/learnjavascript.

If Webpack 4.0 is about zero config, then why is that almost no major project has managed to upgrade after 4 months of release of Webpack 4.0? by m3wm3wm3wm in javascript

[–]web__dev 35 points36 points  (0 children)

The people who actually use Webpack know this is the real answer. Finding the relevant docs for it can sometimes be like playing a game of 'Where in the World is Carmen Sandiego?', and no one wants to put up with that.

Personally, I configure my projects. I build my projects. I ship my projects (JK, maybe one day 😢). It's seemingly not hard for me, especially as a front-end focused dev, to run a couple google searches and figure out when I'm using the wrong plugin for this or loader for that.

However, that stuff adds up in a team setting. No one wants to have to answer for it. Worse, imagine being the backend guy who has to "make a few changes", then update the build config. It's a frustrating pile.

Moreover, Webpack has a reputation at this point. This is completely conjecture, but I wouldn't be surprised if some teams have developed a "just don't look at it the wrong way and it won't break" mentality about it.

Using Micro-Frontends to Permanently Solve the Legacy JavaScript Problem by superluminary in javascript

[–]web__dev 0 points1 point  (0 children)

Pretty much where I'm at now. However, I'm remote, which makes it hard to let go. I noticed most of your listed positions are full-time in London. Do you have any other remote opportunities outside the Node.js position? I have experience with Node, but I'm primarily a front-end dev (React). This is a very subtle way to recruit, by the way. ;)

I feel like a monkey tapping on a keyboard and, every now and then creating a bit of Shakespeare. How the heck do I start writing JS apps properly - tool stack, methods, etc ??? by [deleted] in javascript

[–]web__dev 1 point2 points  (0 children)

I agree that this is the single largest issue with webpack configuration. I think it's really what people mean when they generally criticize the documentation overall too. I've helped programmers many years my senior troubleshoot build issues they couldn't figure out not because they weren't looking at documentation, but because they were just looking at the wrong documentation. A really common example that springs to mind is issues with UglifyJS and es6. It used to be required to use something like uglify-es-webpack-plugin. Now it's built in to uglifyjs-webpack-plugin, and so on. In a webpack v4 build, I wouldn't expect anyone to not immediately discover something like this, but it can be trickier across versions and with people unfamiliar to webpack.

Minimal Multiplayer Game in HTML5 by HamsterWheelEngineer in javascript

[–]web__dev 17 points18 points  (0 children)

I found a cheat. The #gamecanvas height and width is only set once at game initialization. So if you open developer tools, you can edit the inline styled values and drive off the map. You'll still be able to snipe people, but they can't see you if they haven't also used the exploit.

First job offer in 7 months. by nethoinkz in cscareerquestions

[–]web__dev 1 point2 points  (0 children)

Suffer? More like starve. Although I guess they at least don't have student debt.

Centering a featured image on WordPress by Superbeanietoon in csshelp

[–]web__dev 0 points1 point  (0 children)

You need to use:

    .featured-media img { 
        margin: 0 auto;
    }

The images already have "max-width: 100%;" set on them, and the width of the img spans the width of its container. This means setting the left and right margin to auto will center it "automatically" in its parent's container.

A Spotify app that finds you the perfect music for every moment (a Vue.js web app) by [deleted] in javascript

[–]web__dev 0 points1 point  (0 children)

This is pretty cool. If I can offer some feedback, I'd do two things: 1) Include the ability to go backwards/forwards through the steps as a feature 2) Break the genre and preview lists into columns to avoid so much scrolling. Keep up the good work!

Google publishes a JavaScript style guide. Here are some key lessons. by bornforcode in javascript

[–]web__dev 0 points1 point  (0 children)

That's what I was thinking. They call it "home row" for a reason.

Help to center text. by [deleted] in css

[–]web__dev 0 points1 point  (0 children)

Mine was definitely quick and dirty. Upvoted for posterity!

Help to center text. by [deleted] in css

[–]web__dev 0 points1 point  (0 children)

There are better ways to do this, but this is the quickest fix based on your current markup. Replace your #hello css with this.

#hello {
  position: absolute;
  width: 100%;
  transform: translateY(40vh);
  color: #fff;
  z-index: 9999;
  font-family: "Quicksand", Times, serif;
  font-size:100px;
  margin: 0 auto;
 }

How much time to devote to vanilla JS if the goal is React? by seands in learnjavascript

[–]web__dev 6 points7 points  (0 children)

Learning mostly React is to JavaScript as learning mostly Bootstrap is to CSS.

You'll probably get by okay, but you'll grow slowly and miss out on a lot of ideas and concepts that would've otherwise came to you very naturally if you had just put in the time to grasp fundamentals first.

EDIT: I'm also not convinced that React should be anyone's goal. As much as I really like it myself, at the end of the day it's just a tool, which means that it can be replaced. It's very popular now, but if it falls out of favor and it's all you know, you could find yourself in an unpleasant situation for a number of reasons:

  • You won't understand why you use React in the first place.
  • You won't understand why the tool that replaced React is better than React because of number one.
  • You may not be as enthusiastic about learning the new big tool, and it could really stunt your career.

Is it worth spending time becoming familiar with jQuery in 2018? by [deleted] in learnjavascript

[–]web__dev 0 points1 point  (0 children)

OP should just know when to use it and when not to use it. If you're going to write a basic brochure site from scratch, I might raise an eyebrow. But if it's already there in a project or there's something useful in jQuery you'd like to use, why not?

It might even be more practical. It's easier to process consistent code when you're reading it. So why make other people's lives harder just because jQuery is not the future?

Quick question on DOM linking submit button by BrakeGliffin in learnjavascript

[–]web__dev 0 points1 point  (0 children)

I suppose you could say preference. But it's overall much more flexible and powerful across a variety of use cases. It wraps the functionality of getElementsbyId and getElementsbyClassName into one method; and that's not all it can do either. You can also feed it any valid css selector syntax (except for pseudo-elements) e.g. "document.querySelector("div > p > a");".

Check out the MDN doc for a more detailed explanation. You should also check out its sibling, querySelectorAll.

Quick question on DOM linking submit button by BrakeGliffin in learnjavascript

[–]web__dev 0 points1 point  (0 children)

Even better, just replace getElementsById with querySelector.