• July 09, 2020, 11:03:49 PM

Author Topic: C++  (Read 11000 times)

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: C++
« Reply #25 on: August 19, 2010, 07:05:42 PM »
For the expression trees solution:
The generics used in this case appear to still require the type at compile time.  I would require that it is not known at compile time; probably being stored polymorphically.  Would using the primitive 'object' still box the number?

For the dynamic solution:
Similarly, will it allow run time checking of an operation on two numbers that are stored polymorphically as a type that does not implement the operation?

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #26 on: August 19, 2010, 07:43:32 PM »
Question 1: No because the code would never be compiled at runtime.
Question 2: Yes. You'd get a RuntimeBindingErrorException iirc.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

CoolNcalm

  • The Cool N Calm
  • Addict
  • *****
  • Posts: 169
  • Woop Woop
    • Cool Lounge
Re: C++
« Reply #27 on: August 21, 2010, 07:37:48 AM »
i took some classes 4 years ago to get an associates... c c+ c++ was in there.

What the fuck is C+?  Your average grade?  Try again.

Back on topic:
C# is not the be-all-end-all of programming languages.  There are clearly times when you shouldn't, or simply cannot use C#.  Consider heavily real-time systems...or embedded microchips.  I still think it's important to learn C++ even if only to understand why you shouldn't use it.

Also, I don't like how C# doesn't allow inheritance of multiple abstract classes.  I don't like that a class must be referenced before a static constructor is called.  I definitely don't like that there's no Number class between Object and Single/Double/Int etc. in .NET's class hierarchy.  It's still a great language, but it definitely isn't perfect.

hmm figured id clearify myslef a lil. C "primer" +...we all just called it c+ for short at my college!

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: C++
« Reply #28 on: August 21, 2010, 07:27:23 PM »
hmm figured id clearify myslef a lil. C "primer" +...we all just called it c+ for short at my college!

I guess that's what happens when you can't see and go for a 2 year degree at a community college.

l2k-Shadow

  • l2k-Shadow
  • Hero Member
  • *******
  • Posts: 1,058
Re: C++
« Reply #29 on: August 24, 2010, 12:48:32 AM »
hmm figured id clearify myslef a lil. C "primer" +...we all just called it c+ for short at my college!


I guess that's what happens when you can't see and go for a 2 year degree at a community college.


Lol.

Back on topic: If you are linux user, and you plan on being so, then you definitely should have understanding of C/C++. I will not start the whole OMG .NET MICROSOFT OMG SO MUCH BETT0R AND USER-FREINDLIER THAN C++ OMGZ NO MEMORY CORRUPTEN ISSUE OMGZ argument. So, anyway, your linux distribution should come with GNU tools. It is much simpler to work with C/C++ in linux than on windows, where you will have to, usually, install a compiler.
Your first C program:
Code: [Select]
#include <stdio.h>
int main()
{
     printf("Hello world\n");
     return 0;
}
all you have to do is throw this in a file called helloworld.c and save it in a folder. then open terminal navigate to that folder and
Code: [Select]
bash-4.1$ gcc helloworld.c -o helloworld
bash-4.1$ ./helloworld
Hello world
bash-4.1$

it is as simple as this. If you want to write C++ code instead of C, you will have to use the g++ compiler; however, the procedure is exactly the same. If you wish to be more "with the times" and use an IDE, I recommend NetBeans (http://netbeans.org/) it is a java cross-platform development environment and i have found it very useful both for C++ and Java. Good luck in your endeavors.
« Last Edit: August 24, 2010, 12:50:43 AM by l2k-Shadow »
/)  /)
( -.- )
o_(")(")
This is Bunny. Copy and paste Bunny into your signature to help him gain world domination

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #30 on: August 24, 2010, 02:54:25 AM »
Linux has a mature language deficiency. C++ is legacy garbage.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

K i n g o f K i n g s

  • Hero Member
  • *******
  • Posts: 2,945
Re: C++
« Reply #31 on: August 24, 2010, 09:13:24 AM »
hmm figured id clearify myslef a lil. C "primer" +...we all just called it c+ for short at my college!


I guess that's what happens when you can't see and go for a 2 year degree at a community college.


Lol.

