CHANGSTAR: Audiophile Headphone Reviews and Early 90s Style BBS

Main Deck => Discussion for Registered Members Only => Topic started by: Deep Funk on May 18, 2015, 04:05:39 PM

Title: Learning C#, Tips?
Post by: Deep Funk on May 18, 2015, 04:05:39 PM
Buenos Días Piratas!

Recently I seriously started learning code. I started with HTML and CSS and now I am adding Javascript and C#. I enjoy the first three.

Thing is, I find C# fucking annoying. It is like writing a text message but the texting software keeps interfering with the writing. Compared to Javascript I find C# rigid. It reminds me of the "soup nazi" from Seinfeld, "no soup for you!"

Please do not direct me to the Microsoft tutorial, there are better videos on Youtube.

Do you have tips or experience?
Title: Re: Learning C#, Tips?
Post by: Tari on May 18, 2015, 04:20:36 PM

I'll give you a hint.  C# is code for D.
Title: Re: Learning C#, Tips?
Post by: ultrabike on May 18, 2015, 04:22:58 PM
I'm half ass learning it too. I'm more help in C++.
Title: Re: Learning C#, Tips?
Post by: lm4der on May 18, 2015, 04:25:21 PM
c# certainly is rigid compared to javascript.  I can understand finding that annoying.  The trade off is that for larger coding projects/systems, having a strongly, statically typed language offers a lot of benefits.  Not only does it protect against errors that would otherwise only be caught at runtime, but the tool chain, like the IDE, understands the types, and this makes finding references to fields, methods, classes, type hierarchy, refactoring, etc a breeze. 

Javascript can in many ways can be pretty tricky, trickier than c#.  But in the end, both of these tools have a place.
Title: Re: Learning C#, Tips?
Post by: lm4der on May 18, 2015, 04:29:55 PM
I'll give you a hint.  C# is code for D.

I think this joke fell flat.  D flat.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on May 18, 2015, 04:41:30 PM
I will trial and error my way through the code in Visual Studio. I first used Xamarin but the user interface became a mess after an update.

Javascript is tricky. Once you get used to it though it is quite intuitive. 
Title: Re: Learning C#, Tips?
Post by: Tari on May 18, 2015, 05:10:05 PM
I think this joke fell flat.  D flat.

Naturally.
Title: Re: Learning C#, Tips?
Post by: Claritas on May 18, 2015, 05:29:59 PM
" C♯ or B♭"  -- bumper sticker
Title: Re: Learning C#, Tips?
Post by: spoony on May 18, 2015, 06:32:57 PM
Thing is, I find C# fucking annoying. It is like writing a text message but the texting software keeps interfering with the writing.
Yes, and the same can be said about Java, the issue isn't with the language itself, it has more to do with the library design philosophy and language idioms (default private members, design pattern overuse, overly verbose naming and typing). If you want to learn for the sake of learning, a good choice would be a functional language such as Haskell or Lisp, the code tends to be terse and elegant and a challenge to write, it's a very enlightening experience. Otherwise just stick to the IDE / Text editor with the best autocomplete engine and static code analysis, it will save you a lot of time.

P.S. Python is always useful and fun.
Title: Re: Learning C#, Tips?
Post by: smitty1110 on May 18, 2015, 06:37:47 PM
You might also want to check out Ruby, less strict and verbose, and with lots of web design libraries that will work well with the rest of your skill set.
Title: Re: Learning C#, Tips?
Post by: drfindley on May 18, 2015, 08:29:40 PM
Thing is, I find C# fucking annoying. It is like writing a text message but the texting software keeps interfering with the writing. Compared to Javascript I find C# rigid. It reminds me of the "soup nazi" from Seinfeld, "no soup for you!"

C, C#, C++, Objective-C, Java, Swift,  and most compiled languages in general are going to be this way. The stricter rules allow for the compiler to make things faster and better write things for the processor.

I find the best way to learn a new language is to have either a project I really want to do in it or to do a bunch of dumb little throw away programs to get familiar with the nuances. There seem to be some great resources if you search for "Learn C#".

None of these will make the strictness of the language any less, but as it becomes familiar, you'll grow to appreciate how it saves you from making stupid mistakes which are harder to debug on a live running system.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on May 18, 2015, 08:33:15 PM
I am learning and practising HTML, CSS and Javascript on Codecademy and C# on my own.

When I am done with the first two and confident enough with Javascript I am considering Ruby or Python. I love the creative freedom HTML and CSS can give you. Javascript goes beyond. Once I finally nail the basics on C# I buy a recent enough reference book and work from there.

Despite the occasional syntax headaches there is much to enjoy and I do not want to become a powerless consumer in the face of IT. One of my best friends wants to build a project with me and he is pretty professional. I consider myself lucky  :)p8
Title: Re: Learning C#, Tips?
Post by: DefQon on May 19, 2015, 12:36:58 AM
Considered learning Java yet?

