Jump to content
On 10.05.2016 at 11:01 PM, derrickd241 said:

I seen a post on someone that hates Java.  Well, I'm taking my first C++ class and its so confusing, I'm considering taking advanced python instead, or maybe a different language all together since I'm supposed to take an advanced C++ class also.  I absolutely love python, I could just sit down and come up with something I could code and make it happen with C++ i feel like I'm fixing more errors then actually writing out code unlike python haha anyways rant... over...

I hate it too after   1 and half  of usage(self-taught) and i basically abandoned it, its just an impossible language, my first language was C# where i would write a class and was available everywhere in other classes i didnt give a shit about .h and .cpp, but C++ man pfft, even after a dozen books i still have no idea how to structure my C++ program and where data should "live", and how to manipulate it, couldnt find any design books/guides/talks about it, its strange. 

Altough it seems simple idea since in OOP  everything lives inside a class and you make instances of those classes in other classes well when it comes to object interactions = spaghetti broken code that only gets worse and worse, at least in the 3D renderer i tried to write.

 

If you have no interest in low level programming like graphics or high performance stuff, C++ is not a good idea, the frustration is unbearable for me. I would suggest C#/python/java but it really depends on what you want to do with code mainly, you cant be the know it all programmer , you should aim for a particular subdomain of programming and learn its best used tools(languages/frameworks).

This comes from my little experience, if you have no idea on what you want to program you are going to waste you'r time going from language to language.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7748021
Share on other sites

Link to post
Share on other sites

On 5/10/2016 at 6:21 AM, Tedster said:

But use free software!!!

Code::Blocks!

Vim masterrace

CPU: Intel Core i7-4770k | Mobo: MSI Mpower Max | Cooling: Cryorig R1 Ultimate w/ XT140 front Fan | GPU: EVGA GTX 770 Dual SC SLI | Case: NZXT H440 | Case Fans: Phanteks PH-140SP x5 | PSU: EVGA Supernova P2 1000W | RAM: 16GB Crucial Ballistix Tactical Tracer | SSD: Kingston HyperX 3k 120GB | HDD: Seagate Barracude

Keyboard: Razer Blackwidow Ultimate 2013 | Mouse: Razer Deathadder 2013 | Headphones: Sennheiser HD438s | Mousepad: Razer Goliathus Control | Monitor 1: Benq XL2430T | Monitor 2: BenQ RL2455HM 

 

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7748122
Share on other sites

Link to post
Share on other sites

8 minutes ago, derrickd241 said:

Just installed code::blocks for the first time played around for about 10 mins and im already absolutely in love so far... way easier to understand then VS

Ease is good, but learning is even better. I'm using text editors with compilers and learning how those things really work.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7760545
Share on other sites

Link to post
Share on other sites

10 minutes ago, Bigfootmandude said:

Is this your first time programming in an OOP style? It might be worth learning java as in between python and C++. Or C#. They would help you learn that style of programming before you can start to learn the complexities and details that come with C++.

Java and C# can be very overwhelming, I think Ruby is a good thing to learn before them to grasp the OOP concepts.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7769918
Share on other sites

Link to post
Share on other sites

I found C++ a little more annoying to grasp when it came to OOP concepts because the syntax was kind of annoying. C# allowed me to grasp OOP a lot easier because it's more... straightforward and C like to me.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7770956
Share on other sites

Link to post
Share on other sites

22 hours ago, Bigfootmandude said:

Is this your first time programming in an OOP style? It might be worth learning java as in between python and C++. Or C#. They would help you learn that style of programming before you can start to learn the complexities and details that come with C++.

That would be great if I wasn't already 7 weeks into my C++ class in college lol and I have to take advance C++ also sooo.... I'll be pretty well versed in C++ by the end of my next semester even though its not my favorite language to program with but I can see now how its so powerful especially when its possibly the fastest executing or second fastest because some people believe that plain C is slightly faster at executing

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7774677
Share on other sites