Back on topic: If you are linux user, and you plan on being so, then you definitely should have understanding of C/C++. I will not start the whole OMG .NET MICROSOFT OMG SO MUCH BETT0R AND USER-FREINDLIER THAN C++ OMGZ NO MEMORY CORRUPTEN ISSUE OMGZ argument. So, anyway, your linux distribution should come with GNU tools. It is much simpler to work with C/C++ in linux than on windows, where you will have to, usually, install a compiler.
Your first C program:
Code: [Select]
#include <stdio.h>
int main()
{
     printf("Hello world\n");
     return 0;
}
all you have to do is throw this in a file called helloworld.c and save it in a folder. then open terminal navigate to that folder and
Code: [Select]
bash-4.1$ gcc helloworld.c -o helloworld
bash-4.1$ ./helloworld
Hello world
bash-4.1$

it is as simple as this. If you want to write C++ code instead of C, you will have to use the g++ compiler; however, the procedure is exactly the same. If you wish to be more "with the times" and use an IDE, I recommend NetBeans (http://netbeans.org/) it is a java cross-platform development environment and i have found it very useful both for C++ and Java. Good luck in your endeavors.

Thank you shadow. I was wondering if it would get back on subject.

In most countries selling harmful things like drugs is punishable. How come people can sell Microsoft software and go unpunished?
The Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it.
Going from Windows to Linux is like trading a glider for an F117.

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #32 on: August 24, 2010, 08:33:07 PM »
My suggestion would be to use Qt/Boost. Once you slap a bunch of bullshit on top of C++, you can kinda be productive with it.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

l2k-Shadow

  • l2k-Shadow
  • Hero Member
  • *******
  • Posts: 1,058
Re: C++
« Reply #33 on: August 25, 2010, 02:47:07 AM »
Yeah. And when http servers, operating systems, and drivers are written in C#, you let me know.
/)  /)
( -.- )
o_(")(")
This is Bunny. Copy and paste Bunny into your signature to help him gain world domination

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #34 on: August 25, 2010, 02:16:06 PM »
Yeah. And when http servers, operating systems, and drivers are written in C#, you let me know.

XSP, Singularity/SharpOS/MOSA, and Singularity/SharpOS/MOSA drivers and for Windows, you can use the User Mode Driver Framework with C#.


Change: modified the bottom of this post, this isnt the flame forum nelson. Please treat it as such.
-HackeZ
« Last Edit: August 25, 2010, 03:56:47 PM by warrior »
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

ɥǝnяʎ ıן

  • Super Moderator
  • Hero Member
  • ******
  • Posts: 1,456
Re: C++
« Reply #35 on: August 25, 2010, 03:20:40 PM »
warrior, how old are you? and why'd you start programming bnet bots? o_o
Quote
[09:39:13 PM] «[].[].[].[].@USEast» Do you know what the best letters of the alphabet are?
[09:39:21 PM] «DeCi@USEast» h e n r y

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #36 on: August 25, 2010, 03:29:38 PM »
22, and because the Clan I was in at the time needed one. Got me started with programming, and then, as messiah's usually do, I became better than everybody.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

ɥǝnяʎ ıן

  • Super Moderator
  • Hero Member
  • ******
  • Posts: 1,456
Re: C++
« Reply #37 on: August 25, 2010, 03:50:43 PM »
lol, how long you been programming for..
Quote
[09:39:13 PM] «[].[].[].[].@USEast» Do you know what the best letters of the alphabet are?
[09:39:21 PM] «DeCi@USEast» h e n r y

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #38 on: August 25, 2010, 03:56:14 PM »
03
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #39 on: August 25, 2010, 03:57:14 PM »
Ps. Perhaps people who know astronomically less than me should not be questioning me, if they don't want to be flamed.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

Crux

  • Hero Member
  • *******
  • Posts: 850
Re: C++
« Reply #40 on: August 25, 2010, 03:58:32 PM »
03
Ps. Perhaps people who know astronomically less than me should not be questioning me, if they don't want to be flamed.

Click da 'Edit' button.
If you don't acknowledge your failures, you'll never fail. -Tobuscus

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #41 on: August 25, 2010, 03:59:20 PM »
I didn't need to edit that post though, I needed to make a new post.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

HackeZ

  • Addict
  • *****
  • Posts: 201
Re: C++
« Reply #42 on: August 25, 2010, 04:03:57 PM »
Linux has a mature language deficiency. C++ is legacy garbage.

hey its not our fault microsoft dislikes us linux users. Although they did submit 30283091238 lines of driver source not so long ago to the linux cause which makes me wonder there motives behind that, perhaps to convert apple users to linux users? *shrug*. The point is there are many efforts being made to bring everything to linux just give it time.

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #43 on: August 25, 2010, 04:05:30 PM »
hey its not our fault microsoft dislikes us linux users. Although they did submit 30283091238 lines of driver source not so long ago to the linux cause which makes me wonder there motives behind that, perhaps to convert apple users to linux users? *shrug*. The point is there are many efforts being made to bring everything to linux just give it time.

