Page 3 of 3 [ 43 posts ]  Go to page Previous  1, 2, 3

noname_ever
Veteran
Veteran

User avatar

Joined: 25 Dec 2011
Age: 45
Gender: Male
Posts: 500
Location: Indiana

30 Jul 2012, 10:55 pm

C++ is a very large language, although the subset many people use isn't that bad.

Some of the problems I've seen with it are that it still deals with pointers. I don't see the point of needing to deal with pointers if I'm developing a desktop business application where speed isn't the be all/end all (pointer usage is error prone), but do appreciate it for embedded applications.

The template usage is convoluted compared to other languages. My first exposure to templates in C++ made me go WTF. That is after spending a few years doing the same thing in Ada83 using generics.

Multiple inheritance can be hard (single inheritance and implementing multiple interfaces seems cleaner IMO than multiple inheritance in C++).

Different compiler vendors still implement the language behaviors differently even if they require the use of pragmas. Why should the language give you the option to automatically treat all characters as signed or unsigned simply due to a compiler switch?

Some still harbor notions that C++ and the tool sets are still the abomination that it used to be (think MFC development).



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 41
Gender: Male
Posts: 1,385

31 Jul 2012, 12:22 am

noname_ever wrote:
C++ is a very large language, although the subset many people use isn't that bad.

Some of the problems I've seen with it are that it still deals with pointers. I don't see the point of needing to deal with pointers if I'm developing a desktop business application where speed isn't the be all/end all (pointer usage is error prone), but do appreciate it for embedded applications.

The template usage is convoluted compared to other languages. My first exposure to templates in C++ made me go WTF. That is after spending a few years doing the same thing in Ada83 using generics.

Multiple inheritance can be hard (single inheritance and implementing multiple interfaces seems cleaner IMO than multiple inheritance in C++).

Different compiler vendors still implement the language behaviors differently even if they require the use of pragmas. Why should the language give you the option to automatically treat all characters as signed or unsigned simply due to a compiler switch?

Some still harbor notions that C++ and the tool sets are still the abomination that it used to be (think MFC development).


- I think people who write C++ code (professionally) should know at least 90% of the C++ language, all the rules, all the minutae. Without that it's too easy to screw up. I admit that even today, I can miss questions about C++ in job interviews etc; it is not the simplest language. I do believe a simpler language with all the functionality of C++ is probably possible and would be a good thing.

- I prefer pointers to reference tables and garbage collection for a number of reasons. I prefer scope based deletion and the discrete point at which objects are deconstructed. I think the "embarrassing pause" is unacceptable. In fact, I'm so militant about this that I believe garbage collection should be eliminated as a concept, except in languages that feature simplicity (as opposed to power) as one of their primary goals (think Perl). I think a reference table should still be maintained and that leak checking should be enforced by the language and leaks should be akin to segfaults in seriousness.

- I don't think anyone uses the flag that causes chars to be unsigned by default, and yes that is stupid. I think Visual C++ (and gcc if it still has it) should eliminate that and most flags.



noname_ever
Veteran
Veteran

User avatar

Joined: 25 Dec 2011
Age: 45
Gender: Male
Posts: 500
Location: Indiana

31 Jul 2012, 1:56 am

MyFutureSelfnMe wrote:
noname_ever wrote:
C++ is a very large language, although the subset many people use isn't that bad.

Some of the problems I've seen with it are that it still deals with pointers. I don't see the point of needing to deal with pointers if I'm developing a desktop business application where speed isn't the be all/end all (pointer usage is error prone), but do appreciate it for embedded applications.

The template usage is convoluted compared to other languages. My first exposure to templates in C++ made me go WTF. That is after spending a few years doing the same thing in Ada83 using generics.

Multiple inheritance can be hard (single inheritance and implementing multiple interfaces seems cleaner IMO than multiple inheritance in C++).

Different compiler vendors still implement the language behaviors differently even if they require the use of pragmas. Why should the language give you the option to automatically treat all characters as signed or unsigned simply due to a compiler switch?

Some still harbor notions that C++ and the tool sets are still the abomination that it used to be (think MFC development).


- I think people who write C++ code (professionally) should know at least 90% of the C++ language, all the rules, all the minutae. Without that it's too easy to screw up. I admit that even today, I can miss questions about C++ in job interviews etc; it is not the simplest language. I do believe a simpler language with all the functionality of C++ is probably possible and would be a good thing.

- I prefer pointers to reference tables and garbage collection for a number of reasons. I prefer scope based deletion and the discrete point at which objects are deconstructed. I think the "embarrassing pause" is unacceptable. In fact, I'm so militant about this that I believe garbage collection should be eliminated as a concept, except in languages that feature simplicity (as opposed to power) as one of their primary goals (think Perl). I think a reference table should still be maintained and that leak checking should be enforced by the language and leaks should be akin to segfaults in seriousness.

- I don't think anyone uses the flag that causes chars to be unsigned by default, and yes that is stupid. I think Visual C++ (and gcc if it still has it) should eliminate that and most flags.


-- C++ is a huge language. I'm not aware of any current compilers that are 100% conforming to the language specification. That says something (I thought there was one in the past, but I am not sure about current revisions). Even if you know at least 90% of the language, you still need to know what the compiler implemented for your specific target (You don't get as much of the language implemented for an MSP430 (no RTTI IIRC) vs a desktop processor).

-- The usage of GC and pointers are not mutually exclusive. I liked Ada's approach to pointers. It abstracted them away and you had to do use some lower level constructs if you wanted to get at the address (if you needed a variable to be at a specific address, you could tell the compiler to place it at that address. This was for dealing with memory mapped hardware IIRC). That said, it didn't have a GC either. You used the same allocate/free method that you used in C. You didn't have to deal with pointers explicitly.

-- Pointers also become error prone when you need to do arithmetic with them or you start using them a few levels deep. It requires much more care when you start dealing with parameter types like char ****. Also, function pointers have a tendency to be error prone as well. 4GL languages have a tendency to abstract them away because they are problematic to many programmers.

-- I wish C used unsigned chars by default. Having a character value of -1 doesn't make sense IMO. However, since a char is simply an 8 bit int, it makes sense. I'm somewhat prejudiced against signed characters since I work with unsigned data most of the time.



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 41
Gender: Male
Posts: 1,385

31 Jul 2012, 2:09 am

noname_ever wrote:
MyFutureSelfnMe wrote:
noname_ever wrote:
C++ is a very large language, although the subset many people use isn't that bad.

Some of the problems I've seen with it are that it still deals with pointers. I don't see the point of needing to deal with pointers if I'm developing a desktop business application where speed isn't the be all/end all (pointer usage is error prone), but do appreciate it for embedded applications.

The template usage is convoluted compared to other languages. My first exposure to templates in C++ made me go WTF. That is after spending a few years doing the same thing in Ada83 using generics.

Multiple inheritance can be hard (single inheritance and implementing multiple interfaces seems cleaner IMO than multiple inheritance in C++).

Different compiler vendors still implement the language behaviors differently even if they require the use of pragmas. Why should the language give you the option to automatically treat all characters as signed or unsigned simply due to a compiler switch?

Some still harbor notions that C++ and the tool sets are still the abomination that it used to be (think MFC development).


- I think people who write C++ code (professionally) should know at least 90% of the C++ language, all the rules, all the minutae. Without that it's too easy to screw up. I admit that even today, I can miss questions about C++ in job interviews etc; it is not the simplest language. I do believe a simpler language with all the functionality of C++ is probably possible and would be a good thing.

- I prefer pointers to reference tables and garbage collection for a number of reasons. I prefer scope based deletion and the discrete point at which objects are deconstructed. I think the "embarrassing pause" is unacceptable. In fact, I'm so militant about this that I believe garbage collection should be eliminated as a concept, except in languages that feature simplicity (as opposed to power) as one of their primary goals (think Perl). I think a reference table should still be maintained and that leak checking should be enforced by the language and leaks should be akin to segfaults in seriousness.