I hate it.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on May 19, 2015, 02:43:32 AM
Considered learning Java yet?

I hate it.

It has been on my mind. First C# before I get too many syntax headaches  p;)
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 10, 2015, 10:52:59 AM

P.S. Python is always useful and fun.

Considered learning Java yet?

I hate it.

I recently started on Java. I first got scared with the Android Studio IDE, too much for me, information overload. After that I tried the Eclipse IDE and now I am trying the Netbeans IDE. Java has it quirks but I will learn to understand them. 

After Javascript confusion (it can be extremely confusing) and C# headaches (so much editing, debugging and reading) I am more patient and more ready to do things step by step, trial and error with a Stackoverflow account for looking things up.

I now work with the "Sam's Teach Yourself In 24 Hours" book. Great book and it really helps me out.

P.S. I enjoy Python. It is really fun to play and practise with.
Title: Re: Learning C#, Tips?
Post by: spoony on June 10, 2015, 03:23:38 PM
I think IntelliJ is still the best Java IDE out there by a mile, there's a free edition.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 12, 2015, 09:04:45 PM
I think IntelliJ is still the best Java IDE out there by a mile, there's a free edition.

Tried it, I like it but for now I work in Netbeans.

Now I have to get this GIT thing up and running and code sharing for the win.
Title: Re: Learning C#, Tips?
Post by: Marvey on June 12, 2015, 09:16:30 PM
Can you take a class? You are moving from scripting to a real programming language. HTML / CSS are not programming languages. They are mark up languages. Another alternative is simply the non-object oriented C. It depends what you want to do. Also, while some people can script or do HTML, but will never be able to handle real programming. It's like going from little league baseball to the professional leagues. Another alternative is to buy a book and have the patience to go step by step through every page at a snails pace to learn. As YouTube videos on how to program in C# makes as much sense (actually even less sense) as YouTube videos on how to write algorithms to plot CSDs derived from FFT transforms on impulse response data from ARTA's file formats.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 12, 2015, 09:23:54 PM
Can you take a class? You are moving from scripting to a real programming language. HTML / CSS are not programming languages. Another alternative is simply the non-object oriented C. It depends what you want to do. Also, while some people can script or do HTML, but will never be able to handle real programming. It's like going from little league baseball to the professional leagues.

A bit of guidance (my best friend), preparations (Youtube & PDF hunting) and patience go a long way. Classes exist but I have to teach myself most things through trial and error. There are some good PDFs floating on the internet to get started.
Title: Re: Learning C#, Tips?
Post by: Marvey on June 12, 2015, 09:30:35 PM
I recommend a disciplined an organized approach. Scattered YouTube videos, PDF files, and trial and error are only going to get you frustrated real fast with a language like C#., especially if you don't have a lot of experience writing programs, doing abstract math proofs, or using other object based languages. (HTML / CSS / Scripting) does not count.

Practice is the most important in learning a language. Gotta first write bullshit programs like Hello World, calenders, list sorting programs. A lot of bullshit programs that don't do anything. The more you practice the better you get. Takes years to be a functional programmer. Takes years and an inherent knack of it to be a good one. It's like playing a musical instrument, not an easy one, but a hard one like violin. C# has all the tedious syntax issues of C, some of the nuances of assembly, and the abstractions of all other object based languages.

I suggest getting to the point where you can write your first junior Monopoly game (smaller board, simple rules, and only for one player) using ascii art as a first milestone.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 12, 2015, 09:42:47 PM
I recommend a disciplined an organized approach. Scattered YouTube videos, PDF files, and trial and error are only going to get you frustrated real fast with a language like C#., especially if you don't have a lot of experience writing programs, doing abstract math proofs, or using other object based languages. (HTML / CSS / Scripting) does not count.

Practice is the most important in learning a language. Gotta first write bullshit programs like Hello World, calenders, list sorting programs. A lot of bullshit programs that don't do anything. The more you practice the better you get. Takes years to be a functional programmer. Takes years and an inherent knack of it to be a good one. It's like playing a musical instrument, not an easy one, but a hard one like violin. C# has all the tedious syntax issues of C, some of the nuances of assembly, and the abstractions of all other object based languages.

I suggest getting to the point where you can write your first junior Monopoly game (smaller board, simple rules, and only for one player) using ascii art as a first milestone.

That is largely my plan. The learning books I work with follow your reasoning. Baby steps, notes, baby steps and more notes for me. I can fast track this process as long as I focus.

Thanks for the advice.
Title: Re: Learning C#, Tips?
Post by: Marvey on June 12, 2015, 09:48:19 PM
Oh I forgot to mention... for what purpose?

