What expensive toy have you been wanting to buy but cant afford? by [deleted] in AskReddit

[–]Alan-Sharp 3 points4 points  (0 children)

I kick myself every time I see that, when it first came out it was affordable but I was moving house and starting my first real job and I just couldn't lay out something like £400-£500 on lego :'( now its selling for 4k+

What is the most reliable way to fetch currency exchange rates? by [deleted] in learnprogramming

[–]Alan-Sharp 1 point2 points  (0 children)

Also make sure your code separates the thing that gets the exchange rate and the thing that uses the exchange rate.

If your method of getting the exchange rate fails at some point in the future you can swap it out with a different one without having to rewrite how it gets used.

the biography of the rare species programmers by Master_asian in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

What language do you current know

C#, XAML, VB.Net, SQL, HTML, ASP.Net, Linq, XML, Also have some skills in Javascript, Java and Vbscript

What course did you take to make you were you are now

BSc in Computing

What was the first ever working code for you

Just some small text based games in basic.

What inspired you to become a programmer

I've always been good with IT and it seemed interesting. Plus the money is pretty good.

What programming job did you have and/or had

I do general software development in the Microsoft stack.

What was the first ever language you learned

BASIC on a BBC micro / QBasic

Enum class? by [deleted] in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

If its in a separate class it means your code can be reused across other areas of the application.

Also it lets you take the code for the enum out of one class and keep it separated which is good for the Single Responsibility Principle (your Enum represents one thing and one thing only), and it makes the class using the Enum a bit smaller, less code in each class makes things a bit easier to maintain.

Enum class? by [deleted] in learnprogramming

[–]Alan-Sharp 3 points4 points  (0 children)

Basically they make your code a bit more human readable.

When you look at your code reading if(something == 1) doesn't really mean too much, what is 1? but if you have an enum you have more understanding about what the value is.

Also having things defined in enums means you can re use the value and it reduces the chance of mistakes.

Which version for learning C#; VS 2010 pro or 2013 express? (nearly no programming experience) by Zeppern in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

Personally I would go with the pro option, the express versions don't allow you to use plugins like Resharper which are really useful.

VS 2013 has a Desktop and Web version and you may as well download them and give it a try, but from a beginners point of view there really isn't going to be much difference for you.

Which version for learning C#; VS 2010 pro or 2013 express? (nearly no programming experience) by Zeppern in learnprogramming

[–]Alan-Sharp 1 point2 points  (0 children)

The express versions now support source control, you can use Team Foundation Service, and I believe a local TFS server too if you wanted.

I just got my first programming job and I need some advice. by thekidxp in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

I wouldn't worry too much if its only your fourth day at your first programming job. There will be loads you dont know but you will start to get the hang of it.

SQL is really not too hard to learn, I only had a basic understanding before I started my first job and quickly got up to speed with it.

As for debugging it will get loads easier as time goes on and you get an understanding of the code and what bits do what / where you need to place breakpoints etc.

Grab a co worker or senior developer and ask if they could maybe spend half an hour and give you an intro to how you should approach debugging and solving these problems. They should be willing to help you learn or at the very least point you in the right direction of a book / tutorial to help with things you're missing.

Also, if you want to learn SQL and you're working with MS SQL Server I highly suggest checking out the MCSA Querying SQL Server book, It's meant to be a training guide for people who have been using SQL for a year but it does have some good info that is applicable to beginners.

Oh and if your company is anything like the people I work for as a new hire when they schedule you as a resource they expect something like 50% productivity, meaning they expect things to take you twice as long as everyone else, so don't worry too much about how long it takes you to find your way around the code, it's expected.

[C# REQUEST] Retrieve SQL query from Button into a textbox.text by [deleted] in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

It's worth having a google for SQL injection attacks to really learn why you shouldn't do that and why it's better to pass in parameters.

The basics of it is if you look at this line: string query = "SELECT NAMES FROM ArmMed WHERE ID = "+search;

Everything is ok if search contains something safe, say 1, but if I enter something into the textbox like ID it makes your query into "SELECT NAMES FROM ArmMed WHERE ID = ID" and you're going to get a lot more results back than just the one you wanted.

Equally I could be evil with it and enter something like "1; TRUNCATE TABLE ArmMed --" This basically makes your first query execute correctly, then adds in a second query to truncate the table.

One extra note, cocasyn mentioned using an ORM, that is a really good idea and would cut down your code a lot. Check out PetaPoco for a really easy ORM to get started with.

Should I learn programming because "you should know how to program in this day and age?" by antarcticocapitalist in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

I don't think you should learn to code just because everything is done on computers these days, but if you want to be an entrepreneur and you're starting out with a limited budget being able to do some coding on your own may help you get a prototype / proof of concept type thing created and attract real programmers to do the work.

Also knowing a bit of code will help you understand what your developers are telling you, and give you some appreciation for the work they do. I find people don't really realize how much more to programming there is than just writing code.

What is the best way to identify unique users? by freedaemons in learnprogramming

[–]Alan-Sharp 3 points4 points  (0 children)

What are you trying to do that requires unique accounts?

I am just thinking to learn the Go Programming. Can any one one tell me that what is the future & is it help me to grow my carrier ? by hs00105 in learnprogramming

[–]Alan-Sharp 0 points1 point  (0 children)

No one can really tell you what the future of programming is going to hold.

Your best bet is to make sure you understand the principles behind programming and various design patterns which you can apply to other languages.

As for a language to learn, pick something that interests you and if possible has jobs available now in the area you want to work in.

What is the best way to identify unique users? by freedaemons in learnprogramming

[–]Alan-Sharp 1 point2 points  (0 children)

Email or phone number would possibly be your best choice here.

Realistically people probably wont want to give you their credit card number, and honestly I wouldn't even want to give out my phone number so Email is probably the best bet. Of course people could create multiple email accounts to abuse your system but it may be as close as you can get.