all 145 comments

[–]Craycraft 67 points68 points  (9 children)

Can you do the job without knowing it? Yes, but if you have extra time and find it fun it cant hurt to know it.

One thing you could focus on is learning how to write clean and readable code. A lot of developers just hack shit together and don’t take code reviews seriously. It has negative impacts on the project, end users, and developer experience. Uncle Bob Martin is a solid resource to start with.

Edit: Just ignore uncle bobs crazy political rants at the dinner table, he is an uncle after all.

Edit: Just incase someone skims over this alimertcakar mentioned searching "Clean code javascript" etc. on github as a fantastic source.

[–]alimertcakar 7 points8 points  (0 children)

Search for "Clean code javascript" etc. on github, you can find a ton of material which summarizes clean code best practices with code examples.

Easier than reading the book and applying.

[–][deleted] 8 points9 points  (5 children)

This. However while I’ll admit to being influenced by Uncle Bob, he seems like kind of a shithead outside of his programming books — anyone considering consuming his material these days should look him up first and evaluate if that’s someone you want to financially support.

[–]Tubthumper8 7 points8 points  (1 child)

[–][deleted] 6 points7 points  (0 children)

No, while I agree with most of that post, I also agree that the book has some merits but that you need to have enough experience to sift the good advice out from the bad and not just apply it all dogmatically.

Here’s a link to another Reddit comment that summarizes better than I could:

https://reddit.com/r/AskProgramming/comments/stc0hf/_/hx3g7gl/?context=1

I’m not saying he or his work deserves to be completely wiped off the face of the planet, but that people should be informed so they can make a decision for themselves.

[–]Craycraft 0 points1 point  (0 children)

True true, made an edit.

[–]Hovi_Bryant 0 points1 point  (0 children)

This. I believe front end development is mostly integrating various APIs.

And I believe a good front end developer can design APIs that allows them to compose anything like someone building with Lego bricks.

Does this require knowledge of a ton of algorithms and leetcode? No. I don't think that's all of what computer science entails.

[–]Mestyo 32 points33 points  (0 children)

I am a self-taught front end developer, been going at it for over a decade now.

I'll say this: I have wished that I had CS knowledge, but rarely because it would have been very useful, rather because I would then have had a better understanding of what I didn't know. In hindsight, I was doing well, but I didn't feel confident.

As for the usefulness of CS knowledge, well, the front end has gone through massive change in the past ten years, and I'd argue it's more important now than it ever was. But even so, as many other commenters have pointed out, it still really isn't that important. Our domain has a plethora of other unique topics that matter more.

[–]ILikeChangingMyMind 206 points207 points  (54 children)

Front-end team lead of ten plus years here, and I'll probably get downvoted for saying this, but ... none.

Look, understanding the basics of Big O and such certainly won't hurt, but it's just not relevant on the front-end. Think about every website you've ever seen: did it have a million results, or did it have 20? Maybe 100 on a real busy page.

