The programming thread.

TDD definitely has its benefits. Especially to make sure that whatever code is being written it at least can be tested and that you do this with simplicity in mind. Although it tends to lead to plenty of refactoring, which probably is the case for anything that is done iteratively.
Still, even for code that is tested and passes the tests successfully, it can still have bugs. Especially when the input is not deterministic. Like having a human being using it. The ways people come up with using whatever you make, never ceases to amaze me.
 
Joined
Aug 30, 2006
Messages
11,223
compiling.png
 
Joined
Nov 11, 2019
Messages
2,097
Location
beRgen@noRway
And by extension, all those bugs that are between the chair and the keyboard, and that cannot be tested. :lol:
You mean the Id-10T error?
 
Joined
May 6, 2013
Messages
4,968
Location
Germany
<sigh> All that nice talk about pipelines, automated testing, and so on. Where I work, we're "working toward that." We have been for at least five years now.

It's not too big of a deal with one of my apps. It isn't all that huge and I'm doing everything in it, from the database all the way to the front end. When you've got the full stack, merging code gets mighty easy! Testing, on the other hand.. basically, that's all me as well, with some possible help from the project manager. At least I know the application inside out, so 'change here breaks dat dehr' is rare.

With other apps, though, it's not so good. The effort going into switching to modern workflow in is way too small to really make it happen.