- I don't think anyone uses the flag that causes chars to be unsigned by default, and yes that is stupid. I think Visual C++ (and gcc if it still has it) should eliminate that and most flags.


-- C++ is a huge language. I'm not aware of any current compilers that are 100% conforming to the language specification. That says something (I thought there was one in the past, but I am not sure about current revisions). Even if you know at least 90% of the language, you still need to know what the compiler implemented for your specific target (You don't get as much of the language implemented for an MSP430 (no RTTI IIRC) vs a desktop processor).

-- The usage of GC and pointers are not mutually exclusive. I liked Ada's approach to pointers. It abstracted them away and you had to do use some lower level constructs if you wanted to get at the address (if you needed a variable to be at a specific address, you could tell the compiler to place it at that address. This was for dealing with memory mapped hardware IIRC). That said, it didn't have a GC either. You used the same allocate/free method that you used in C. You didn't have to deal with pointers explicitly.

-- Pointers also become error prone when you need to do arithmetic with them or you start using them a few levels deep. It requires much more care when you start dealing with parameter types like char ****. Also, function pointers have a tendency to be error prone as well. 4GL languages have a tendency to abstract them away because they are problematic to many programmers.

-- I wish C used unsigned chars by default. Having a character value of -1 doesn't make sense IMO. However, since a char is simply an 8 bit int, it makes sense. I'm somewhat prejudiced against signed characters since I work with unsigned data most of the time.


I'm not aware of any compilers/interpreters for any language that are 100% conforming, unless you count things like C# or Ruby that have a reference compiler/interpreter. In about the last five years, I haven't had any serious portability issues with my C++ code. There are some annoying things in Visual Studio 2005 and earlier, but that's it really. I've been able to work around even those things without stooping very low. I almost never write code that requires RTTI, so that hasn't been an issue for me. The only serious problem I've run into was the lack of exceptions, behavior of operator new, and a number of other basics when building C++ code for UEFI, but since a C++ compiler doesn't even officially exist for UEFI yet (for some reason...), I have to cut it a little slack.

I also don't really remember the last time I used pointers more than two deep, and I rarely use more than one deep unless you're talking about object1->object2->object3. I've worked on million line codebases. I try not to do things that are going to be difficult for me to understand later. The only time I typically do arithmetic on pointers is if I'm writing some hardcore optimized inner loop for a renderer or something. Otherwise I tend to use container classes, STL or otherwise.

As I don't do arithmetic on 'char's (except maybe a few edge cases in the last decade), what a char represents isn't my issue. I do use uint8_t.



noname_ever
Veteran
Veteran

User avatar

Joined: 25 Dec 2011
Age: 45
Gender: Male
Posts: 500
Location: Indiana

31 Jul 2012, 2:29 am

MyFutureSelfnMe wrote:
I'm not aware of any compilers/interpreters for any language that are 100% conforming, unless you count things like C# or Ruby that have a reference compiler/interpreter. In about the last five years, I haven't had any serious portability issues with my C++ code. There are some annoying things in Visual Studio 2005 and earlier, but that's it really. I've been able to work around even those things without stooping very low. I almost never write code that requires RTTI, so that hasn't been an issue for me. The only serious problem I've run into was the lack of exceptions, behavior of operator new, and a number of other basics when building C++ code for UEFI, but since a C++ compiler doesn't even officially exist for UEFI yet (for some reason...), I have to cut it a little slack.

I also don't really remember the last time I used pointers more than two deep, and I rarely use more than one deep unless you're talking about object1->object2->object3. I've worked on million line codebases. I try not to do things that are going to be difficult for me to understand later. The only time I typically do arithmetic on pointers is if I'm writing some hardcore optimized inner loop for a renderer or something. Otherwise I tend to use container classes, STL or otherwise.

As I don't do arithmetic on 'char's (except maybe a few edge cases in the last decade), what a char represents isn't my issue. I do use uint8_t.


