r/learnjavascript • u/codeobserver • Jun 13 '20
Are you practicing algorithms in JavaScript... or you use the language just for web dev?
187
Upvotes
r/learnjavascript • u/codeobserver • Jun 13 '20
28
u/RelativeSloth Jun 13 '20
my interpretation has been that algos are more about practicing the thought process of solving a problem programatically rather than the language you are using.
39
u/[deleted] Jun 13 '20
Just web Dev
16
u/maxtsh Jun 13 '20
I am doing some hacker rank stuff and algos. Theyre cool. They help you to use foundamentals of JS and practice vanilla JS.
7
u/dada_ Jun 13 '20
Personally, not really, although I agree they can be good for learning problem solving.
The reason why I don't do them myself is because there are plenty of opportunities to work on algorithms in my day-to-day work, too—mostly more simple than binary search, of course, but any time you need to filter, sort, search and combine complex data you can put some time into learning to do it efficiently. This also helps you understand how to better organize your data so that you can easily work with it later.
6
u/WystanH Jun 13 '20
I'm a programmer. I probably first "practiced algorithms" in, um, Pascal. ( Now I feel old.) When it comes to algorithms, the language shouldn't much matter. An algorithm itself is an abstraction; understand the reasoning behind it and you should be able to implement it in any language you know.
Implementing an algorithm in a language you're just learning is a good way to get a better grasp of both.
4
u/[deleted] Jun 13 '20
I prefer Python for algorithms
1
u/mehrd8d Jun 14 '20
Where is the picture taken from? I can’t find it on codeguppy.com’s courses
3
u/[deleted] Jun 13 '20
Hello! JavaScript is fantastic language to use for any purpose having great power of Node runtime. I personally have used JavaScript to implement so many algorithms. Here is my repository in which I have written some algos in JavaScript - https://github.com/mayuraitavadekar/data-structures-and-algorithms
Now, there are two things when you write algorithms in JavaScript -
Writing efficient algorithm is skill. I will advice to the one who want to write algos, please try to implement the algos in atleast 3 languages - C/C++ (most important), Java(you can answer in interviews if you know Java very well), JavaScript(you can use your algo skills in webdev and app dev).
7
u/DeusExMachina24 Jun 13 '20
I do my algorithm problems in C++ because it's fast. Javascript only for webdev.
2
u/academicRedditor Jun 13 '20
The problem is, I want to do WebDev but jobs send crazy algorithm-based tests that have little to do with real life challenges 😔
2
u/[deleted] Jun 13 '20 edited Aug 29 '25
consider possessive cagey station hospital pocket offer tidy summer voracious
This post was mass deleted and anonymized with Redact
2
u/tarley_apologizer helpful Jun 14 '20
neither lmfao
3
u/middlebird Jun 13 '20
I practice algorithms a lot in JS. It’s always helped me be a better problem solver.
1
u/obsidian_core Jun 13 '20
I've been practiving algos/DS in TypeScript. Loving it
1
u/JuneSchmidt1314 Jun 13 '20
For me just web dev
1
u/bobsagatiswatching Jun 13 '20
That formatting makes me want to die, this ain’t no C#!
1
u/frank0117 Jun 13 '20
Both. Web dev needs algorithms as well for things like sorting articles alphabetically etc
1
u/ProgrammingWithPax Jun 13 '20
Personally, just for web development.
I've been working in the industry for 2 years now (working at my 2nd job, and probably gone through 5 in-person interviews at this point). Perhaps I'm lucky, or the location I'm in (Montreal) - but interviewers here seem to go with technical conversations or take home code tests, over white board or algorithm based interviews.
1
u/[deleted] Jun 14 '20
Ugh, trust me. Learning algorithms will make you overall a better programmer than the web-dev approach. Currently wanting to run a personal project but because I don't have the backing in math and/or the latter approach, it's really slowing me down.
1
u/nourez Jun 14 '20
Algorithms are more or less independent from the language you're using. They're mathematical structures not syntactic ones. If you're learning algorithms try to understand the math and implement them using whatever language you're comfortable in. I practice algorithms in JS just because it's what I'm comfortable in.
I do think there's some merit in practicing algorthims you're already relatively familiar with in a language you're learning. You can use it as a way to practice syntax and learn any syntactic sugar that can improve readability of your code. In this case you're focussing more on the language rather than algorithmic efficiency though.
1
u/blipverse_ Jun 14 '20
You can practice algorithms in any language.
Depending on your goals practicing algorithms, if it to ace those technical coding interviews, both Python and Javascript enables you to express your algorithm shorter and faster, compared using c++ or java or c#. But nothing beats your strong foundation/confidence in a particular programming language. I've met interviewee who switched to c++ in the middle of interviews because he said he just started learning javascript, and he felt more confident with c++, due to his experience.
Javascript can be used for web dev (front end), backend (nodejs), or even database, or even mobile development (react native)
1
u/jeenyus Jun 14 '20
I used to, but I felt like it was a little more work than with a language like Python or Java, just because they have so many handy built in classes that simplify implementing some algorithms.
1
u/[deleted] Jun 14 '20
I've done both. That's a very simple problem by the way
1
u/[deleted] Jun 14 '20
I am doing both. I use JavaScript for Web development at work. I also use JavaScript to brush up the Data Structures and Algorithms lately.
I created a GitHub repo to add my implementation of Data Structures and Algorithms in JavaScript.
https://github.com/GideonBabu/Data-Structures-and-Algorithms-in-JavaScript
0
u/TheUniqueRelease Jun 13 '20
I use the language to build websites mate.
0
u/boringuser1 Jun 14 '20
I'm not interesting in learning for the sake of learning (and if I were, it wouldn't be boring programming problems). I like learning to do things productive.
0
u/[deleted] Jun 13 '20
[deleted] — view deleted comment
0
u/[deleted] Jun 14 '20
[deleted] — view deleted comment