I think what's really killing it is how work efforts get decided. I work at a company that isn't an IT business; we just work on custom applications to help them run that business. The organization is set up in such a way that the business (specifically, the high level managers) tell us what we should be working on. It's been great for getting big effort business features done. It's pretty good for getting issues that only the folks really using the applications see, too. (The business isn't a huge one - when the bottom level complains, the top level can still hear it.) It's pretty terrible when it comes to IT people working on stuff that IT needs, though. Taking a few weeks to figure out how to get as much as we can into modern work-flows, though? No way. There are too many "critical initiatives".

We did get a little back door recently, though. Somebody high up managed to convince the business to spend some time on one specific goal: get product out on time. Well, there's very little we do that doesn't fit under that goal! That gave us a way to spend time on things than the critical initiatives, like putting some basic telemetry in our applications and recording errors in our database instead of just emailing the developers. (Outlook is astoundingly poor when it comes to researching errors!) I hope it lasts long enough to make some reports on all that data but, even if it doesn't, at least I can pop in and do a quick SQL query to figure out how long an error has been happening or see if anyone is actually using that button I put in two years ago.
 
Joined
Aug 3, 2008
Messages
8,238
Location
Kansas City
I'm having a good time reading Programming Rust, by Blandy, Orendorff & Tindall. A very good book, but what's even more interesting is the concepts around this programming language and how they have tackled multiple problems.

I still have a lot to read (and learn) before even being able to do simple things on my own, but it could be a good candidate for a language compiled into native code, since these last years I've only used bytecode-compiled languages (last time I used C++ was years ago).

There's no reliable IDE yet though, which is a bummer, but the IntelliJ plugin is good enough at the moment (despite its 2k open bugs...). I'm not sure it could withstand a full-scaled project, however.
 
Joined
Aug 29, 2020
Messages
10,157
Location
Good old Europe
You can also used VS Code for Rust. I belief you can also debug Rust from VSCode.
 
Joined
Aug 30, 2006
Messages
11,223
old_days.png


pibbuR who remembers the old days, but not exactly like this.

PS. I'm now fairly comfortable with C++, and has for a while been working with Qt. Qt is huuuuge, but I've got the hang of the things I need for my hobby project (PibburWorks, edition 2). Some frustrations: Qt creator doesn't support recent C++ 20 features like modules. It's a bit strange since I use the MSVC compiler which now supports all of it. Using things like smart pointers seems also a bit difficult. Most functions return raw pointer for objects. In some cases using standard smart pointers work, in other cases not. DS.

PPS. I assume some of these frustrations may disappear when I get more experienmce. DS

PPPS: At the moment I'm looking at using Qt with 3D libraries. Currently examining (modern) openGL, which is directly supported. But I will in the not so distand future (a week) probably switch to Vulkan. DS.

PPPPS. It's fun! DS

PPPPPS: YAY!!! DS

PPPPPPS. Eh… Sorry. DS.
 
Last edited:
Joined
Nov 11, 2019
Messages
2,097
Location
beRgen@noRway
Some frustrations: Qt creator doesn't support recent C++ 20 features like modules. It's a bit strange since I use the MSVC compiler which now supports all of it. Using things like smart pointers seems also a bit difficult. Most functions return raw pointer for objects. In some cases using standard smart pointers work, in other cases not. DS.

Nice, it looks like the modules in Rust or the packages in Java/Kotlin. I'm surprised there was nothing similar before in C++.

CMake doesn't support them yet, that may slow things down for Qt Creator. But isn't there a Qt Creator extension for Visual Studio? That IDE was very good last time I used it, but it's been a few years. It may be a good compromise for you but I don't know how well it compares to Qt Creator alone.


... And now I see that Qt Creator can be used as an IDE for Rust, I didn't know that! I'm happy with my current setup, but it's a little strange to have do that with the IntelliJ IDE that was made for Java, while Rust development is more similar to C++. I'm tempted to try it, even if I'm not using Qt. I've seen many praises on this IDE; I've used it a long time ago and it was already very promising.
 
Joined
Aug 29, 2020
Messages
10,157
Location
Good old Europe
I'd like to do programming on both Windows and Linux, and using the same IDE seems like a good idea. Another option is VS code, who has support for Qt.

But of course, from Qt creator I can also easily open QT designer.

pibbuR
 
Joined
Nov 11, 2019
Messages
2,097
Location
beRgen@noRway
VS Code is nice, but it's not really an IDE. Maybe it's possible to configure it so it offers enough IDE features. After all, it's possible to do that with gvim too.

Using things like smart pointers seems also a bit difficult. Most functions return raw pointer for objects. In some cases using standard smart pointers work, in other cases not. DS.


I thought you could simply give a raw pointer to a smart pointer and start from there? Then of course you have to provide raw pointers back to the Qt functions I suppose, I'm not sure how C++ manages that, especially in asynchronous GUI code.

Ownership and references are at the core of Rust, and it makes it more difficult to write the code, sometimes, but at least it forces the programmer to make the intentions clear since everything is verified by the compiler. Getting a null pointer exception or a race condition is almost impossible. For example, I have to use specific asynchronous smart pointers (or a mutex) if the code is not always on the same thread.
 
Last edited:
Joined
Aug 29, 2020
Messages
10,157
Location
Good old Europe
VS Code is nice, but it's not really an IDE. Maybe it's possible to configure it so it offers enough IDE features. After all, it's possible to do that with gvim too.
I know. I have used VS code before. I just have to remember how I used it.
I thought you could simply give a raw pointer to a smart pointer and start from there? Then of course you have to provide raw pointers back to the Qt functions I suppose, I'm not sure how C++ manages that, especially in asynchronous GUI code.
C++ supports it both ways. That's how I've used it. However, I will have to do a lot of clean up in my code, to make in consistent (so much for the "benefits" of laziess.).
Ownership and references are at the core of Rust…Getting a null pointer exception or a race condition is almost impossible.
Now, where's the fun in that? (yes, yes, nowhere actually).

pibbuR
 
Joined
Nov 11, 2019
Messages
2,097
Location
beRgen@noRway
I think that for code that doesn't need to be compiled, VSCode is as good as an IDE. I'm using it for RPGWatch. I can develop the code, use a real-time syntax checker and formatter. I can run the code an debug it in VSCode and I can do that for PHP, javascript and HTML. There is also integration with git and I can even do SQL. I don't think an IDE has anything more to offer, besides a much larger footprint.
 
Joined
Aug 30, 2006
Messages
11,223
I think that for code that doesn't need to be compiled, VSCode is as good as an IDE. I'm using it for RPGWatch. I can develop the code, use a real-time syntax checker and formatter. I can run the code an debug it in VSCode and I can do that for PHP, javascript and HTML. There is also integration with git and I can even do SQL. I don't think an IDE has anything more to offer, besides a much larger footprint.
Yeah, it's my go-to, even in Linux now. I used to use Atom a bit, but VS Code has surpassed it (and Atom is being retired anyway).
These days I mainly use it for Python (personal projects and stuff to aid my data analysis work) and a little Golang, where there is auto-complete and everything. I don't see the point of a full-noise IDE. Commercially, I've developed in C#, Java, PHP, Python, and a little C++, using IDEs like Visual Studio (a monster), Eclipse, and Netbeans, and I don't miss them.

The only recent use of an IDE was when I had to throw together a more complex GUI for a something based on PyQt5, and I used the GUI builder in Qt Creator for that, but not for the code side of things.
 
Joined
Oct 18, 2006
Messages
2,245
Location
New Zealand
Maybe I've become lazy or I've been spoiled by Jetbrains, but I do enjoy a good refactoring feature set. ;) And a good code awareness.