Link to post
Share on other sites

I don't like C++ either but it's because I hate object-oriented programming. OO already sucks but all of the obnoxious boilerplate code that comes with it makes it suck a lot more.

 

Edit: I don't hate OOP because I hate objects. Rather, I hate OOP because I hate the current implementations. See: here

"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7782035
Share on other sites

Link to post
Share on other sites

I am currently settled between two languages C# and C++. C# is great when I need to do something quickly and that will not do any heavy computational things. On the other hand, I use C++ when I am working on projects where I need optimized code and in cases that my application needs to work on both Windows and Linux.

Sometimes I use both of them at the same time - optimized C++ code in DLL which I interface with C# controller application.

C++ can be really frustrating because you need to go step by step without that much of automatization (unlike in C#, Python and similar where you can substitute 10 lines of C++ code in 1-3 lines in some cases). I've found somewhere this description of C++ which I really like and think that it is the best suited one. It goes something like this - "C++ is like nunchucks. While mastering them you will hurt yourself many times, but when you master them, they become really powerful weapon".

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7782472
Share on other sites

Link to post
Share on other sites

19 hours ago, Niksa said:

I am currently settled between two languages C# and C++. C# is great when I need to do something quickly and that will not do any heavy computational things. On the other hand, I use C++ when I am working on projects where I need optimized code and in cases that my application needs to work on both Windows and Linux.

Sometimes I use both of them at the same time - optimized C++ code in DLL which I interface with C# controller application.

C++ can be really frustrating because you need to go step by step without that much of automatization (unlike in C#, Python and similar where you can substitute 10 lines of C++ code in 1-3 lines in some cases). I've found somewhere this description of C++ which I really like and think that it is the best suited one. It goes something like this - "C++ is like nunchucks. While mastering them you will hurt yourself many times, but when you master them, they become really powerful weapon".

C# can also run on Linux, you just can't use any of the Windows-specific APIs and use GTK#.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7786751
Share on other sites

Link to post
Share on other sites

On 22.5.2016 at 11:24 AM, AkaCrabby said:

I don't like C++ either but it's because I hate object-oriented programming. OO already sucks but all of the obnoxious boilerplate code that comes with it makes it suck a lot more.

I can't help but think you must not fully grasp OOP then, or only write low level software. The abstractions OOP helps you to build easily and polymorphism are things that any somewhat larger program needs. If you use a non-OOP language you'll be spending lots of time writing cumbersome systems that eventually mimic this same behavior without realizing it.

 

An example would be drawing software, imagine it must be able to draw various shapes. In OOP you make an abstraction called 'shape' and the main software only uses 'shape' objects. You then provide various implementations of 'shape' called 'circle', 'square' and so on. The main software can work with any shape that adheres to the 'shape' interface without even knowing the implementation, you can even add more shapes without having to change or  recompile the main software (think about the benefits of not having to fully test and debug the main program every time a shape is added).

 

This is basic functionality in any decent OOP language, yet just think of the horrible code mess you'll have to write in non-OOP languages to get to this same behaviour.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7787412
Share on other sites

Link to post
Share on other sites

After starting with Java and eventually moving to C# I find that I dislike C++ as well.  Don't get me wrong C++ is a fantastic and powerful language. But I can make much better use of the functionalities of Java and C# because I have used them way more frequently so I just understand them more.  It boils down to what you know and understand and your motivation to learn new things.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7787971
Share on other sites

Link to post
Share on other sites

14 minutes ago, Dat Guy said:

Also, it boils down to the target system's resources.

In the context of C++ one should note that C++ works by the "you don't pay for what you don't use" philosophy.

So one can state it is suitable for any platform. If you don't use expensive features you don't pay for them (they don't end up in the machine code making it bigger/slower). If you DO use them, because you need them, you need to make a fair comparison against how expensive it would be to achieve the same functionality in another language.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7788039
Share on other sites

Link to post
Share on other sites

9 hours ago, Unimportant said:

I can't help but think you must not fully grasp OOP then, or only write low level software. The abstractions OOP helps you to build easily and polymorphism are things that any somewhat larger program needs. If you use a non-OOP language you'll be spending lots of time writing cumbersome systems that eventually mimic this same behavior without realizing it.

No, I know how it works very well. Like many (if not most) universities, my university's computer science program taught it to us very extensively. When I said "I hate object-oriented programming" and "OO already sucks" I didn't mean to imply that OOP is inherently bad (they were unnecessarily ambiguous statements so I've since corrected them). Rather, I meant that the current implementations of OOP are bad. I absolutely agree that the concept behind objects is great and forward-thinking but the implementation of the concept comes at costs far higher than it ever should have been. Objects should have been implemented as an extension of structs and not a completely separate thing. Perhaps more over though, programmers today are being taught and encouraged to write all of this boilerplate code even when they're creating tiny little static objects but a struct would have gotten them what they wanted with far less code and far less complexity.

 

If I can cheerlead for Golang for a bit, I think they've done objects almost perfectly. Copying from sp13:

type rect struct {
    width int
    height int
}
	 
func (r *rect) area() int {
    return r.width * r.height
}
	 
func main() {
    r := rect { width: 10, height: 5 }
    fmt.Println("area: " , r.area())
}

 

 

"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7789956
Share on other sites

Link to post
Share on other sites

5 minutes ago, AkaCrabby said:

Objects should have been implemented as an extension of structs and not a completely separate thing.

By objects I assume you mean classes? because structs are objects too. Classes and structs in C++ are the exact same thing with a different default access modifier. Class defaults to private and struct defaults to public.

Quote

 Programmers today are being encouraged to write all of this boilerplate code when they're creating tiny little static objects when a struct would have gotten them what they wanted with far less code and far less complexity.

A struct would be the exact same amount of code and complexity. Either way this a problem with how the language is being taught, not the language or OOPness itself.

 

I don't see how the Go code you posted is any different than C++

struct Rect
{
    int width;
    int height;
    int area() const { return width * height; }
};

int main()
{
    Rect r { 10, 5 };
    std::cout << "area: " << r.area() << "\n";
}

Or if you just don't like the function being inside the struct

struct Rect
{
    int width;
    int height;
};

int area(const Rect& r)
{ 
    return r.width * r.height; 
}

int main()
{
    Rect r { 10, 5 };
    std::cout << "area: " << area(r) << "\n";
}

 

1474412270.2748842

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7790115
Share on other sites

Link to post
Share on other sites

On ‎5‎/‎10‎/‎2016 at 4:04 AM, Nineshadow said:

I like C++.

I'm trying to learn it.

 

On ‎5‎/‎10‎/‎2016 at 4:21 AM, Tedster said:

But use free software!!!

Code::Blocks!

Visual Studio Community is Free.

 

On ‎5‎/‎10‎/‎2016 at 4:18 AM, derrickd241 said:

I'm trying to get used to visual studio and learn a C++ at the same time I've never even opened visual studio until i took this class its even more complicated then the language haha

Visual Studio is awesome. It's a bit overwhelming at first but you'll get used to it.

 

On ‎5‎/‎10‎/‎2016 at 4:05 AM, trag1c said:

C++ is love C++ is life. I use that shit for everything.

What do you use for the GUI in a C++ program if it needs a GUI?

 

On ‎5‎/‎10‎/‎2016 at 4:01 AM, derrickd241 said:

I seen a post on someone that hates Java.  Well, I'm taking my first C++ class and its so confusing, I'm considering taking advanced python instead, or maybe a different language all together since I'm supposed to take an advanced C++ class also.  I absolutely love python, I could just sit down and come up with something I could code and make it happen with C++ i feel like I'm fixing more errors then actually writing out code unlike python haha anyways rant... over...

Learn C#, then Java and then C++. You will thank me later after you have a newfound appreciation for Java and C#.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7792279
Share on other sites

Link to post
Share on other sites

5 hours ago, AluminiumTech said:

I'm trying to learn it.

 

Visual Studio Community is Free.

 

Visual Studio is awesome. It's a bit overwhelming at first but you'll get used to it.

 

What do you use for the GUI in a C++ program if it needs a GUI?

 

Learn C#, then Java and then C++. You will thank me later after you have a newfound appreciation for Java and C#.

Honestly I would love to learn C# and a bit of Java as well, but I'm already taking this class so it's a little late for that lol

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7793898
Share on other sites

Link to post
Share on other sites

6 hours ago, AluminiumTech said:

What do you use for the GUI in a C++ program if it needs a GUI?

There are a few options that you could use depending on your platform(s) and requirements. 

 

1) Win32 API for Windows

2) X Window System for Linux

3) Not sure about OSX as I have never used it before.

4) Qt is a cross platform GUI library that is available for commercial use.