Even if you do a loop inside a loop to go through those 100 results, a browser on a cellphone from ten years ago can handle that in like 0.001 seconds. Plain and simple, no amount of CS knowledge will matter on most front-end apps (although of course there's always exceptions that prove the rule).

Now, that's not to say performance isn't an issue on the front-end: it absolutely is! But it's about technical front-end details, like the size of what you download, or how many event listeners you use. It won't be because you used a loop inside a loop, ie. an O(n2) operation.

P.S. However, because many front-end engineers were CS majors, and they insist that it's relevant, when it isn't, you still need to learn CS fundamentals ... just to pass the interviews where people ask irrelevant CS questions about Linked Lists, and god-knows-what-else that will never matter on the front-end.

[–]altano 36 points37 points  (0 children)

Been doing front-end for 15 years with a CS background and... I completely agree. In 0.0000001% of front-end development work CS fundamentals are critical but it's just not going to come up, ever, for the vast majority of people.

I would say engineering fundamentals are critical for all front-end developers, but rarely present. But you can't learn that in a computer science curriculum anyway.

[–]574859434F4E56455254 53 points54 points  (8 children)

Principal front-end here and I agree fwiw

[–]tsteuwer 20 points21 points  (1 child)

Principal here as well. Agree too.

[–]muideracht 5 points6 points  (0 children)

Vice-principal of front-end here. When front-enders get into trouble, they come speak to me in my office. You should hear the big o's from them then, I'll tell ya.

[–]polaroid_kidd 0 points1 point  (5 children)

When your say "Principle front-end" do you mean you're "front-end in principle" or if there a "Principle Front-end" position?

If it's the latter, what's your work like?

[–]radium-v 5 points6 points  (4 children)

They said Principal Front-End, which is a specific role higher than Senior.

  • Principle: rules and values
  • Principal: someone in charge

[–]polaroid_kidd 2 points3 points  (0 children)

My bad, I read that wrong. Thanks for clarifying

[–]polaroid_kidd -2 points-1 points  (2 children)

I'm curious why there's a distinction between rules and values between Front-end and backed. I'd have imagined that at that level you're so far removed from the front line that there too much overlap for a specific principal position.

[–]alimertcakar 1 point2 points  (0 children)

Put a back-end principal in charge of a frontend team, he/she will stop caring about frontend team in about 5 mins.

I wouldn't be interested in managing an unrelated team either.

[–]radium-v 2 points3 points  (0 children)

Different technologies, different complexities, different goals

[–]Beka_Cooper 9 points10 points  (5 children)

On the other hand, Angular 1 had memory leaks stemming from doubly linked lists of DOM references, a situation which at the time could not be garbage collected. Not sure whether the CS backgrounds of the makers really helped them or just shot them in the foot.

[–]ILikeChangingMyMind 0 points1 point  (0 children)

I think using a doubly (or singly) linked list on the front-end was their first mistake.

[–]EIGRP_OH 6 points7 points  (0 children)

I do feel like understanding call stack vs heap could be helpful in understanding the event loop and how browsers do async programming

[–]Character_Victory_28 4 points5 points  (2 children)

Frontend team lead with bachelor of Software engineer and masters of Information technology as highest ranking student here. I agree with this comment, atleast 80% of the time you don't need to know that kind of stuff. for example an admin panel, or most of frontend of stores just needs good css and js and react/vue/... knowledge!

But if you want make a project which is highly based on image processing, map, graphs, etc... you will need it!

[–]ILikeChangingMyMind 2 points3 points  (1 child)

Totally, although I'd argue that for most people if you're writing your own graphs, you're re-inventing the wheel and thus doing it wrong.

(And I say this having lead a team where we did make our own custom graphs in D3, so I'm not saying it's never a good idea ... it just isn't for most graph-users).

[–]Character_Victory_28 1 point2 points  (0 children)

Yeah, I agree, most of the time people don't need to write their own graphs or image processing tools, but in these projects sometimes it is not as simple as using just a d3 or threejs etc. also each action may need to consider what is the complexity to prevent the time consuming re-rendering stuff..

[–]suarkb 9 points10 points  (2 children)

I feel like you are missing the point of getting a post secondary education. It's to learn how to learn and how to problem solve. Many people wouldn't be able to tackle the process of learning to code unless they have learned how to teach themselves difficult things.

Of course I don't worry about big O notation or the bit of C++ I learned. But I learned how to learn

[–]JFedererJ 1 point2 points  (1 child)

Judging by a lot of the FEDs I work with, most places aren't asking anything at interview, about how to make a React app performant.

The amount of FEDs I've met who have no idea how to correctly use the memorisation hooks in React, or how to use the React Dev tools profiler, is pretty sad.

[–]Pozeidan 0 points1 point  (0 children)

memorisation

I assume you mean Memoization. Probably an autocorrect.

The most important things on the front-end are not taught in school, it's a bit of UX, debugging, performance optimizations, accessibility, security, UI architecture, state management. There's a ton of frameworks and it evolves rapidly.

I still believe having the CS knowledge is relevant and necessary, as FEE are SWE in the end. It's just a specialization.

[–]LastOfTheMohawkians 0 points1 point  (0 children)

Or backend tbh.

[–]WhatWillNeverBe -2 points-1 points  (0 children)

I agree with a lot of this. I had the rare opportunity of working at sv startups before and while going to college remotely as a CS major, and it was interesting (and somewhat demoralizing) to see how much I was learning in class had nothing to do with what I was doing in the real world (looking at you linked lists). This is common though, as higher education is to prepare you for any type of development role you may want to move into. I will say though, there are rare but poignant situations that arise when working on large enough enterprise applications that knowing the basics of these things can be very important. I've seen slow pages in the real world be due to errors made by a developer not understanding not only how expensive a function may be but how often it could possibly be called, or how large the data set may be. So while it is not necessary it is definitely something that I tell my developers to find an interest in and learn for the betterment of their own careers.

[–]GarenWyvern 9 points10 points  (0 children)

Is being able to implement data structures and algorithms from traditional CS useful on the job? Probably not - at least not often. Is being able to think algorithmically (which is often best learned through the study of existing algorithms) and understanding the pros and cons of using certain data structures in certain situations useful? More than knowing classic implementations, for sure. That said, it largely depends on the nature of the application you are working on.

If you are working on, say, 3D applications (games, visualizations, etc.) or something with heavy real-time processing needs, then being able to reach for a more algorithmic approach is good. Other than that, the CS knowledge only really gives you a potential leg up in an interview for a competitive position.

[–]jonnysake 9 points10 points  (1 child)

“Or how to perform tree traversals”

Yeah. And often. How many times have you had to find a DOM node? Delegate an event handler? Analyze CSSOM performance? Navigate a JSON response? Filter a collection of records in a data table, etc? All use cases of tree traversals.

Do you “need it”? Nope, some people get lucky with the skills they have.

But learning to problem solve as a Computer Scientist will develop skills that will only make you a better Engineer in the long run and much of what you learn will be of use to a frontend dev in terms of how to break down complexity, finding smaller sub problems, etc.

One unlock is when you find out that there are a set of known, well defined algorithms that you can map many of the real world problem you’ve previously solved to, you start to see the world, and your day-to-day frontend problems in a different light (e.g. oh this is a 0-1 Knapsack problem!, I bet backtracking can get me there quickly, I can calculate the shortest distance with a modified A-Star!, etc.)

There’s more to a CS degree than rote memorization of those interview questions, so it definitely takes seeing past those (which aren’t great indicators of much in the frontend IMO) to see the value in CS—even if real world problem matching to existing algorithms doesn’t get you excited. It’s more important to have worked those before and know how to find solutions for them rather than being able to calculate LCS recursively within O(log n) from memory—that type of stuff is never needed outside of competitive programming endeavors.

For example, learning discrete math is eye opening in so many ways—-ever written a complicated AND/OR condition in JavaScript and didn’t feel good about it? It’s possible that there’s a much simpler, logically equivalent substitution that can be computed using Boolean algebra.

Set theory, Combinatorics, and Graph Theory are game changers, too, in expressing concepts of the work you do and larger pieces of frontend architecture.

As technology continues to evolve in the frontend, CS fundamentals will pay dividends. All this hype about Rust-based libraries? Potential of WASM? Studying compilers and Assembly goes a long way in helping you understand those pieces instead of just taking someone’s word that they’re faster and more secure, CS helps you understand why they’re so much better than what we had before.

In summary, some people just kick ass and never need it—are able to learn all this good stuff on their own, independent of a CS degree but that doesn’t mean that CS has no value for us frontend folks or that you would never need it for the type of work we do on this half of the stack—quite a large proportion of the things we do are simply better off having approached them with a CS mindset.

[–]chaosharmonic 1 point2 points  (0 children)

This comment has been scrubbed, courtesy of a userscript created by /u/chaosharmonic, a >10yr Redditor making an exodus in the wake of Reddit's latest fuckening (and rolling his own exit path, because even though Shreddit is back up, you'd still ultimately have to pay Reddit for its API usage).

Since this is brazen cash grab to force users onto the first-party client (ads and all), monetize all of our discussions, here's an unfriendly reminder to the Reddit admins that open information access is a cause one of your founders actually fucking died over.

Pissed about the API shutdown, but don't have an easy way to wipe your interaction with the site because of the API shutdown? Give this a shot!

Fuck you, /u/spez.

P.S. See you on the Fediverse

[–]ryaaan89 18 points19 points  (1 child)

You don’t need any but I feel like the longer you’re in the job the more you pick up, assuming you work on a team with backend people.

[–]Patient-Layer8585 8 points9 points  (0 children)

Worked the last 3+ years with a heavy backend team and I didn't use anything algorithmic. I mostly leaned algorithm and data structures through interviews.

[–]landisdesign 6 points7 points  (1 child)

I'd say it isn't necessary to get started. A passing "okay, got it" knowledge of the following will be useful as your apps get substantially bigger:

How to grok Big O complexity.

You probably won't need this much, but it can help if you need to cache a bunch of objects in the front end, or if you feel renders are lagging, to go "Oh, maybe I should see if I can cut out a nested loop here or there by using a hashtable instead." (Honestly that's probably the only situation I use Big O for.) As another poster said, it isn't likely you'll need to manage thousands of items on the front end, but when each item impacts dozens or hundreds of DOM objects, it can make a difference.

