static void Main(string[] args){Console.WriteLine(System.DateTime.Now);Console.WriteLine(System.Environment.Mac…Console.WriteLine("Hello {0} what would you like to know", System.Environment.UserName);Console.WriteLine("type HELP for help");

But I don't think i'm going in the right direction.I shouldn't even need to create a variable for this correct?

how can I get console.readline() to accept text and return results? i'd like to get HELP to list all the commands users can put in there.

your if statement looks wonky:

Code:

static void Main(string[] args){Console.WriteLine(System.DateTime.Now);Console.WriteLine(System.Environment.Mac…Console.WriteLine("Hello {0} what would you like to know", System.Environment.UserName);Console.WriteLine("type HELP for help");string name = Console.ReadLine();if (name.ToUpper() == "SYSTEM") Console.WriteLine("OS Version {0}.", System.Environment.OSVersion.VersionString);else if (name.ToUpper() == "HELP") { //... do stuff}}

You need to assign the value being returned by Console.ReadLine() to a variable, otherwise, it's returning a value to nowhere.

static void Main(string[] args){Console.WriteLine(System.DateTime.Now);Console.WriteLine(System.Environment.Mac…Console.WriteLine("Hello {0} what would you like to know", System.Environment.UserName);Console.WriteLine("type HELP for help");string name = Console.ReadLine();if (name.ToUpper() == "SYSTEM")Console.WriteLine("OS Version {0}.", System.Environment.OSVersion.VersionString);else if (name.ToUpper() == "HELP") {//... do stuff}}

You need to assign the value being returned by Console.ReadLine() to a variable, otherwise, it's returning a value to nowhere.

You'll notice that DJSpin80 used code tags with his code. I've edited your original post, but we'd appreciate it if you were to do it in the future. It makes it much easier for people to follow your code and keeps the forums looking quite a bit nicer.

He could get it from GC, but that's a WHOLE 'nother topic. I'm actually curious as to how I would be able to do so.

Yeah, I guess that is a pretty big jump in complexity. =)

The short answer is that you can't be assured of recovering a value before it is reclaimed by the garbage collector. However, in some interactive languages there is a facility for "reusing" a form or value. In the Lisp REPL, the last form is assigned to + and the last value to * (There are separate namespaces for functions and symbols in CL btw). This can go back three levels, so technically, it isn't possible for the garbage collector to reclaim a form or value until four forms or values later. This doesn't really have anything to do with gc per se; It is just a handy thing to have available when doing interactive programming.

I can't remember what this is called... damn, must be getting old, but I suspect there might be a similar feature in the Ruby read-eval loop.

Code:

CL-USER> (read)"not assigned!" <== I typed this in"not assigned!" <== The repl returned this valueCL-USER> * <== reproduces the last value"not assigned!" CL-USER> ++ <== reproduces the 2nd to last form used... the last form would be the *(READ)CL-USER> * <== the ++ returned (read) so * now also returns (read)(READ)

xs0u1x -- I forgot to mention what I think is one of the best write ups on learning how to program. It is Teach Yourself Programming in TEN Years by Peter Norvig, who is the current director of research at Google. One of the best things about the article is that there isn't even a single line of code! It is a must read item if you want to really improve as a programmer.

Peter Norvig wrote:

The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again. There appear to be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more years before he began to produce world-class music.

One of the best places for programmers to perform this "deliberative practice" is at TopCoder. Initially, You'll be in pretty far over your head, but stick to the level 2 easy problems and before long, you'll have a decent understanding of the language and libraries. You'll have solutions that you can use as a guide and will benefit from their automated testing when you've done something wrong (and you'll be amazed at all the different ways a seemingly simple problem can fail!). Soon you'll be ready to start tackling tougher problems that will require you to learn about algorithms and data structures. It is a great resource -- take advantage of it!

xs0u1x -- I forgot to mention what I think is one of the best write ups on learning how to program. It is Teach Yourself Programming in TEN Years by Peter Norvig, who is the current director of research at Google. One of the best things about the article is that there isn't even a single line of code! It is a must read item if you want to really improve as a programmer. !

Thank you for the tips gentleman. Just ordered the book 10 minutes ago lol. I will definitely be visiting this forum more often.

funny you mention homework I actually just started school for an associates specializing in programming. but I haven't made it to the more interesting(programming related) classes yet.

Assuming you guys hold real world development jobs, what are the jobs like? as in, is your code peer reviewed alot and do you get alot of micromanagement on your postion? or do you get alittle bit of freedom as a developer? I have an IT background and currently work in IT, but I think development is the next step for me in my career as i'm looking to move on from tech support.

Assuming you guys hold real world development jobs, what are the jobs like? as in, is your code peer reviewed alot and do you get alot of micromanagement on your postion? or do you get alittle bit of freedom as a developer? I have an IT background and currently work in IT, but I think development is the next step for me in my career as i'm looking to move on from tech support.

funny you mention homework I actually just started school for an associates specializing in programming. but I haven't made it to the more interesting(programming related) classes yet.

Sweet! Good luck with that! One thing Crash, myself and Gadget will agree on: challenge yourself, look at TopCoder stuff, even if it's the easy ones.

Quote:

Assuming you guys hold real world development jobs, what are the jobs like? as in, is your code peer reviewed alot and do you get alot of micromanagement on your postion? or do you get alittle bit of freedom as a developer? I have an IT background and currently work in IT, but I think development is the next step for me in my career as i'm looking to move on from tech support.

Depends on the company. I'm one of one .NET developers in my company. The company culture determines a LOT of things. I have a few friends in startups where they work hard and play hard. They have office games, happy hours, you can bring your dog into work...but they work 12 hour days. I work a VERY predictable 8-hour days (40 hour weeks). When I worked at a big bank, my code was peer reviewed a lot. We wrote gobs of documentation, and I was micromanaged a lot. Now, where I am, my boss trusts that my decisions reflects the overall team goal. I meet with my boss twice a month, at best. I get a LOT of freedom, so as long as I get my work done and I communicate things to my boss. Otherwise, the company culture will dictate it.

Honestly though, I love it. I wouldn't trade my job for anything. Developers worldwide - open source or not - have one thing in common: you gotta love this stuff. You gotta love the challenge, otherwise, you'll honestly fail. You'll need to learn to embrace constraints and limitations, because 99% of the time, you're working with it. But you also gotta embrace other platforms and languages. The one advice I'll give you before you join the wonderful world of developers: find a user group in your area that focuses on what language you want to learn and stick with them. Talk to them, hack with them (in a good way), and learn from them. You'd be surprised what you can learn from them, and how a network of other developers can benefit you.

I was poking around that TopCoder site and I don't quite get what you mean when you say "level 2 assignments" I've been looking specifically for that and can't seem to find anything. Do I need to register for this?

I was poking around that TopCoder site and I don't quite get what you mean when you say "level 2 assignments" I've been looking specifically for that and can't seem to find anything. Do I need to register for this?

Yes you do need to register. I'm not on my home PC, so I don't have access to TopCoder (unfortunately, work blocks a lot of what I like to go to, which sucks).

However, one place I go often is Code Kata. They have a lot of great reads and articles, plus programming exercises! It's very metaphysical, so be prepared to think rather than code. It's the kind of stuff that hones developer prowess.

Thank you for the tips gentleman. Just ordered the book 10 minutes ago lol. I will definitely be visiting this forum more often.

Assuming you guys hold real world development jobs, what are the jobs like? as in, is your code peer reviewed alot and do you get alot of micromanagement on your postion? or do you get alittle bit of freedom as a developer?

It varies considerably... In general, academia/academics have a ton of freedom. Defense company jobs have tons of bosses (think Office Space, but most of the bosses are actually dumber). Software companies have varied the most in my experience. It would be kind of interesting to make a multi-dimensional plot of the various cultural/work 'factors', for lack of a better term, and see how different companies and industries cluster.

I was poking around that TopCoder site and I don't quite get what you mean when you say "level 2 assignments" I've been looking specifically for that and can't seem to find anything. Do I need to register for this?

Unfortunately, their business goals/operations have made it harder and harder to just find "programming problems" on the site during the past couple of years. After registering, go directly to http://www.topcoder.com/tc and use the menu on the left side to navigate around the site. There are a few different types of competitions, but being a beginner, I would recommend just working through the algorithm problems during the Single Round Matches (SRMs). SRMs have two divisions with Division 1 problems being harder than Division 2 problems (and the competitors considerably more experienced). Each division is given three problems to solve during the contest, followed by a challenge section (where you try to find errors in code submitted by other people), then a final point tally. Your score is based on how quickly you correctly solve problems relative to the other people in your division. Often the Division 1 easy problem is either the hard or intermediate problem for Division 2. The site accepts submissions in C++, Java, C# and VB. During the Google Code Jam, you can also submit in Python (I have no idea why they don't offer Python throughout the year during the regular contests). SRM problems are a good start, but after you've had some CS courses, you might find the Marathon Match problems more to you liking... the CS theory necessary for these problems is going to be way over your head at the moment though.

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum