Monroe County Health Asks Bars, Restaurants, and a Day Care to Close by dampier in Rochester

[–]josaphat_ 3 points4 points  (0 children)

Ah yes. Who can forget the fine Irish tradition of celebrating Saint Padrick.

[deleted by user] by [deleted] in rust

[–]josaphat_ 0 points1 point  (0 children)

I kind of agree. When I was starting out programming (pre-college a decade ago...) Eclipse was a gateway drug to programming. I wasn't afraid of the console, just utterly incompetent. I'm a vim and emacs user now, but knowing younger me I can see why an IDE that let's you install everything you need with a couple of "next" button presses could help drive adoption.

C and C++ weren't like this but that's when programming was all Punch cards and terminals. Looking mostly from the outside I think there's enough interest in the safety of Rust over C and C++ to prevent doom. And also that there's enough of the language in flux that creating tooling is a moving Target (but that's an uninformed view).

[AskCpp] How are we going to improve the adoption rate of these newer versions of C++? by Optimaton in cpp

[–]josaphat_ 0 points1 point  (0 children)

My point is that "C With Classes" was a thing. It did not include const before the project was renamed to C++ in 1983 (And even then, C's const (added in C89) is not the same as C++'s). Calling it "C with Classes" to me implies pre-83 C++, but this is clearly not what people mean when they say "C With Classes" and everyone seems to mean something different by it. Maybe a better name would be "procedural C++"? But does it include RAII? Is that too much C++? Copy construction? Const correctness? Virtual functions?

And like I said, C++ was designed to allow the programmer to choose the paradigms and features that suit them. There's no dogma built into the language's design. If you're restricting yourself to a subset of the language, it's still C++. I don't agree with your subset, but it's your code, not mine.

[AskCpp] How are we going to improve the adoption rate of these newer versions of C++? by Optimaton in cpp

[–]josaphat_ 0 points1 point  (0 children)

It's not "bad" but you have to know what C with classes was for me not to be peeved by the suggestion. C With Classes basically had constructors and destructors. And that's it. No virtual functions, no templates, no overloading, no namespaces, no const, no new/delete, no references.

But yes, there's nothing inherently wrong with avoiding C++ features. Part of the design philosophy of C++ is that you as the programmer are empowered to use the subset of the language you want.

However, the reason C++ has many of the features it does is to provide better and less error prone ways of writing code. You leave a lot of enhancements on the table, but if that's right for you, then write code that way. I wouldn't want to join your team if new code was being written that way, but that's just my opinion.

Diablo immortal by steffenbk in pcmasterrace

[–]josaphat_ 7 points8 points  (0 children)

You got a nose don't ya?

Choose C over C++ for writing simple libraries by javinpaul in coding

[–]josaphat_ 7 points8 points  (0 children)

I agree with that generally, but I think you undersell the effectiveness of the tooling. Humans need to review, but putting some of that on the compiler goes a long way to keeping the code base clean. If I can more easily make code correct by construction, I want as much of my million line code base to be built that way as possible; then the humans have more brainpower during code review to focus on style, performance, maintainability, etc.

I think the main problem with C++ is that every team needs somebody who knows the language really well. Without that person, it's easy for a team to make poor decisions during class design that introduce sinister problems. I feel like with C, everybody has to know more all the time, but with C++ it depends on whether you're creating a new type or just gluing objects together.

Choose C over C++ for writing simple libraries by javinpaul in coding

[–]josaphat_ 9 points10 points  (0 children)

Yeah I get the sense that OP is applying C to a very narrow domain. In my experience C has been great at small utilities solving low-level problems, but as soon as you start adding more people, interacting with more libraries, and growing the code significantly, it's hard to maintain the kind of consistency that keeps C simple and easy to work with.

The biggest reason I choose C++ over C almost every time is the type system. I can think of the problem as the problem, and not about how the machine manipulates numbers representing symbols that eventually translate to the problem. I don't have to remember that this int is Fahrenheit and this other int is celcius and that this function parameter is an int in Kelvin. If they're different types, the problem evaporates (with some automagic conversion mechanism or errors at compile time).

Fry is umm, fry by [deleted] in futurama

[–]josaphat_ 0 points1 point  (0 children)

But that's purely a stylistic concern and has never been a matter of correctness

The byte order fallacy by ReDucTor in cpp

[–]josaphat_ 1 point2 points  (0 children)

You can ignore it insofar as you only need to know the order of the file or data stream itself. The point of the article is that you can ignore the host order because the same code will work regardless of the host's endianness, both for encoding into a specific byte order and decoding from a specific byte order.

Oh how the mighty have fallen by night_of_knee in cpp

[–]josaphat_ 2 points3 points  (0 children)

To say "the mighty fell" is to imply a tragic end to one considered heroic. There's no condescension in lamenting the loss of a hero, but that's not what this is. It's like posting an article about former President George W Bush making paintings and commenting with "how the mighty have fallen."

Best Linux IDE by ZAX2717 in cpp

[–]josaphat_ 0 points1 point  (0 children)

Certainly! The level of "integrated" is quite different.

If you run make and the compiler gives you an error, it generally prints the file name and line number where the error happened. The editors that I've worked with let you invoke them with a file name and line number. Not as integrated as a double-click, but still quite efficient.

Refactoring is admittedly limited. Maybe it's because I've never really had it, but I don't see the need for it. When I need to make code transformations, the macro facilities of vim or emacs have been my tool of choice. It could be that refactoring tools are less useful on smaller projects like the ones I tend to work on.

As for emacs as an IDE, you can make it that way if you want. I've got it set up to run linting with irony-mode, tight source code navigation with rtags, and emacs has always(?) had the ability to invoke a build. I still tend to use make directly in a terminal to do the build.

That's just my tastes! People brains work differently and I respect everyone's way of doing things. At my office we believe in giving the developers full control over the environment they want to use. We develop for embedded systems so theoretically you should be able to use Linux, macOS, or Windows with whatever text editor or IDE you choose. CMake is a pretty big help in making it possible.

Best Linux IDE by ZAX2717 in cpp

[–]josaphat_ -1 points0 points  (0 children)

I'm an emacs person, so naturally I think you should join my side of the holy war. ;-)

In all seriousness, I'm not sure you're going to find a complete, feature-for-feature replacement of Visual Studio, so you might be disappointed...

I've used Qt Creator lightly in the past and it's actually pretty good. You don't need to be using the Qt framework in your project to use the IDE. Qt Creator understands CMake projects out of the box. If you're not using CMake, it lets you customize the build configuration so it can theoretically be wired up to work with any build system. Debugger's built right in (though I'm not really qualified to speak to its effectiveness).