5) Use C++ interop with another language that is generally used for GUI's such as C#

 

There is another option that I personally prefer to use as I do a lot of graphics programming for games/engines. Basically I use my rendering engine to render sprites that have their normals (faced) always pointing towards the camera with orthographic projection which then renders the image above any other rendering  (such as game elements). I then transform 2D mouse coordinates into a world space vector which is then used for intersection checks with the sprites. (there are simpler ways to do this but this a piece of functionality that can be used in a lot of other places besides GUI.) After a sprite has been intersected it fires an event to an awaiting script to do its logic. 

 

This system uses any of the above API's to open a very simple window which is then used by the rendering engine. This method creates what is called a WYSIWYG (what you see is what you get) editor for the engine/game as well as in game GUI for the game.

 

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7794458
Share on other sites

Link to post
Share on other sites

3 hours ago, trag1c said:

There are a few options that you could use depending on your platform(s) and requirements. 

 

1) Win32 API for Windows

2) X Window System for Linux

3) Not sure about OSX as I have never used it before.

4) Qt is a cross platform GUI library that is available for commercial use.

5) Use C++ interop with another language that is generally used for GUI's such as C#

 

There is another option that I personally prefer to use as I do a lot of graphics programming for games/engines. Basically I use my rendering engine to render sprites that have their normals (faced) always pointing towards the camera with orthographic projection which then renders the image above any other rendering  (such as game elements). I then transform 2D mouse coordinates into a world space vector which is then used for intersection checks with the sprites. (there are simpler ways to do this but this a piece of functionality that can be used in a lot of other places besides GUI.) After a sprite has been intersected it fires an event to an awaiting script to do its logic. 

 

