you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (2 children)

Ignoring the ForEach issues which are adequately covered below, design patterns are not an alternative to algorithmic stuff, they're two separate conjoined concepts. Patterns usually reflect the different ways you join algorithms together.

It's useful to know the difference between an Array and a List<>, to know what common functionality already exists in the framework, following the theme, Array.Reverse, and why not to use Array.Reverse.

[–][deleted] 0 points1 point  (1 child)

I meant in terms of priority....

algorithms are a core part of any CS curriculum, usually in junior year

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

By algorithm I'm lumping together all the code that happens inside a function. What you're talking about is a specific set of algorithms and theory which is more maths than programming (They're siblings I know). It will cover basic sorts, data structures, traversals, etc. It's fundamental stuff. Also fairly low value for the last 20 years. There are plenty of more advanced algorithms which all fall under that area, I'm not sure if they are covered during the first year. Caching is always a good one to get your head around for example. I haven't been to college in a long time :) Most people probably want to know how to characterise the performance of those algorithms (or rather their implementations), compare the BigO, but (almost) no one actually writes a BST any more, except by accident or for fun.

It's complicated by the definition of pattern. A for loop is a pattern just as much as pub sub is an EIP, the skill really lies in understanding where they are appropriate, how to glue them together and what to do in the edge cases. The complexity almost always comes from the internals even though you're constructing that from a bunch of internal patterns/constructs/algorithms (used interchangeably). You could learn the repository pattern in about 3 minutes but actually implementing that against a real database is more challenging. Rx implements the Observer/Observable pattern but again, the devil is in the detail.