The platforms and development environments are probably even more important than the language these days. .NET, Java SE/EE, etc. The reason is that a lot of functions and routines that we used to have to look up in algorithm books are built-in to the libraries. Saves a ton of time! This why some people I know won't hire .NET programmers. It's because 98% of .NET people are idiots who couldn't come up with working logic or algorithms to solve a simple problem, like finding the shortest path from point A to point B in a maze.

Actually, the maze program would be another good practice. Write a program that presents a 20x20 matrix. Insert X number of random blocks. Write program in C# to find shortest path from 1,1 to 20,20 (assuming that path is not blocked by randomly placed blocks.) Also, do this in a object oriented way. Don't cheat and write a C program. Write a real C# program.

Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 12, 2015, 11:11:17 PM
Oh I forgot to mention... for what purpose?

The platforms and development environments are probably even more important than the language these days. .NET, Java SE/EE, etc. The reason is that a lot of functions and routines that we used to have to look up in algorithm books are built-in to the libraries. Saves a ton of time! This why some people I know won't hire .NET programmers. It's because 98% of .NET people are idiots who couldn't come up with working logic or algorithms to solve a simple problem, like finding the shortest path from point A to point B in a maze.

Actually, the maze program would be another good practice. Write a program that presents a 20x20 matrix. Insert X number of random blocks. Write program in C# to find shortest path from 1,1 to 20,20 (assuming that path is not blocked by randomly placed blocks.) Also, do this in a object oriented way. Don't cheat and write a C program. Write a real C# program.


Purpose? A year ago out of curiosity I tried HTML. I liked the fact that I could create something new out of a few lines of code.

The keyword here is "create" and that is my purpose. I want to become a professional software developer. The PC, be it a desktop, laptop or smart device has integrated itself in my life. I enjoy creating something new from scratch with some lines of code, be it for a haiku or a software application. If the haiku-software application reference sounds weird, try Python.

The project goal I have now is to create maths game application in Java. I will make a note of your tips.
Title: Re: Learning C#, Tips?
Post by: lm4der on June 13, 2015, 04:44:37 PM
It's because 98% of .NET people are idiots who couldn't come up with working logic or algorithms to solve a simple problem, like finding the shortest path from point A to point B in a maze.

Actually, the maze program would be another good practice. Write a program that presents a 20x20 matrix. Insert X number of random blocks. Write program in C# to find shortest path from 1,1 to 20,20 (assuming that path is not blocked by randomly placed blocks.) Also, do this in a object oriented way. Don't cheat and write a C program. Write a real C# program.

I'm not sure what the definition of a "simple" algorithmic problem is, but shortest-path problems aren't really trivial.  There's a lot of graph theory that goes into the good solutions.  Now simply solving the maze, disregarding shortest path, that should be easy.  Kind of like sorting algorithms.  Anyone should be able to one-off an algorithm that sorts, but to do it efficiently is something that people have put a lot of research into.
Title: Re: Learning C#, Tips?
Post by: altrunox on June 13, 2015, 05:10:41 PM
Purr1n, did you work as a programmer/dev. before going to EC?
Title: Re: Learning C#, Tips?
Post by: Marvey on June 13, 2015, 10:40:08 PM
I'm not sure what the definition of a "simple" algorithmic problem is, but shortest-path problems aren't really trivial. 

Yes they are. Depth search first and breadth search first. The algorithms are simple, among those learned in algorithms 101.
Title: Re: Learning C#, Tips?
Post by: Marvey on June 13, 2015, 10:58:12 PM
Purr1n, did you work as a programmer/dev. before going to EC?

Up to 2002 I did programming work, although less consistent from 1999 onward because I got into web infrastructure and security. x86 assembly, C, VB, Enterprise Java, .NET (early). From 2003, was audit / ethical hacking, although I did a short stint as IT Director at a small community bank for a few years.

I still program for fun. For example at my last horrible job, which only lasted one year, the decision makers decided to implement an audit management system for $100,000 per year. Unfortunately, the system sucked so bad, that everyone worked in Excel anyways, and then spent one or two weeks after every audit copying stuff over. The UI was from hell.

I wasn't going to have any of that so I wrote a bot to screen scrape the content Excel files and paste data over to the system, including checking the right boxes, reformatting according to certain logic (it wasn't one-to-one between Excel and the system). Also, I wrote programs that took "core dumps" (antivirus reports, IDS, patch reports, etc.) and reformatted them into handy "audit process" tables according to our formal audit documentation standards. 