For a language to have a 100% conforming compiler, the spec has to be internally consistent. C++ didn't have that in the earlier revisions. Ada had 100% conforming compilers, which is something I really liked (consistent behavior no matter which compiler).

For desktop (non-embedded projects really), I can see having much less issues with portable code given the current compilers since they have matured over time.

You get into deep pointer references when you need to pass tables around. Suppose you have a char** (array of char*). If you need to pass it around to different functions, you can pass the address of the char**, so it becomes a char***. Do this as many times as you need depending on how deep you need to pass the data. It gets annoying quickly.

One of the things that I both hate and like is the ability to cast pointers to other pointers. I can take my (unsigned char *) and convert it to a (my_struct*) and then access the data as needed. However, it requires extra attention by the developer to not screw it up.



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 41
Gender: Male
Posts: 1,385

31 Jul 2012, 2:41 am

noname_ever wrote:
MyFutureSelfnMe wrote:
I'm not aware of any compilers/interpreters for any language that are 100% conforming, unless you count things like C# or Ruby that have a reference compiler/interpreter. In about the last five years, I haven't had any serious portability issues with my C++ code. There are some annoying things in Visual Studio 2005 and earlier, but that's it really. I've been able to work around even those things without stooping very low. I almost never write code that requires RTTI, so that hasn't been an issue for me. The only serious problem I've run into was the lack of exceptions, behavior of operator new, and a number of other basics when building C++ code for UEFI, but since a C++ compiler doesn't even officially exist for UEFI yet (for some reason...), I have to cut it a little slack.

I also don't really remember the last time I used pointers more than two deep, and I rarely use more than one deep unless you're talking about object1->object2->object3. I've worked on million line codebases. I try not to do things that are going to be difficult for me to understand later. The only time I typically do arithmetic on pointers is if I'm writing some hardcore optimized inner loop for a renderer or something. Otherwise I tend to use container classes, STL or otherwise.

As I don't do arithmetic on 'char's (except maybe a few edge cases in the last decade), what a char represents isn't my issue. I do use uint8_t.


For a language to have a 100% conforming compiler, the spec has to be internally consistent. C++ didn't have that in the earlier revisions. Ada had 100% conforming compilers, which is something I really liked (consistent behavior no matter which compiler).

For desktop (non-embedded projects really), I can see having much less issues with portable code given the current compilers since they have matured over time.

You get into deep pointer references when you need to pass tables around. Suppose you have a char** (array of char*). If you need to pass it around to different functions, you can pass the address of the char**, so it becomes a char***. Do this as many times as you need depending on how deep you need to pass the data. It gets annoying quickly.

One of the things that I both hate and like is the ability to cast pointers to other pointers. I can take my (unsigned char *) and convert it to a (my_struct*) and then access the data as needed. However, it requires extra attention by the developer to not screw it up.


Both of the things you're talking about (representing a table as a char** and casting char* to struct*) are things that I do not do. I realize there are some other people who do that.



AdmiralCrunch
Sea Gull
Sea Gull

User avatar

Joined: 18 Apr 2010
Age: 44
Gender: Male
Posts: 227
Location: CT, USA

31 Jul 2012, 2:11 pm

An argument about memory management and C++ STL compiler conformity?!?!?

I just want to let you know that I love you guys. :heart:


_________________
Dum vita est, spes est.


Foxface
Raven
Raven

User avatar

Joined: 31 Jul 2012
Age: 32
Gender: Male
Posts: 111

01 Aug 2012, 1:42 am

My phone (and my last one) is Android. Like it very much. Have thing for open source software. It's mostly what I use.

The reason I like it is because it easy to use and manage. You don't need to download a manger (unlike Apple). I can just copy the files to the phones drive, like a jump drive.

I hate Apple, because I had nothing but problems with them. Tried my Sisters Mac, which is a pain to use, nothing does what I want it to do, and one of the hardest Operating Systems I've ever used. I also don't like Apple, because they strict, like Microsoft. They are closed Source. I have an iPod, that is now almost useless. Can still excess me apps, but my music will no longer copy, I've backed it up and resetted it. It deleted most of my apps and settings.I've only got some of them back.

I don't like Microsoft (at least their software), because it's outdated, usually, it's strict, but doesn’t seem to be strict as Apple, and they hate Open Source software. They bought out Skype last year or so, and it doesn’t look they will be updating/improving a version of Linux.

Apple software is more stable then Microsoft and is more up to speed, but still a little behind, but not as much as Microsoft, and a lot of their stuff is nice looking, so I give them credit for that.

As far as I can tell. Android is the best. Apple maybe simpler to use, but overall, Android is better. Windows phone, never tried that, Blackberry... It is obsolete as soon as it came off the assembly line a couple of years ago. My Dad has one, my Sister had one, but upgraded to an Android, which she loves. The ball wheel thing to navigate in the Blackberry... In this day and age. Try navigating a web page on that, I have. It reminds me of the Dell computers, it's what they had in the mid 90's. Apple was already a head. I didn't know about Android back then. People usually go to Apple because of the name, more people are familiar with it. Usually since something is popular, they go for that item. Before I got an Android, which was in 2011. I was using a SAMSUNG SCH-N150. A phone from 2003. It was the best (for it;s time) unfortunately, it's doesn’t work outside the city much, so I had to upgrade. This phone had texting, and that was mostly it. Old graphics, because it was made few years after SMS became popular. It did have text to fax or something. I still have the phone, and my original one (same model). One broke or something, so I bought the same model, for $20 2 years ago. It's all I need, really. But, it's hardly compatible with the technology today. I now have a SAMSUNG Galaxy Ace Q, which is a bit better then my previous phone (the SAMSUNG Galaxy Ace). Nicer looking too.

I didn't intent for this post to be this long, sorry about the long post.



AdmiralCrunch
Sea Gull
Sea Gull

User avatar

Joined: 18 Apr 2010
Age: 44
Gender: Male
Posts: 227
Location: CT, USA

01 Aug 2012, 8:41 am

Foxface wrote:
People usually go to Apple because of the name, more people are familiar with it. Usually since something is popular, they go for that item.

Shhhh! The apple fanboys might hear you! :)

Quote:
Have thing for open source software. It's mostly what I use.

Good. You never have to worry about swapping out batteries or silly usage fees. You're doing the right thing by keeping up with the market so you'll be set.

Quote:
I didn't intent for this post to be this long, sorry about the long post.

Don't apologize for long posts. You're on the wrong forum to be embarrassed about your passion in your special interest.

Have you thought about doing programming? Android apps are created using the Java language. Everything you need to write the apps is free, and most school and town libraries have beginner's books on Java and Android programming. And if you decide to do so, feel free to ask any question on this forum; I'm sure everybody here would be glad to help you learn.


_________________
Dum vita est, spes est.


MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 41
Gender: Male
Posts: 1,385

01 Aug 2012, 10:52 am

AdmiralCrunch wrote:
Have you thought about doing programming? Android apps are created using the Java language. Everything you need to write the apps is free, and most school and town libraries have beginner's books on Java and Android programming. And if you decide to do so, feel free to ask any question on this forum; I'm sure everybody here would be glad to help you learn.


I'm trying to resist the urge to launch back into a tirade about Java. I am still adamantly of the opinion that garbage collected languages are fundamentally broken, and especially for mobile, TV, etc. This is a fundamental flaw in Android. As long as they're willing to work around it in the OS, I'm willing to work around it in my app by not using Java, and instead using the NDK though. :) It should be telling to everyone that Google was forced to launch an entire "Project Butter" just to get Android up to a consistent 60fps. That is something that should have been achievable just by having fast enough hardware, i.e. anything from the last 3-4 years.

Also as I mentioned in another thread, the Linux kernel is really starting to get crusty in its old age in a number of areas. I think Windows has actually progressed much faster and is now actually cleaner.



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 41
Gender: Male
Posts: 1,385

01 Aug 2012, 10:58 am

I think now would be an amazing time for someone to build a new open source OS. This is something I would love to do and I have a wish list :)