Live data from Hacker News

Algorithms

khanacademy.org

51–60 of 163 posts

Re: Algorithms

#51
post #49
post #40

Earlier quoted context omitted.

Where is javascript in this medieval court?

JavaScript is the archbishop, evangelizing the holy trinity of React, Node.js and MongoDB.

At least one of those would be on the receiving end of any technology holy war.

Re: Algorithms

#52
post #40
post #36

Earlier quoted context omitted.

If Python is the king, C is the court jester juggling knives. Done well it looks amazing, elegant, and efficient, but in the wrong hands you'll lose your hands.

Where is javascript in this medieval court?

Shoveling horse shit in the stables.

Re: Algorithms

#53

why python???? ... any language with functions will do. I mean just create a java class with all public static functions if you want it to work like python (global functions). Its really language agnostic. Your answer will be a number a string or a list of things. All languages can do that. Im making an explicit opinion that python is no better than any other language for implementing algorithms. HN please prove me w…

One thing that I like about Python implementations of algorithms is less thinking about types. When I implement my sort algorithm, I just need to say > or Not a Java expert, can you do something similar with Java? Maybe with generics?

Re: Algorithms

#54
post #2

as someone who doesn't know much about this and is trying to join the tech community, what will I achieve through this?

exposure to more solution techniques into programming problems that you might run into most likely in an interview session.

A lot will say learn this as it is the "core" of programming, but in industry practice I've seen using pure functions (functions that return the same result when the same parameter is passed in) is becoming more commonplace than having a trickier function that mutates a variable differently during each iteration, making it harder to reason about program state. Algorithmic problem solutions usually involve non-pure functions that are not intuitive until you've seen them before. Front-end UI is better built using several pure functions.

Re: Algorithms

#55

why python???? ... any language with functions will do. I mean just create a java class with all public static functions if you want it to work like python (global functions). Its really language agnostic. Your answer will be a number a string or a list of things. All languages can do that. Im making an explicit opinion that python is no better than any other language for implementing algorithms. HN please prove me w…

I agree with this. For me, I'm using the language I'm currently using at work (C#) to learn them better. If I'm going to be tested (in tech interviews) in the language I know my bet is that it'd be better to know the C# way of doing it and knowing how to implement it using C# conventions. I haven't interviewed yet, but this is just the hunch I have if the goal is to do well in a tech interview

Re: Algorithms

#56

why python???? ... any language with functions will do. I mean just create a java class with all public static functions if you want it to work like python (global functions). Its really language agnostic. Your answer will be a number a string or a list of things. All languages can do that. Im making an explicit opinion that python is no better than any other language for implementing algorithms. HN please prove me w…

One thing that I like about Python implementations of algorithms is less thinking about types. When I implement my sort algorithm, I just need to say > or Not a Java expert, can you do something similar with Java? Maybe with generics?

Yes, generics in Java or templates in C++ is how any algorithms library would handle this. Any type passed into such a function needs to possess the required operators and functions or it will fail to compile/run.

Re: Algorithms

#57

If you have the KA app installed this link opens in it! Which is great, except it takes you to the main list of subject matters, and algorithms isn't in there. So I'm not able to view this link on my iPad unless I uninstall KA?

There should be a Safari action in the top right where usually you'd have the battery indicator

Re: Algorithms

#58

Earlier quoted context omitted.

Data structures and algorithms are foundational topics in computer science. While they can seem daunting to beginning programmers, they become very important as you progress into writing more advanced programs. Also, the interview process for software engineers at most companies ask about them almost exclusively.

> they become very important as you progress into writing more advanced programs As someone with a Computer Science degree I can say that the only times I have ever used any of the algorithms I learned directly was when writing low level C and GoLang. I'm willing to bet 90% of programmers... even those that right "advanced" programs do not use them day to day. Every algorithm and data structure worth anything has bee…

You use them every day, you probably just don't formulate it into a "is this an algorithms problem?"

Very few days do I avoid evaluating what kind of/depth of loop (if any at all!) is needed to generate an output.

Re: Algorithms

#59

why python???? ... any language with functions will do. I mean just create a java class with all public static functions if you want it to work like python (global functions). Its really language agnostic. Your answer will be a number a string or a list of things. All languages can do that. Im making an explicit opinion that python is no better than any other language for implementing algorithms. HN please prove me w…

One thing that I like about Python implementations of algorithms is less thinking about types. When I implement my sort algorithm, I just need to say > or Not a Java expert, can you do something similar with Java? Maybe with generics?

I'm no expert but due to the language I think you need to specify types somewhere. It just offloads it to your test code as opposed to the algorithms.

With python, your algorithm will work with the primitives without specifying either in the algorithm or test code. You only need to specify type, i.e maybe a new class and definitely instantiation, if you want to use something more abstract.

This would be true of Ruby and other dynamically typed languages. For beginner algorithms courses at least, a dynamically typed languages makes more sense since the algorithms taught are only clouded by typing. Complexity theory still applies and what not.

Maybe if learning algorithms that do heavy crunching, a lower level language, probably with static types, may be used but by that point you're not going to mind type info.

Post reply on HN