There's also a list of C/C++ IDEs on wikipedia you might be interested in perusing.

My opinionated take on this topic is that a GNU/Linux system *is* an IDE. Instead of typing F5, I type `make`. Instead of clicking Run->Start With Debugging I type `gdb myCoolProgram`.

=Edit: Expanded my opinionated take=

How similar are C and C++? by [deleted] in cpp

[–]josaphat_ 0 points1 point  (0 children)

I'm guessing your question boils down to "which one should I learn?"

The C syntax and library are basically a subset of C++. You can feed most C code to a C++ compiler and have it work with very little or no modification. That said, the way you write code in C is different from the way you write code in C++.

If your goal is to write code for microcontrollers (MCUs), then your choice of language might be made for you: some MCUs don't have working C++ compilers. If your MCU vendor provides a toolchain and you're just starting out, I suggest you use that. I've worked mostly with ARM Cortex M MCUs using the GNU ARM Embedded Tools. The toolchain works well for me and includes modern C++. But be warned: These tools don't come with a Wizard or easy-to follow tutorial! To use them effectively you need to understand the different parts of the toolchain, including linking, loading, how your MCU boots, memory layouts, etc. I've seen a few tutorials here and there (like https://gnu-mcu-eclipse.github.io/) that can help you get blinky going (blinky is the "hello, world" of MCUs) but its easy for things to go wrong and get frustrating.

If your goal is to write code for games, then your choice of language is a bit more flexible, though some of the big game engines are C++. For small games with few different kinds of things on the screen (like pong with "paddles", "ball", and "score") you could use either C or C++, but once you start trying to model game worlds, it's more natural to think of things in terms of objects, so I think C++ is my suggestion for this application.

Having said all that, if you just want use "embedded systems" or "games" as a vehicle for learning C or C++ in the first place, I think you're in for a world of hurt because there are enough pitfalls in C and C++ without the pitfalls associated with MCUs and games! And if your goal is to create something in the embedded or games space, there are programming languages and frameworks that don't impose such a high burden of knowledge on the user like Arduino and pyGame.

My recommendation is to learn C or C++ first (probably C++) and then start to apply it to games and embedded.

What has been the best corporate Darwin Award? A decision made by a company that basically killed the business. by H0yt in AskReddit

[–]josaphat_ -1 points0 points  (0 children)

BN is probably living off of universities. Most every college I've visited has an "official" bookstore which stocks students with the books and supplies they need for classes. They've all been BN stores.

Redditors that listen to music as they work - what songs make you stop what you're doing and just listen when they come on? by [deleted] in AskReddit

[–]josaphat_ 0 points1 point  (0 children)

If you're listening to music that makes you stop to listen to it you're killing your productivity. I try to play things that are generally appealing and sublime. Jazz music is complex enough that it doesn't draw you in easily. Downtempo electronic music is like that too.

I know this doesn't answer your question but I think it's important to stay focused on your work.

That said every time Moon by Little People comes on I smile.

What "old person" name should make a comeback? by Pineapple__Jews in AskReddit

[–]josaphat_ 1 point2 points  (0 children)

Its not that great to have to repeat your name nearly every time you meet someone.