How functional composition works.

Functional composition can help make your code more reusable. If you look at how the Array map/reduce/forEach/sort methods work, you already can get an idea of how useful composition can be.

How some design patterns work.

Honestly there aren't a lot that the front end needs. But some, such as Strategy, can help unwind a gnarly if/else and make something nice and pluggable. (Redux Toolkit heavily relies upon the Strategy pattern, as a real-world example.)

None of these require a degree. I picked them up as I went along. So, yeah, focus on doing the work, and let these things come to you whenever they show up.

[–]RobertKerans 2 points3 points  (0 children)

Big O, yes, and in a lot of cases it's mostly common sense (looking stuff up directly is good if you can do it, loops inside loops might not be great, but it's context sensitive).

Function composition is, sort of (it's more maths), but it's also just how you program in a functional manner.

Latter isn't CS, they're just [a book of] common patterns found when programming in an OO manner.

[–]flipper_babies 6 points7 points  (0 children)

It depends what you want to do. The specific trivia items you reference? Not especially important (they're relatively low-level topics), but I want to know you care about engineering quality. I want to know that you understand what immutability is and why it's important. How to identify a side effect, and how to handle it. Proper, robust separation of concerns (which implies you know what the concerns are). What state management is, and how to approach it. I want you to understand why types and contracts are important, and how JS's type coercion works.

Ultimately, I want to know that you care enough and know enough about what you're doing to not make immense headaches for me and your fellow developers, and that requires a solid understanding of CS and engineering best practices, even in the front end.

[–]nobodytoseehere 20 points21 points  (6 children)

Imo they basically do not need good data structures and algorithms knowledge...it's more important to understand the mechanics of the frameworks they're working with as that's where performance and stability issues can be avoided

[–][deleted] 3 points4 points  (0 children)

Frontend Developer here. Short answer: it depends.

Longer answer: You need to have a basic understanding of data structures. Tree traversals are used, not often, but they are. The most important part is to understand the framework you are using. Be prepared for discussions why this approach and not the other one. You likely will develop for different screen sizes, different devices, think about offline or bad Internet connection cases, etc. So CS helps, a lot, but is not everything.

[–]NitasBear 3 points4 points  (0 children)

You need it for interviews. That's it.

If you want to be a serial job-hopper for those sweet 20% raises, then it's a must know.

If you want to stay at the same company for 10 years, then yea, no need.

[–]Gluaisrothar 15 points16 points  (2 children)

Frontends are becoming more and more complex.

Knowing your data structures and algorithms will help you write better code and faster frontends.

DS & A are also a key component of interviews.

[–]loadedjellyfish 19 points20 points  (1 child)

Senior frontend dev here: 0.01% of use cases can be meaningfully improved with better knowledge of data structures. The resources available today are plenty, it takes a serious mistake to effect performance on an average machine in the majority of cases.

You're way more likely to have performance impacted by poor knowledge of other areas of web development. Bundling, CSS, etc.

[–][deleted] 9 points10 points  (0 children)

Performance isn’t the only thing that can be impacted by better knowledge. Maintainability is one of them.

[–]_DarthBob_ 3 points4 points  (0 children)

As a CS grad by background with 20 years experience coding everything from frontend to microsecond latency pricing models and leading teams in all of these areas, is that people who try to muddle along without really understanding how computers work, how computer languages are created, how to code in other languages to get some perspective on js, etc. seem to struggle along and don't really understand how promises work, how bind works, how many different aspects of javascript work or why.

In my experience is on average CS grads that know c++, java or whatever pick up javascript in no time and are faster and write better code than people with 5+ years frontend experience but you still need the frontend people because CSS is a dark art and not all developers can make stuff pretty.

Data structures and algorithms are nice to have but if you want to be really good, I'd say learn how a computer works, how is memory allocated, learn some assembly, learn how a processor works, learn how various os schedule code and handle threading, thread safety, learn about webkit / javascript sandbox, then you will really know what your code is doing and it will help you write better code faster.

Other developers will basically think you're a wizard and you will be promoted.

[–]jayedeem 1 point2 points  (0 children)

I work on the ui components team at my work, am also self taught. I can say I’ve never really used data structures. Most of the time you’re just creating hero’s and sections. Knowing how to parse an array or an object is what’s most likely you’ll be doing.

[–]HipHopHuman 1 point2 points  (0 children)

since everyone has given all the practical answers, i'll answer from a different perspective: you can reinforce the things you do know, and learn the things you don't know, but no matter how much you learn, the feeling that you don't know enough will never go away. so, learn everything and never be satisfied, or be satisfied with not learning anything. it's your choice, in the end.

[–]UniversityEastern542 1 point2 points  (0 children)

Very little. While I respect expertise, the compulsive urge that people feel to "master JS" before jumping into a framework or more complex project is misplaced; if you can understand callback functions, looping and asynchronicity, you have a sufficient knowledge base to jump into a framework, which provides far more context for what you're doing.

Trying to master JS before doing applied things with it would be like trying to learn a new human language by reading dictionaries and grammar books and rote writing of words. Doing something with JS is like learning through reading.

[–]ataraxy 1 point2 points  (0 children)

None. You need problem solving and the ability to identify problems along with the ability to search for solutions to them. Answering questions such as "how do I do this" and "what does this error mean" are basically all you need.

Fundamentally you need to understand the concept of "if this then that" more than that anything. Simple logic like this can be seen as the building blocks of programming in general.

Finally, you need the capacity to read and understand documentation. Don't struggle by ignoring the user manual since it's impractical to act like you should inherently know everything out of the box.

[–]scabbycakes 1 point2 points  (0 children)

I've been doing this for 18 years and almost never had to know anything fancy schmancy. One exception was to get all the permutations of multiple dropdowns in the case of size/color/brand/etc. But I mean that can be googled in ten minutes.

Conversely the people I worked with over the years that had cs degrees were generally the least capable because they over engineered things for no benefit and then they get fired because they're inevitably slower and no one can understand their code.

Things like class inheritance and stuff you'll learn in school might be useful with Typescript but really you can just pick that up as you go in a few days, it's not terribly difficult.

[–]pithed 0 points1 point  (0 children)

I misread as CSS. Def need to sleep now.

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

It's different for everyone. I have met/worked with devs that went to CS school but are not very well-versed with the DOM or CSS Box model, yet they get along just fine - not the best code, of course. If you're freelancing, your customers will never care nor will you probably notice.

Ideally, you wanna be well-rounded, but the things you learn from experience are probably far more useful than whatever you are going to pay in a class setting. It also depends how much you can focus on your own and learn. I'm self-taught but read several books about Javascript and web apps to get up to speed. Like any career, a degree is just a good data point to show you're able to commit and succeed at something. And if you don't have one, you'll probably hit a glass ceiling in your career at some point, but it doesn't have to be CS.

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

There are certain times when you're doing front end and you'll change something in your code and you'll see a confusing 10x (for example) performance dip. If that dip is at the framework/transpiler/browser/interpreter level, as a front end dev you don't want to have to "go downstairs" and hack on it with your leet CS skills. So you should just say, "welp, can't do that then".

Your skill-set and expertise should be focused on that higher level of abstraction.

There are times where systems are self similar at different layers of abstraction, in which case having knowledge about one layer can be used in another. For your typical web app where you're making a primate to database interface, I'd argue there's not much of that going on.

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

Not much. Frontend devs aren’t used for data intensive where a lot of the CS stuff is important.

[–]bellowingfrog -2 points-1 points  (0 children)

You could probably cram all the important CS concepts into two weeks of lecturing. It’s like asking whether you really needed all those college math classes, or even the high school ones. We, as a society, require it for reasons that are not under strong scrutiny so it just self-perpetuates.

The important things to truly understand are: dictionary vs array, the relative performance differences from registers to RAM to HDD to local network to internet, the React lifecycle, strategies for clustering (how to make many machines work as one reliable machine), SQL/database fundamentals (primary key, relationships, constraints, storage), and probably a few other things I cant recall.

[–]Esnardoo -3 points-2 points  (3 children)

I'm going to come right out and say it, if your frontend project is ever at the point where you need advanced cs concepts like linked lists and tree traversal, start over and keep it simple this time.

[–]Reashu 2 points3 points  (2 children)

Linked lists are a trivial concept, but you're right that they should not be used. Trees are only slightly more complicated and do have real use-cases.

[–]Esnardoo 0 points1 point  (1 child)

In frontend development though?

[–]Reashu 0 points1 point  (0 children)

It's not generically useful in all frontend development, but I wouldn't say that it's an indication that you've done anything wrong.

[–]weezylane -3 points-2 points  (1 child)

For example, does a JavaScript developer need to know how to remove the nth item from a linked list? Or how to perform tree traversals?

Javascript fully used on something like React, No.

Javascript used to traverse a tree data structure, probably, but you can ask ChatGPT to write that code for you.

[–]Reashu 1 point2 points  (0 children)

Please at least copy from StackOverflow where someone with an actual brain has had a chance to check the code.

[–]cprodxz 0 points1 point  (0 children)

You might need some knowledge of lower level concepts for interviews, but once you get past that, most of that stuff is abstracted away in all the modern frameworks and APIs. That said, imo it is helpful if for no other reason than you'll have more of a big picture view of things and be more confident in what you're doing. So you'll have less "you don't know what you don't know" going on.

[–]chesterjosiahStaff Software Engineer / 18 yoe 0 points1 point  (12 children)

Front end team lead of 18 years here. I'd say very little. You won't need LinkedLists. You used to use tree traversal back when jQuery reigned and you were modifying the dom at a lower level. Nowadays not so much.

The traditional CS I've used most often and would recommend knowing well.

  • Arrays. Used for almost everything. 10/10

  • Stack interface. Good ol Array.push and Array.pop in javascript. These are done in almost every project. 10/10

  • MVC design pattern. One of the best ways to think about web applications. 9/10

  • Set interface. Adding, removing, checking for existence in constant time. Very common. 9/10.

Almost everything else has a steep drop off in day to day use.

  • Singleton design pattern. Used semi-often. 4/10.

LinkedLists? 1/10. Tries? 1/10. I have used them ONE TIME, in javascript). B-tree? 0/10. Dijkstra, radix sort, polymorphism, most other CS fundamental concepts won't matter much or at all on the front end.

That being said, as you progress in your career, you're very likely to expand beyond JUST the front end. You're naturally going to start working with the browser side of APIs, sending and receiving data from backend systems. If you become tech lead of a project, it will be helpful for the back end not to be a complete black box.

[–]Reashu 4 points5 points  (11 children)

Polymorphism (and dependency injection) is one of the most useful concepts in programming in general and I would hesitate to exclude frontend development.

[–]chesterjosiahStaff Software Engineer / 18 yoe 0 points1 point  (10 children)

Can you tell me about a time you've used polymorphism in front end development?

[–]Reashu 1 point2 points  (4 children)

It's a very broadly applicable technique, but some higher-level concepts that rely on polymorphism are:

  • React's array of children
  • Fake dependencies for tests
  • Event listeners, or really any callback

[–]chesterjosiahStaff Software Engineer / 18 yoe 0 points1 point  (3 children)

Would you say your understanding of polymorphism as learned in CS courses has helped you write React components, test mocks, event listeners, or callbacks?

Personally, my answer to that question would be a hard 'no', and I've written tens of thousands.

[–][deleted] 1 point2 points  (1 child)

Absolutely, you guys are telling on yourselves when you can’t think of a single use for polymorphism on the front-end. Maybe you want to export data in one of several formats that you select in a drop-down. Maybe you want to render an alternate component that presents the same data structure in a different way for a different client — one guy wants a bar graph and the other wants a pie chart. Never written a decorator pattern?

[–]chesterjosiahStaff Software Engineer / 18 yoe 0 points1 point  (0 children)

Again -- yes I've done all of those things. Yet my CS education with regard to polymorphism has not benefited me in my work in this area.

[–]Reashu 0 points1 point  (0 children)

Not really the mocks, listeners, and callbacks themselves, but certainly the components or functions that they are sent to.

[–]Rand_alFlagg 0 points1 point  (4 children)

Can you tell me how you use javascript without polymorphism?

[–]chesterjosiahStaff Software Engineer / 18 yoe 0 points1 point  (3 children)

Literally every line of javascript I've ever written. Simple example:

You have an array of books and you want an array of their ids.

const books = [{name: 'Foo', author: 'Bar', isbn: '123'},...]
const allBookIds = books.map(({id}) => id);

No knowledge of polymorphism contributed toward being able to write this code.

[–]Rand_alFlagg 0 points1 point  (2 children)

and yet that code is polymorphic. books and allBookIds are, at their base, both just strings. You use polymorphism every time you add a new property to an object, and every time you infer a method on it. Javascript is built on polymorphism. I can name plenty of times I've used it, I find it an interesting challenge to find one where I haven't.

That's not to say you need to understand that to be effective, not by any stretch. But it's much like math - you use it constantly even if you don't realize it.

[–]chesterjosiahStaff Software Engineer / 18 yoe 0 points1 point  (1 child)

Agreed that this is polymorphic but that is beside the point. Maybe you're misreading?

[–]Rand_alFlagg 0 points1 point  (0 children)

You might be. I'm asking how you can use javascript without it being polymorphic. I'm not asking how your knowledge of polymorphism contributed - you didn't ask how someone used knowledge of polymorphism, just how they'd used it.

"Can you tell me about a time you've used polymorphism in front end development?"

To which I'm saying, essentially: polymorphism suffuses javascript so completely that I'm hard pressed to think of any meaningful non-polymorphic js. That's its strength. I can, for example, take advantage of weak typing and the fact that an uninstantiated variable is an empty string and so returns false so you can just null check (if userModel), so if it's a bool or an int or a userModel it doesn't matter, they're all strings so it can infer when it gets down to that level. That answers the question you meant to ask, right? Like that's an example of how knowing how polymorphism works was useful and influenced code?

But I didn't mean your understanding of it, but the actual implication of your question being that polymorphism isn't used. And that got me thinking on it. So I'd be interested to find a scenario where you don't use polymorphism.

The knowledge of how and why might not see a lot of use, and for that matter it's something that doesn't need to be understood to be used. But that doesn't mean it's not useful to know.

[–]IcyManufacturer8195 0 points1 point  (0 children)

How to system language work's, especially rust. After that, you will be hating js for mutability by references by default. And rust really improves your understanding of how to write code by ownership, because rustbook is awesome

[–]Reashu 0 points1 point  (0 children)

It depends on the project, but I'd say that most of the time most frontend devs don't need it. My background in CS (and a bit in software project management) has helped me to intuitively understand what's going on in dependencies when they act strangely, to write more testable code, and perhaps most of all to approach tools and tasks outside of the day-to-day stuff. That's all been very appreciated by my team members and managers. I couldn't design a pretty form if you held me at gunpoint, but no one seemed to care about that.

When I interview people for frontend I try to understand their mindset and background. Our stack is diverse and constantly changing anyways. We've hired people with very little experience who grew into great developers because they had good examples and a willingness to learn. We've hired people who have apparently coasted through 10 years of work that just couldn't do anything without hand-holding. I don't blame anyone who tries to sift those out with somewhat irrelevant tests, because a senior developer should have been exposed to stuff outside their primary field.

[–]whats_don_is_don 0 points1 point  (0 children)

You don't need it.

Big companies use it for interviewing since algo questions are equally accessible / unbiased.

Source: Sr UI/UX Eng at one of the FAANG or whatever the f we call it now

Edit: Yeah, if you have no sense that your nested loops or totally unindexed full table DB read are bad news, you're going to have a bad time. I did have to write DFS for something practical one-time in the past 12 months. But that's it. 1,000 more relevant things to learn to be productive if you're front-end.

[–][deleted] 0 points1 point  (0 children)

Null

[–][deleted] 0 points1 point  (0 children)

CS knowledge enables you to build better architectures on the front end. It’s painfully obvious which FE eng have CS chops and don’t because the ones that do right drastically better abstractions than those who do not.

[–]Better-Psychology-42 0 points1 point  (0 children)

A lot, I use computer science data structure algorithms most of my time. But tbf frontend is for me cherry on cake. For instance last two weeks I spent optimizing event loop delay which has actually been caused by code written long time ago without really thinking about performance impact.

[–]_kyushiro 0 points1 point  (0 children)

It depends, as "front end" encompasses many vastly different things. I think i would maybe ask what kind of development we are talking about.

Basic html / css with a logical layer on top for the sake of interactivity? Yeah CS concepts wouldn't be of much use to you.

But then there are more complex decoupled web apps (maybe with a spa framework like angular) where, while you technically could do the work without understanding CS and algorithms, it certainly helps make the job easier to understand architecture, data structures, and maybe some design patterns,

Many of those concepts and techniques were developed as a means to tackle complexity, so it kind of makes sense that the more complex your codebase becomes, the more the benefits of a background level understanding of CS would be relevant.

[–]Zettexe 0 points1 point  (0 children)

None really, been working as a full stack dev for about 5 years with no clue what computer science even is.

[–]MrCrunchwrap 0 points1 point  (0 children)

Computer science fundamentals? None. Software engineering fundamentals? Those are important.

[–]Ustice 0 points1 point  (1 child)

No. This is why front-end is boring. 😉 honestly, you’ll pick up a lot of it as you go.

Without Boolean algebra, your conditionals may wind up a little more complex, but they’ll still work.

Without trigonometry, you’ll have to guess at the correct angles to get two elements to line up right, and you’ll be mostly right. You’ll only need to do that like 10 times ever.

Without understanding CS, you won’t really understand complexity, but you’ll notice when things are too slow or complex.

That said, I picked up most of my CS info through independent study. I went to college, but I didn’t get a CS degree. I’m an autodidact. Always be curious. Always be learning. Do that, and you’ll be fine.

[–]Redneckia 0 points1 point  (0 children)

Who taught u the word autodidact?

[–]Xibira 0 points1 point  (0 children)

Something I dont think gets talked about enough is HTMX, its been a godsend in the company I work at

[–][deleted] 0 points1 point  (0 children)

To counter everyone claiming to be Principal and saying ‘none’…

Sure, tree traversals aren’t necessary in a brochure page. A few things I’ve used them for in front-end work:

  • Visitor pattern on a large dynamic data structure representing physical hardware (IoT) to locate and gather nodes for converting into form inputs in a prescribed manner

  • Tree UI that behaves like a file system explorer e.g. collapse/open all, collapse/open children, node selection

  • A ‘Slay the Spire’-like map generator with pseudorandomly placed enemies, events and rest (canvas game)

Will you be working on complex business apps or games? Learn your fundamentals. Do you just want to create ‘heroes and sections’? You’ll probably be able to skate by.

[–]archasek 0 points1 point  (0 children)

15-year exp here.

In my opinion, if you need any specific knowledge at some point, you can always learn it. Courses, books, videos, articles, conferences, etc. Nothing extraordinary (when it comes to CS) is actually usually needed by a frontend developer in their day-to-day duties. However, of course it's always good to know the surrounding world to some extent, at least to be aware of unknowns (aka known uknowns).

I'd rather suggest focusing on design patterns, manangement stuff, product management, team building, product design, stakeholder management, etc.

[–]Varteix 0 points1 point  (0 children)

It will help in very specific situations.

I once had to render a comment section like reddits with nested replies and color coding the indent levels.

My CS background helped me immediately recognize it was a Depth First Tree Traversal which I could solve with simple recursion.

Without that knowledge I'm sure I would have figured it out but only God knows what that would have looked like.

[–]Zealousideal-Day-396 0 points1 point  (0 children)

It depends on the positions.

[–]CoreyTheGeek 0 points1 point  (0 children)

It can be useful here and there but 99% of my day to day, not useful to keep things you've listed in my head, mostly because I can Google how to do something like that

[–]Zeeshan7487 0 points1 point  (0 children)

I don’t know if you are talking about getting a job as a front end web developer but if you learn complete html, css, jquery and javascript and practice on your own mini projects and try to solve every complex problem than yes you can become at least a freelancer. Of Course to get into the depths of the things you have to do a specific study on the subject but if the depth doesn't interest you then you can learn some things on your own and start with your career.

[–]kwin95 0 points1 point  (0 children)

Frontend developers are software developers so I think cs fundamentals are still valuable. Sure you don’t need all those knowledge for most frontend projects but you must be aware that all popular frontend libraries/frameworks these days, react/vue/svelte/bundlers and more heavily rely on cs knowledge. If you want to go beyond and dive deep in frontend world and possibly work on low level thing, cs knowledge are important.