I only pretended to be busy during these times - and no way I was gonna tell anyone I could speed up the work by 30%. (Since in big corporations, VPs protect their turf and their budgets, mainly because they can go on power trips and skull-fuck people who they think have crossed them. I'm mean, really nothing else to do, and some people associate their work with their lives.)

I wrote worms and stuff, for fun. Now I write bots for games. I wrote a bot for SWTOR so I only needed to click the mouse button to attack (most of the time). Would screen-scrape / OCR numbers / cooldowns to choose the right attack / chain for max DPS.

I write a few custom hacking tools now and them. Been doing ethical hacking since 2003.
Title: Re: Learning C#, Tips?
Post by: lm4der on June 13, 2015, 11:00:16 PM
Depth search first and breadth search first. The algorithms are simple, among the learned in algorithms 101.

Oh yeah, good call. Single source directed graph is just a tree.
Title: Re: Learning C#, Tips?
Post by: altrunox on June 13, 2015, 11:58:58 PM
eeew VB, I had to do some stuff with it on my job, damn, I sucked at it  :vomit:

Nice, so you're a white hat hacker  ;D

Still don't know exactly what path I'm going to take after finishing the college, but back-end programming and security stuff are my favorite ATM.
Title: Re: Learning C#, Tips?
Post by: drfindley on June 14, 2015, 07:32:15 AM
I write a few custom hacking tools now and them. Been doing ethical hacking since 2003.

Have you ever been tempted to do software work in audio? Sometimes I'm tempted to write a non-hateful decent music player (I hate all of them, yes even that one you love, I'm afraid). Other times I'm tempted to hack my Rag to wire up a bluetooth/RF remote control. While there is nothing wonderful in this world that software can't ruin, I wonder what one could do to make audio smarter the way it's helped the Rag and the Yggy. And at the same time given every non-iPod portable *horrible* UI.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 14, 2015, 09:02:55 AM

The platforms and development environments are probably even more important than the language these days. .NET, Java SE/EE, etc. The reason is that a lot of functions and routines that we used to have to look up in algorithm books are built-in to the libraries. Saves a ton of time! This why some people I know won't hire .NET programmers. It's because 98% of .NET people are idiots who couldn't come up with working logic or algorithms to solve a simple problem, like finding the shortest path from point A to point B in a maze.


Can you recommend this for additional reading? This thread is inspiring.

URL: https://fiftyexamples.readthedocs.org/en/latest/algorithms.html
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 24, 2015, 05:23:45 PM
Recently I quit school. I was fed up with the nonsense and social experiments in the name of higher education. A job is in sight. I have to move on.

This summer I continue Java, C#, Python and front-end development with Javascript. I keep bumping into Javascript and I enjoy it.

Do you have tips regarding the most important skills I need to acquire? I know flexibility regarding work methods is necessary.
Title: Re: Learning C#, Tips?
Post by: Chris F on June 24, 2015, 08:48:37 PM
Second year university comp sci circa 1996.  We had been given a single week to learn C before being required to use it.  One of the students asked the professor why we had not taken more time to go over the language to which the professor replied (approximately): "Programming languages are tools, nothing more.  I'm here to teach you how to solve problems."

It's a great piece of advice IMO.  Don't worry about the tools, they come and go and frankly once you understand one procedural language (aka: C) you will pick the rest up real fast.

What you REALLY want to learn is how stuff works (architecture, algorithms etc...) and how to attack a problem that needs solving.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on June 24, 2015, 09:16:45 PM
First basics and then solutions for all kinds of situations. Algorithms require me to freshen up my maths skills. That is doable though.

I am tired of business studies and the jargon factory. I want to create, not produce hot air...
Title: Re: Learning C#, Tips?
Post by: Deep Funk on July 28, 2015, 02:24:25 AM
This book beats Codecademy for Python. I am repeating certain steps but I am having more fun at the same time.

(http://d20eq91zdmkqd.cloudfront.net/assets/images/book/large/9781/1189/9781118951798.jpg)

Add this and you are good to go. I have the fifth edition.

(http://ecx.images-amazon.com/images/I/51UsBNYpCtL._SX302_BO1,204,203,200_.jpg)

Books on Java and C# are on the way. I want to focus on applications and solutions for data analysis. That might lead to programming in R.
Title: Re: Learning C#, Tips?
Post by: spoony on July 28, 2015, 02:35:58 PM
Do you have tips regarding the most important skills I need to acquire? I know flexibility regarding work methods is necessary.

The best developers I know were never afraid to have to learn new stuff for work. Skills in most mainstream programming areas are pretty easy to acquire, so don't wait until you finish that book on X subject before you decide to take a plunge.

Also, read the best practices for the languages you pick, and, if available, make use of static code analysis, formatting and linting tools (flake8 for python, clang+clang-format for C/C++ and Objective-C, JSHint for JavaScript, etc), they are time savers.

Read on testing and try to write unit tests from the beginning so you form a habit.

Be passionate about your journey, even if the work gets to be dull, strive to do better, you can always be a better programmer.

Good luck.
Title: Re: Learning C#, Tips?
Post by: Deep Funk on July 28, 2015, 10:51:42 PM
Thanks, I will take note of your tips.