Hacker News new | ask | show | jobs
by cgart 5620 days ago
I might make me here unpopular, but I would say: No, you did it wrong! Let me clarify on this: Yes, in CS you might not learn how to program well, this is true. However, when you study you get knowledge about several interesting computer science problems and how to solve them. You will see that problems later in your programming carrier however now you have a good background to solve them. Just a simple example: You given an array (let's say integeres). How would you remove all duplicates? A naive solution would be to check for every value, if there is more of this in the array. This has a running time complexity of O(n^2). The better way would be first to sort your array and then just iterate and remove all neighbours which are equal. This corresponds to O(nlogn) + O(n) complexity.

What I try to say, as a young "coder" you might not see all the troubles (in this case performance) you make when coding just straight away. You need to understand what you are actually doing, for this CS study gives you a good background.

The other really important point is: Startups fail with very high probability! CS diploma (or whatever this is in your country) gives you a solid background on which you can relay, when looking for a job position after your startup time. So, complete with your study is maybe a very classic way, however this is the most secure way for a long term.

1 comments

You can do even better by inserting each element from the array into a hashtable and either discarding or doing a deep compare on collisions. Ignoring the probability of collisions, this is O(n) at the cost of extra space.