Earlier quoted context omitted.
Hardly. How often is it that you can read an uncommented Python program that implements a tricky algorithm, and you can easily recover basic things like loop invariants?
For that you'd really want something like Dafny https://www.microsoft.com/en-us/research/project/dafny-a-lan... where your program doesn't even compile if you don't give it the right invariant.
Algorithms
141–150 of 163 posts
Re: Algorithms
#142Earlier quoted context omitted.
If the 'javascript hacker' doesn't learn about the difference between iterating through a list and binary searching, and how/when one is better than the other, yes it is a problem. I say this as a self taught programmer who studied a non-CS engineering well after learning about big-O.
Can you give me an example of when a front end developer would need to do either of those things? On the back end sure, but on the front end? Who in the world is using JS to iterate through a list or do binary searching on the front end?
When your UI is based on 25 megabytes of lists and maps, you do a lot of iterating and filtering. In our current implementation, it's possible, but difficult, to produce a case where it spends as much as a quarter of a second doing that in one go. But only the first time; if it takes that long (anything over 100ms), we memoize the call so the next time you get it for free. Binary search hasn't yet been required, but it's on our short list of performance improvements to apply once the backing data grows enough to require them.
Another project from last year was a tool to consume very large (250-300M) XML dumps from a very large, very expensive line-of-business system used by our finance department, and produce a wide variety of aggregations to simplify verifying the output of said very large, very expensive system, which I gather may not always be able to perform arithmetic correctly.
This one wasn't a team effort; it was one of those things where you get the spec on Friday afternoon and the deadline is Monday morning. (Not something I'd tolerate on a regular basis, but when the stakes are "it's this, or the SVP Finance sends a helicopter to retrieve the VP IT from a cruise liner"...) But it's also a frontend-only application, because installers take time to get right, too, and in any case something so simple has no need for a backend.
It takes about three minutes to fully parse, process, and report on a 250M XML dump. It leaks no resources, does not hang the UI thread, and presents a cute Bootstrap progress bar along with a table of running totals, so the user knows what it's doing. (Not gonna lie, I was showing off a little with the table. It's fun to watch numbers blur as they spin upwards in value!)
I concede that this tool doesn't do much work with long lists - mainly just the values of interest from the raw dump, which are several lists of maximum cardinality on the order of ten thousand, and the negligibly short lists used to maintain parser state information. But I do gather a certain impression that you're one of those sadly behind the times folks who still thinks of the browser/JS platform as a cute toy and a decent document reader, but not up to anything remotely resembling Real Computational Work, and I thought I'd include this example, as well as the other, in order to help disabuse you of that rather outdated notion.
Re: Algorithms
#143Earlier quoted context omitted.
Implementing: never. Evaluating: occasionally. In my opinion, an understanding of data structures is _much_ more useful for a data scientist than algorithms. Why should data scientists know about algorithms? Because data scientists are typically interviewed by computer scientists/software engineers, and that's what they tend to ask. I recently conducted many phone and on site interviews for a data scientist position.…
For software engineers, algorithmic complexity is a good filter for, say, Javascript hackers vs people with a university education in computer science. Just saying.
The idea of "Software Engineering" was born with the Software Crisis report in the 1960's.
Later on practicing SE's would study things like Design Patterns so things evolved over time.
EDIT: Software Engineers probably should know some relevant basics, but programmers could never come up with a "body of knowledge" like real engineers have.
It all depends what you work on and what new developments keep coming out...
Re: Algorithms
#144why 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…
Your issue isn't so much being wrong as lacking a coherent and relevant point in the first place.
Re: Algorithms
#145Earlier quoted context omitted.
For software engineers, algorithmic complexity is a good filter for, say, Javascript hackers vs people with a university education in computer science. Just saying.
Seems like a terrible filter. Some CS grads who slept through college will fail, while some non-CS grads who studied on their own will pass. Of course, to me, that would a feature, not a bug; but if you really want to filter on "university education in computer science", just read their resume instead.
Re: Algorithms
#146why 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…
Dictionaries, sets and lists can be nice though.
Go here( https://www.thecodingforums.com/threads/performance-sets-vs-... ) and search-find "Terry Reedy".
Re: Algorithms
#147Earlier 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…
Re: Algorithms
#148why 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…
Recommended reading: https://www.reddit.com/r/programming/comments/9nipa/joel_on_... ( https://www.joelonsoftware.com/items/2009/09/23.html )
http://www.paulgraham.com/avg.html
http://www.lessonsoffailure.com/tag/paul-graham/ <-- note "flamewar" in the title!
Re: Algorithms
#149Earlier quoted context omitted.
This is just my opinion and I'm sure it differs from others... Roughgarden's class is advance and expects mathematical maturity. You may find his course quite fast and rough if you are a beginner. Sedgwick's class is much easier. He is a bit boring and tries to use "real life" examples (in some instances) from the physical sciences to make the material relatable. This in my opinion detracts from the material. Also, h…
I'm going through Sedgewick's class right now. Is the MIT OCW's course math heavy? It lists "Mathematics for Computer Scientists" as a prerequisite, I am somewhat familiar with the material, but not in a very deep level. Should I take that one before?
Re: Algorithms
#150It's strange they didn't cover dynamic programming at all. IMO every course should include at least one classical example of dynamic programming. For example: https://en.wikipedia.org/wiki/Longest_increasing_subsequence https://en.wikipedia.org/wiki/Longest_common_subsequence_pro...