Microsoft practically giftwrapped the CLI, C#, XAML, and Silverlight specifications for the Mono team, and the Linux community as a whole still shuns them (and curiously embraces Java, despite the fact that C# and .NET have explicit non aggression promises from Microsoft, and are legally safer than Java).

Linux is a shitty development platform by choice, not because they cant.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

HackeZ

  • Addict
  • *****
  • Posts: 201
Re: C++
« Reply #44 on: August 25, 2010, 04:08:32 PM »
hey its not our fault microsoft dislikes us linux users. Although they did submit 30283091238 lines of driver source not so long ago to the linux cause which makes me wonder there motives behind that, perhaps to convert apple users to linux users? *shrug*. The point is there are many efforts being made to bring everything to linux just give it time.

Microsoft practically giftwrapped the CLI, C#, XAML, and Silverlight specifications for the Mono team, and the Linux community as a whole still shuns them (and curiously embraces Java, despite the fact that C# and .NET have explicit non aggression promises from Microsoft, and are legally safer than Java).

Linux is a shitty development platform by choice, not because they cant.

"embraces java" lol, go to ##slackware or any other big irc linux pub and they talk shit about java all day long. Im sure they would take C# over java in a heart beat just because of legalities alone. The fact is the mono team is garbage and some other very well funded organization should take the helm to help it along *cough microsoft*

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #45 on: August 25, 2010, 04:12:59 PM »
The Mono team is the best thing to happen to Linux in a long time. How are they garbage? Microsoft gives Mono access to Silverlight specifications before they even announce it to the general public, they get heads up on the direction of SL before even most developers do.

and Java is pretty well embraced in the FOSS world, and was for a long time. Just look at the mailing lists when Mono was first being discussed, everyone was pretty much saying "Use Java its better".

In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

HackeZ

  • Addict
  • *****
  • Posts: 201
Re: C++
« Reply #46 on: August 25, 2010, 04:16:59 PM »
The Mono team is the best thing to happen to Linux in a long time. How are they garbage? Microsoft gives Mono access to Silverlight specifications before they even announce it to the general public, they get heads up on the direction of SL before even most developers do.

and Java is pretty well embraced in the FOSS world, and was for a long time. Just look at the mailing lists when Mono was first being discussed, everyone was pretty much saying "Use Java its better".

you cant condemn the opinions of everyone for those of a few. I dont believe java is better and ive been a linux user for 6 years isnt that enuff for you nelson :'(. Im just going by the opinions of developers on IRC, for as I dont code in java or C# nor am I knowledgable enuff on either of them to state a more solid arguement.

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #47 on: August 25, 2010, 04:42:49 PM »
I doubt they are either. Also, this seemed to be the conventional wisdom at the time. Java has always been the darling of the OSS world, because Sun could do no wrong (Except when they sued Microsoft for J++, and the OSS world applauded them, then when they sue Google for Java on Android, everyone is against them .. ). It's just funny how quickly people forget history.

With Microsoft, you have the most legally safe language, Sun won't sue Microsoft and win, not after the portfolio MSFT amassed with Office. In fact, the J++ settlement was a big cross licensing agreement.

Bottom line: Linux users should embrace Mono more, what they're doing (especially for Gnome) is really amazing stuff. The FOSS would is the most unappreciative bunch I've seen in a long time, if I don't even know why Mono even bothers.
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

Mike

  • Asgard Developer
  • Addict
  • *****
  • Posts: 140
    • mikeownage.com
Re: C++
« Reply #48 on: August 27, 2010, 01:10:08 PM »
I sometimes think warrior either works for microsoft or gets paid to always advertise them :P
This post has been thanked 1 time ɥǝnяʎ ıן
« Last Edit: October 07, 2010, 10:06:21 AM by Mike »

warrior

  • Sr. Member
  • ******
  • Posts: 409
  • Jesus Christ.
Re: C++
« Reply #49 on: August 27, 2010, 03:28:02 PM »
C# does keep my bank account well funded =P
In capitalist America, bank robs you.

Choosing to code in an unmanaged language/platform is like choosing a hotel where you have to clean your own room.

When C++ is your hammer, everything starts to look like your thumb

 

newBalance by DzinerStudio