This system uses any of the above API's to open a very simple window which is then used by the rendering engine. This method creates what is called a WYSIWYG (what you see is what you get) editor for the engine/game as well as in game GUI for the game.

 

What about GTK2 +? Doesn't that work on Windows, Mac and Linux?

 

And where can I learn how to use the Win32 API for GUI stuff? I wanna get into C++ more but what I want to make needs a GUI.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7795427
Share on other sites

Link to post
Share on other sites

10 hours ago, AluminiumTech said:

What do you use for the GUI in a C++ program if it needs a GUI?

Depends on the target platform. In general, I'm one of those freaks who prefer slickness over looks, my next GUI application will use C++/Tk. Otherwise, you could use full-blown "frameworks" like Qt (although Qt is almost its own programming language with all its abstractions) or wxWidgets if you're after the looks. I found developing with most of these "big frameworks" to be rather annoying.

Write in C.

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7795464
Share on other sites

Link to post
Share on other sites

1 hour ago, AluminiumTech said:

What about GTK2 +? Doesn't that work on Windows, Mac and Linux?

 

And where can I learn how to use the Win32 API for GUI stuff? I wanna get into C++ more but what I want to make needs a GUI.

I forgot about GTK. MSDN is the place to go for anything Windows programming.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
https://linustechtips.com/topic/594176-i-hate-c/page/2/#findComment-7795633
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×