To quickly open and create script files, though, I'd use something lighter like VSCode or Atom (but isn't that one about to be abandoned? And its version of Electron is completely outdated).
 
Joined
Aug 29, 2020
Messages
10,157
Location
Good old Europe
Maybe I've become lazy or I've been spoiled by Jetbrains, but I do enjoy a good refactoring feature set. ;) And a good code awareness.
VSCode has Intellisense and basic refactorings. The only refactorings I did with any frequency in proper IDEs was Rename Symbol or Extract Method and VSCode has both of those. I imagine there might be other cool/useful stuff I'm unaware of.

Atom (but isn't that one about to be abandoned? And its version of Electron is completely outdated).
Yep, MS is retiring it (they own GitHub and Atom now) in favour of VSCode.
 
Joined
Oct 18, 2006
Messages
2,245
Location
New Zealand
VSCode has Intellisense and basic refactorings. The only refactorings I did with any frequency in proper IDEs was Rename Symbol or Extract Method and VSCode has both of those. I imagine there might be other cool/useful stuff I'm unaware of.


Yep, MS is retiring it (they own GitHub and Atom now) in favour of VSCode.

VS Code seems to have good code awareness and refactoring for Python, but it's still a far cry from what I get with PyCharm (or IntelliJ for other languages). And for Kotlin or Rust, there's only generic syntax highlighting unless you start downloading a bunch of plugins.

So I guess my main reproach is that you have to find, choose, configure and rely on a collection of 3rd-party plugins rather than having a more complete and consistent experience after downloading only one single tool. It may depend on the language.

This has a price of course, IntelliJ is heavier on the resources when it has to index a big project, though that's mainly due to the nature of those projects (working with Gradle and Android SDK is complex, for ex - I'm not even sure VS Code would easily support that). IntelliJ and PyCharm also take a lot of things in charge, like downloading most of the appropriate tools and environments for any project. I used to be impressed by Visual Studio but this is even better.

I didn't know Atom was owned by GitHub. They seem ready to hand it over, but it would require a good and willing team to take over and continue the work. I don't know them well enough to tell if there's any advantage vs VS Code.
 
Joined
Aug 29, 2020
Messages
10,157
Location
Good old Europe
VS Code seems to have good code awareness and refactoring for Python, but it's still a far cry from what I get with PyCharm (or IntelliJ for other languages). And for Kotlin or Rust, there's only generic syntax highlighting unless you start downloading a bunch of plugins.
I'm not claiming VSCode is the solution for everything, but this is a strange statement given that the basis of VSCode is to add functionality and language support via plugins.
 
Joined
Aug 30, 2006
Messages
11,223
I'm not claiming VSCode is the solution for everything, but this is a strange statement given that the basis of VSCode is to add functionality and language support via plugins.

I mean I had to install several of them, and change the selection of plugins once or twice to get what I needed. Just for one language. I had a similar experience for another one, where I had to select one plugin, and yet another one to get more functionality. It's not a big deal but sometimes I wasn't sure which plugin was the best since there were a few competing ones.

So it's a good tool, but for a complete set of features it's so much easier with an IDE made for that purpose. I'm only outlining the respective advantages.
 
Joined
Aug 29, 2020
Messages
10,157
Location
Good old Europe
Back
Top Bottom