Welcome, Guest. Please login or register.

Author Topic: C vs C++ ... or whatever language  (Read 20921 times)

Description:

0 Members and 2 Guests are viewing this topic.

guest11527

  • Guest
Re: C vs C++ ... or whatever language
« Reply #44 from previous page: February 11, 2018, 09:47:57 AM »
Quote from: Mr_Capehill;836024
What sort of test case? I have used std::vector to take care of memory management and just passed the pointer (myVector.data()) to OpenGL, for example.
In that case, of course, the speed is quite the same. No, I'm talking about a wavelet filter, in particular. No "pointer access", but then access to vector elements by operator[]. That is slower than doing it by pointers directly, even though, in principle, the compiler could optimize everything away. In reality, it does not.
 

Offline PlazTopic starter

Re: C vs C++ ... or whatever language
« Reply #45 on: February 12, 2018, 11:49:08 PM »
Quote
Accelerated C++: Practical Programming


I gave this a quick read today. I found it moves very quickly which may be a problem for new learners. (of course the first clue is "accererated") By the end of chapter 3 I wanted to raise my hand and as the instructor a question. Dang it, not included. :)

Plaz
 

Offline nicholas

Re: C vs C++ ... or whatever language
« Reply #46 on: February 13, 2018, 07:40:14 AM »
Quote from: Plaz;836074
I gave this a quick read today. I found it moves very quickly which may be a problem for new learners. (of course the first clue is "accererated") By the end of chapter 3 I wanted to raise my hand and as the instructor a question. Dang it, not included. :)

Plaz



Hehe :)

Yeah it's not for absolute beginners with no experience though I did give my old copy to a neighbour's sister last Friday who has only ever done a bit of JS (I think) with Codecademy, so it should be a good test of it. Admittedly she's got me to ask questions to.
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
C vs C++ ... or whatever language
« Reply #47 on: February 16, 2018, 09:14:49 AM »
Arguably, C++ is not for beginners either.
 

Offline psxphill

Re: C vs C++ ... or whatever language
« Reply #48 on: February 16, 2018, 12:21:34 PM »
Quote from: SamuraiCrow;836178
Arguably, C++ is not for beginners either.


It depends on how long you want to stay a beginner. If you're after instant gratification then c++ is not ideal.

There is no reason a beginner couldn't go straight for assembly language.
 

guest11527

  • Guest
Re: C vs C++ ... or whatever language
« Reply #49 on: February 16, 2018, 01:18:56 PM »
Quote from: psxphill;836182
It depends on how long you want to stay a beginner. If you're after instant gratification then c++ is not ideal.

There is no reason a beginner couldn't go straight for assembly language.

While I tend to agree, I believe he got a point. C++ does not force you into a particular programming style. While this property of the language is certainly helpful for advanced programmers, it makes it unecessary hard for beginners to develop a good style.
 

Offline nicholas

Re: C vs C++ ... or whatever language
« Reply #50 on: February 16, 2018, 02:21:27 PM »
Quote from: SamuraiCrow;836178
Arguably, C++ is not for beginners either.

I'd agree generally, but C++ in a "C with Classes" style is fine for total beginners in my experience.

This book proves it really http://steveheller.org/whoscpp.htm
« Last Edit: February 16, 2018, 02:33:04 PM by nicholas »
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline psxphill

Re: C vs C++ ... or whatever language
« Reply #51 on: February 16, 2018, 10:04:10 PM »
Quote from: Thomas Richter;836183
C++ does not force you into a particular programming style. While this property of the language is certainly helpful for advanced programmers, it makes it unecessary hard for beginners to develop a good style.

But taking a detour via another language isn't going to develop a good style either.

Your argument is like saying: Chinese is hard to learn, so instead of learning it when you are a child you should learn another language first and speak that for a while and then learn chinese when you're in your 30's.

Developing a good style is an innate skill. If you struggle then you're probably not cut out for development.
« Last Edit: February 16, 2018, 10:06:31 PM by psxphill »
 

guest11527

  • Guest
Re: C vs C++ ... or whatever language
« Reply #52 on: February 16, 2018, 11:07:50 PM »
Quote from: psxphill;836199
But taking a detour via another language isn't going to develop a good style either.

I don't think so. Look, once you've learned one language, it is relatively easy to carry over concepts to another. Good software developers will master whatever language they should write programs in. It is just hard to get started and understand the concepts.

Otherwise, people from my age would have never been able to develop a style as probably most of us started from Basic. And that is a terrible language.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: C vs C++ ... or whatever language
« Reply #53 on: February 17, 2018, 10:02:35 AM »
I can say that in all honesty, I've had the most fun coding in C++ on the Amiga. It's a huge Swiss Army knife and I've found uses for almost every language feature but for 68K/Amiga my preferred approach is C with Classes with minor uses of templates, usually to provide type safe interfaces to low level specialisations around void* pointers or to provide custom inline assembler for certain operations.

These days I rarely get to code anything outside of work, let alone on the Amiga :(
int p; // A
 

Offline kolla

Re: C vs C++ ... or whatever language
« Reply #54 on: February 17, 2018, 03:08:45 PM »
What C++ options are there for Amiga? :)
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: C vs C++ ... or whatever language
« Reply #55 on: February 17, 2018, 05:33:05 PM »
GCC obviously.

You could also go with StormC which might have been a MaxonC derivate from V1 to V3 and was GCC based in V4.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline PlazTopic starter

Re: C vs C++ ... or whatever language
« Reply #56 on: February 18, 2018, 12:11:32 AM »
Quote from: kolla;836231
What C++ options are there for Amiga? :)


With tech assist from Chris_Y I built GCC 6.x cross compiler, successfully build Netsurf and ran it on AmigaForver.

Plaz
 

Offline nicholas

Re: C vs C++ ... or whatever language
« Reply #57 on: February 18, 2018, 09:17:55 AM »
Quote from: Kronos;836234
GCC obviously.

You could also go with StormC which might have been a MaxonC derivate from V1 to V3 and was GCC based in V4.


SAS/C 7.01 supports a subset of C++ too.

http://aminet.net/package/dev/c/expsascxx
« Last Edit: February 18, 2018, 09:25:21 AM by nicholas »
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: C vs C++ ... or whatever language
« Reply #58 on: February 19, 2018, 11:32:20 AM »
Quote from: nicholas;836255
SAS/C 7.01 supports a subset of C++ too.

http://aminet.net/package/dev/c/expsascxx


You obviously never tried to compile C++ with that.

I did, on an 68030 with 7MB (4MB on the A2630,2MB Z2 and 1MB CHIP).

It might be somewhat useable with today's resources (NG or UAE) ....



.... for compiling and running........
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline nicholas

Re: C vs C++ ... or whatever language
« Reply #59 on: February 19, 2018, 03:33:41 PM »
Quote from: Kronos;836304
You obviously never tried to compile C++ with that.

I did, on an 68030 with 7MB (4MB on the A2630,2MB Z2 and 1MB CHIP).

It might be somewhat useable with today's resources (NG or UAE) ....


.... for compiling and running........



Who in their right mind compiles anything bigger than hello world on 68k silicon today though? ;)

SAS/C 7 ran fine under MorphOS on my PowerBook last time I tried (circa 2013) but obviously there are far better solutions like GCC.

It's a shame vbcc was never given C++ support IMHO though.
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini