[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Where did it go so wrong?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 84
Thread images: 7
File: csharp3.png (68 KB, 300x300) Image search: [Google]
csharp3.png
68 KB, 300x300
Was C# a mistake? And if so, in what way?
>>
>>51846565
It wasn't. End of story.
>>
>>51846565
C# is a nice language but it was Windows only for a long time in any official capacity, C++ was still faster and C++ got a lot better with recent standards.
>>
>>51846565
Who keeps making these threads?

Everything is pretty comfy here in C# land. You guys can fuck off trying to stir shit up.

pls no bulli kthxby
>>
>>51847114
>>51847276
>>51847319
micro$hit shills detected.

>Decide to look at some Cee sharp sourcode because considering learning it
>Literally 3000 namespaces and classes everywhere
>100 prototypes within first 10 lines

Nope.png.exe

How do you guys even program in that clusterfuck language? How do you make sense of all that mumbo jumbo?
>>
C# is what Java should have been.
>>
>>51846565
The mistake was that they sat on the source-code for far too long.

Java already had a 10-years kickstart before C# was created. They should have done anything necessary to get anyone to switch, but they kept it closed and locked to their platform.

Now Android uses Java, there's Scala, Clojure and tons of other JVM languages and C# usage is declining.
>>
>>51847428
I'll definitely agree with that. It is the "new" VB for rapid development. Still, I won't ever give up C and C++.
>>
>>51846565
C++ (Lignux) and C# (Windurrs) developer here.

C# is absolutely magical. Such a joy to work in. I'd love a version that had the memory model of C++ that compiled natively, but keep its syntax/std lib.
>>
>>51849832
>C# is absolutely magical. Such a joy to work in. I'd love a version that had the memory model of C++ that compiled natively, but keep its syntax/std lib.

What is so good about C#?

Sell C# and .net to me as someone who has moderate knowledge of C++. Tell me WHY I should switch to it.
>>
>>51850144
well idiot?
>>
>>51847409
>How do you guys even program in that clusterfuck language? How do you make sense of all that mumbo jumbo?

Do you mean c++?

Because thats exactly what youre describing.
>>
>>51846565
https://soundcloud.com/fecshrooms/696a

CSHARP IS AMAZING.
>>
>>51850514
>Because thats exactly what youre describing.

?

C/C++ syntax is MUCH more intuitive. Maybe I'm just unused to it but I can't make any sense of C#. All those namespaces, classes, etc. It hurts my eyes desu.,
>>
>>51850144
well nerds?
>>
>>51851553
That all depends on personal preference.

Do you want to worry about managing your memory, when the CLR actually does it pretty well for you?

Do you want a fairly extensive standard library that supports multi-threading, generics, and networking IO?

Do you want a cross platform interface, which you can use the same code to manage the backend of a website, and control the front end of a desktop application?

Do you want to have fun, and make some decent change, all while expanding your job opportunities?

If so, then you should probably check it out. Nothing bad can come from it (except windows/mono).
>>
>>51851678
I'm just not really digging the whole syntax and look of C#. How do you get used to it?

Shit looks hella more hectic and confusing than C++.
>>
>>51851712
>Shit looks hella more hectic and confusing than C++
Could you elaborate more on that?
>>
>>51851754
here >>51847409

Why is there a million namespaces and classes?
>>
>>51851785
When you say "namespaces and classes" I don't know if you're referring to the ones defined by the project, or the ones included in the source file.

Anything that has "System" is part of the core .NET framerwork. The .NET is organized pretty well imo, so anything that seems off may be part of the project.
>>
C# is godtier.
/thread
>>
>>51851871
Why does everyone hate C# and .net then?
>>
>>51851989
Because it's backed by Microsoft and used in enterprise. At least that's what I would imagine. Usually those who use C# love the language. The only thing that really hinders it is shotty cross platform support. Mono has done really good things with what it had, but it hasn't been able to make a really nice implementation because of the propreitary nature of the .NET.

Hopefully those times are over soon, because the CLR, the core language classes, and a compiler are being ported *by microsoft* to other platforms, and they're doing it *on github*.
>>
>>51851712
Here's an example program inspired by the current state of the /dpt/.
>http://pastebin.com/9DFBS5Yb

I don't particularly find this to be hetic, nor confusing. Though I suppose it is a pretty simple example.
>>
I hate Visual Studio.
If IntelliJ IDEA supported C#, I'd give it a try.
>>
>>51852509
What version of VS are you using anon? 2010 isn't that bad.
>>
>>51852505
Why the fuck does it have so many classes?

I don't understand.

Can you do some examples using Winapi to compare to C++?

In what ways does it differ for making windows programs? Suggestion some learning materials and explain what pinvoke.net is.
>>
It's essentially VB made to look like C
>>
>>51852629
>Why the fuck does it have so many classes.
It really only needed one, I just made up the second one to show the syntax a little.

You need to have the main method inside a class, which is used for as the entry point in the program. I could have easily have just written this instead:
>http://pastebin.com/8BmVWQbZ

>Can you do some examples using the Winapi to compare to C++.
I actually haven't worked with the Winapi. I can tell you that to create a window, you can create a class which inherits from the Form class.
>http://pastebin.com/9pe3GDiY

A lot of the heavy work for the layout of the window can be done with the editor in VS. From there you can add in callbacks for event handlers, to pick up when a user presses a button, enters some text, or various other events.

As far as online tutorials go, I don't have any that I personally have used. I started out with a book that I found on the internet, and just kinda took it from there. You could probably start out with something on the MSDN to get your feet wet.

MSDN Tutorials
>https://msdn.microsoft.com/en-us/library/a72418yk.aspx

.NET Framework Library Reference
>https://msdn.microsoft.com/en-us/library/w0x726c2%28v=vs.110%29.aspx

The .NET Framework Reference is an invaluable resource, that actually provides a decent amount of documentation along with a fair amount of example code to go along with it.
>>
my college is making me choose between C# and java
What should I pick and why?
>>
>>51853067
>You could probably start out with something on the MSDN to get your feet wet.

Would that be enough if I have a somewhat decent grasp of C# or would I need to read a few books? I haven't really been able to find any good looking ones...

I suppose I'll try it out.

What is pinvoke? I have heard some guy on youtube mention it being highly useful and one of the main reasons C# is a good choice.
>>
>>51853110
>Would that be enough if I have a somewhat decent grasp of C# or would I need to read a few books?
It depends on how you learn best. The book I used was:
>Introducing Visual C# 2010 by Adam Freeman

It's a bit older, but the author uses a lot of code examples to show the concepts, which really helped me learn the language.

>What is pinvoke?
PInvoke is basically a way for the managed CLR to call unmanaged code (ie compiled C++ code). You can use it to call native functions that are outside of the CLR. Basically you can use code that is available in the Winapi, but not in the CLR, by importing the functions into your C# program, and invoke them like you would normally.
>>
>>51853256
>Basically you can use code that is available in the Winapi, but not in the CLR, by importing the functions into your C# program, and invoke them like you would normally.

Neato.

I suppose I will try to get my cock wet in C# then. Seems to be a lot of tutorials on youtube to do cool shit which should be gud enough
>>
>>51853256
Forgot link about PInvoke on MSDN:
>https://msdn.microsoft.com/en-us/library/aa288468%28v=vs.71%29.aspx
>>
>>51853256
>>51853303
If I understand correctly, is C# essentially just a much better choice for making Windows programs?

What would you say its downsides are and things to keep in mind/watch out for when coming over from C/C++? Major differences?
>>
>>51853445
C# is definitely a better choice for making .NET applications.
If you decide to make a GUI application, your best choice is WPF, which is widely integrated Visual Studio.

>keep in mind
C# is not an "improved C++", it is "improved Java for .NET"
So, at the very basic level, basic C# looks like basic Java.
Once you get into the language specific language features introduced in C# 3.0 and above, C# really begins to shine over Java.
>>
>>51853445
Performance is pretty good but if you're writing a game engine, you're still going to want to use something like C.
>>
>>51847409
It's called best practices and discipline you ignorant fag.
>>
>>51853941
>best practices

Writing out 30% more boiler plate code is a best practice?
>>
>>51853941
Best practices are joke. Most people using that term don't know what it even means. It's basically "everybody else is doing X so I must do X too." If everybody jumped off a fucking bridge, would you do it too?

C# is a great language for making real Windows programs but God help you if you get lost in the myriad of bullshit frameworks it's spawned. These "best practice" dummies will have you connecting poorly-documented and difficult-to-debug black boxes (to avoid actually coding anything yourself) when you're not wasting hours camel-casing everything because reasons. Don't let them in or they'll destroy any chance your project has.
>>
>>51852541
>almost 2016
>not using VS 2015
>>
>>51854635
Why do you need to your email to use VS 2015?

It won't let me use it now without signing it, wtf is this?
>>
>>51847506
There is F# but there's probably around 4 companies that use the language in any form. Really just adding a little bit to your point
>>
>>51854655
Create a cheapo throw away live.com account, is it that hard anon?
>>
>>51854286
It's so code is easy to maintain. How shitty would it be if everyone had to write their own libs and data structures because they think they can do better than 50 years of computer science.
>>
>>51854689
Yeah but why do I need to?

Like what the fuck is the point of it? WHy can't they just let me use their IDE without doing retarded shit all day?

Besides I don't even know how to use visual studio. It's way too complex. What's up with like 30000 features and all this weird memes?
>>
>>51854661
F# is functional. While C# is the purest OOP language out there. They are not comparable nor interchangeable.
>>
>>51854702
The account is optional and is helpful to synch your settings across different systems.
>>
>>51853073
Depends on your platform, but honestly both languages accomplish similar things as heavy-hitter(popularity and library depth) languages.

Java, arguably more libraries available, and full usability on any platform: osx, linux, windows

C# is great in windows development environments and not terrible in others but desktop GUI application development is made laughably simple in visual studio.
>>
>>51854702
> he doesn't know how to use VS
shouldnt you be in a BST thread right now?
>>
>>51850144
You shouldn't switch to any language... You use whats the best language for the task at hand...
>>
>>51854702
If you would like to develop on C# then it is the best ide there is. And if you don't want to use those 30000 features, you are not forced to. In fact is pretty much write code and press button to execute. GUI is as simple as drag drop ui elements and press button to launch and interact.
>>
>>51854722
>The account is optional and is helpful to synch your settings across different systems.

Unless I have severe autism it doesn't let me decline it.

>>51854750
I only used Codelite on Leenoox and codeblocks/dev-C++ on Wangblows :(

>>51854764
>And if you don't want to use those 30000 features, you are not forced to. In fact is pretty much write code and press button to execute

But what is up with stdafx.h and all that other shit? VC++ feels almost like a new language... Do I just delete all that and use it as i would normally in another ide?
>>
>>51854750
Indeed.
You can hate MS and VS for whatever reasons, but once you experience C# in real, you'll acknowledge the beauty of it.
>>
>>51854779
Anon this thread is about C# and not VC++.
>>
File: 3.png (227 KB, 1366x768) Image search: [Google]
3.png
227 KB, 1366x768
>>51846565
for this lenguague. i need to make a compiler, but this is very hard.....
>>
File: Untitled.png (18 KB, 663x571) Image search: [Google]
Untitled.png
18 KB, 663x571
>writing a software graphics pipeline
>working in C# on Linux
>using nullables for vectors so that you can do vector.Z and get either a null or a double depending on whether it has a Z value or not
>getting bizarre results where I set a vector to have an X, Y, and Z of 0, and get NaN and random doubles when trying to access them through the properties
>step through the code using Monodevelop, even weirder shit is happening
>decide to try running the project in Visual Studio on Windows
>it works correctly
>find out after searching the internet for an hour that there's an unfixed bug when using nullables in Monodevelop, but if you build from command line using xbuild it works

That's pretty much my experience with C#. If you're working on Windows its fantastic (you can even enable unsafe code so you can do autistic pointer manipulations just like C and C++). Linux support is kind of wonky, some classes do weird things (seriously why are bytes not a primitive and really just some sort of retarded integer adapter), and occasionally the documentation won't match up with actual results (mostly related to Winforms fields and shit).
>>
>>51850144
LINQ
>>
C# is great for getting job done good and fast. All you need to do is to get rid of autism.
>>
>>51854635
>implying that any version of VS past 2010 is actually good
Nice try faggot. Enjoy your broken software :^)
>>
>>51847428
qft
>>
>>51854692
There is a difference between rewriting the array class and not wanting to use the Entity black box, its fragile type generator, and its word salad exceptions because you can't understand ADO or your database structure.
>>
>>51847409
>Honestly thought this post was talking about C++ until I re-read it
>>
php
>>
>>51854851
>>working in C# on Linux

stop you faggot
>>
File: jimmies.jpg (115 KB, 400x400) Image search: [Google]
jimmies.jpg
115 KB, 400x400
>>51847409
>>
>>51846565
>start a thread claiming something is shit like it's obvious
>>51847409
>say everyone disagreeing is a shill

Pretty bad attempt at manipulation. Seems you're buttblasted because you learned a shit language and think posts on 4chan of all places will get you a good job.

Fuck off.
>>
>>51847409
>Decide to look at some Cee sharp sourcode because considering learning it
>Literally 3000 namespaces and classes everywhere
>100 prototypes within first 10 lines

That's literally the only way to go if you need >10 developers actively contribute to a code base full-time, and be able to have some understanding of how all the different parts work

If you just want to develop something tractable, don't take giga-projects as examples
>>
>>51846565
>forced meme detected
>>
>>51847409
Are you actually struggling working with C#?
After about a decade of working with C++, C# is like a dream world where everything i need to do is already done for me.
>>
>>51858639

Wait until you see Java, dude..
>>
>>51858845
C# is better than Java and I've used both. C# is cleaner imo
>>
>>51852509
VS is objectively amazing.
>>
>>51858954

Explain, please.
>>
File: assburger2.jpg (32 KB, 275x313) Image search: [Google]
assburger2.jpg
32 KB, 275x313
>>51849832
>C# is absolutely magical
>>51850551
>CSHARP IS AMAZING
>>51851925
>C# is godtier.
>/thread
>>51854706
>C# is the purest OOP language out there

Those are the kind of unreflected fanboy opinions that always make me hate anything related to that language.
>>
Get C++ Mr.9gag
>>
>Never done programming before
>Start learning C, ASP.Net and so forth through classes last year
>See this thread

Not sure if if I should feel relief or not for learning C# as my first programming language.
>>
File: Well, Actually.jpg (162 KB, 395x395) Image search: [Google]
Well, Actually.jpg
162 KB, 395x395
>>51847409
>100 prototypes within first 10 lines
>C# prototypes
It seems people only read the first half of the post.
>>
>>51859429

>Start learning C

Well..

C# or Java is more or less the same. And it's about as complicated as learning to drive a car.

C is like learning to drive a bus. Backwards. And blindfolded. On a field of mines.

C++ is like learning to drive the same bus backwards over the same minefield, but you have 3 diiffernt steering wheels and 17 pedals (you have more options, therefore it's easier, right?)
>>
OO is trash for individual programmers and has no proven benefits in that area, CS class brainwashing from tenure-holding profs that dropped out of the world in 2007 aside. That overly verbose, "segmented" style of programming that creates very structured spaghetti code is (anecdotally) ideal for large groups of aspies that will never ever be able to be remotely coordinated, but little else.

Just use an actual functional language. The resulting program is going to be slow shit either way
>>
>>51860939
C is like learning to drive a car on an american road

"Hey, don't drive over the potholes"
"I want to drive over the potholes"
"Moron"
"Oh my god why are my wheels fucked up this fucking car is awful"

C# or java is like learning to drive a car with a californian uni graduate's idea of "ideal" controls

"What was wrong with steering wheels?"
"This is just BETTER"
"You're driving as well as you would with one"
"It's just BETTER. It makes more sense. I FEEL better using it."
"Fucking hipsters"
>>
>>51861010

Yeah, because no garbage collection and the clusterfuck of pointer arithmetic is totally worth the 5 nano seconds saved. Especially since we still have 1980 and computers are sloooow..

And yeah, have you terminated your strings? Oops, you're accidentaly in the wrong part of the disc.. What, you enter FIVE letters? I thought you would only enter FOUR letters, sorry, we're done here.. Oh wait, we already defined this variable somewhere else, sorry.. Hey you want to use element 7 of an array with 3 elements? No problem! Also treating pointers as booleans, treating integers as a boolean, and booleans as an integer:

int wtf;
wtf = 2 && 4 && 8;
if (wtf == 1){
// yes, it's correct
}


C is not programming.
C is ART.
>>
File: Capture.png (23 KB, 1225x618) Image search: [Google]
Capture.png
23 KB, 1225x618
C# is a java-like skin over basic C++ with an enhanced library and memory management.

You can easily interoperate with existing C++ libraries with a single line of code.
Native types in C# are the same native types as in C++ (C# int == C++ int)
You can enable unsafe code and use pointers, unlike in java.
You can write .NET/native libraries that C++ can use as well (a little trickier because you have to export these in visual C++)
Extensive library of easy threading, networking, IO, cryptography, etc...
Drag and drop UI with Visual Studio

And lots of shit you can't do in other languages like LINQ and reflection.
I'd use C# just for LINQ. It makes managing lists/arrays a whole lot better.

Pic related. A similar thing in C++ would take several lists, multiple for loops, and a bunch of spaghetti code. In C# it's a single line of code.
>>
>>51861509
Well said. Also in Java int is primitive not an object. Java don't have delegates and lambdas as well.
Thread replies: 84
Thread images: 7

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.