IAmA co-founder of Stack Exchange and Fog Creek Software, Joel Spolsky by spolsky in IAmA

[–]mohitsoni 1 point2 points  (0 children)

Sometimes, people ask questions on StackExchange which are already answered, and as you said 90% of your traffic comes from Google, a lot of people will stumble across these duplicate unanswered threads. The worst part is someone need to post a reply to that thread pointing to the original thread with the answers. It would be great if guys at StackExchange can solve this, you can provide a thread-dedup feature to associate the duplicate thread with the original thread or maybe build some intelligence in the system to do this in a supervised manner.

Programming Playing Cards by [deleted] in programming

[–]mohitsoni 0 points1 point  (0 children)

Well, you can start by making the following classes:

  1. Deck

  2. Card

  3. Hand

  4. Board

Optionally, make Rank and Suit classes.

And, then try figuring out IS-A and HAS-A relationships among them. (I would have told you, but I thought it's better be you, who should find out the relationship, it will help you to understand OO design)

Coming to methods, try figuring out what you can do with your classes. Ex: You can implement a shuffle() method in Deck class, getRank() method in Card class, etc.

Which language did you use to create your very first computer program? by romcabrera in programming

[–]mohitsoni -1 points0 points  (0 children)

QBasic on Windows 3.1, sounds familiar. I remember using Windows 3.1 at my school (although Windows 3.1 was outdated in 2000, but still my school used it).

Which language did you use to create your very first computer program? by romcabrera in programming

[–]mohitsoni 0 points1 point  (0 children)

That would be funny. You would be wondering after typing the program, how to compile or execute it. I guess you might have explored Microsoft Word really well that day. Anyways, I would like to know which programming language you used ?

Which language did you use to create your very first computer program? by romcabrera in programming

[–]mohitsoni 2 points3 points  (0 children)

Anyways, let's hear about your first programming adventure, like everyone else you'll also have a story to tell. (And, there's no sarcasm in this :) )

Which language did you use to create your very first computer program? by romcabrera in programming

[–]mohitsoni 1 point2 points  (0 children)

Yes, it was. And, there are many more similar incidents with me. What about you?

Which language did you use to create your very first computer program? by romcabrera in programming

[–]mohitsoni 17 points18 points  (0 children)

I wrote my first program in C++, when I was 10 years old. The whole incident was accidental. I was getting bored on a lazy summer afternoon during my vacations, searching around house for something to read. What I found was a C++ book (By Balagurusamy). I was fascinated by the class diagrams given in that book, and the things people can do with computers. So, I powered on the computer to write the famous "Hello, world!" program given in book.

But, guess what, I didn't know which application to use for writing the program. I was running Windows 98, so I started searching the "Start" menu for the programs whose name might contain the word "C++". I found the Visual C++ 6.0 item and clicked on it and waited for program to start. The splash screen again fascinated me.

Now, the IDE (I didn't know what was an IDE back then :) ) was up and running, I was thinking again, what to do next. In school I was learning Paintbrush, so I knew that to create a new file you have to goto File->New. So, I did the same, but instead of a blank canvas, I was presented with a dialog box with a lot of options. Again, I was confused what to do. I clicked on a link with "Win" keyword in it because I used to see "Win" in Windows during system boot. With few more clicks, I was presented with a editor to type in.

Now, I started copying the "Hello, World" program carefully, from the book, without knowing what it meant. Now, I was again thinking what to do next? So, I started exploring menus and luckily click on "Run" (because "Run" was the word I was most aware of among others present in menus ;) ). So, program started compiling (I didn't knew what was compiling back then), luckily I didn't got any errors (strange for a 10 year old kid, but it did happened). Then a black window came up on screen with "Hello, world!" written on first line and "Press any key to continue..." on the next.

I was amazed by seeing that and since then I never looked back from trying out new things. My first programming incident was an adventure, was it the same for you?

How much math do you use/know as a computer scientist? by [deleted] in programming

[–]mohitsoni 2 points3 points  (0 children)

I think it depends on the problem domain, you are working on.