The programming thread. - Page 2 - RPGWatch Forums
|
Your donations keep RPGWatch running!
RPGWatch Forums » General Forums » Off-Topic » The programming thread.

Default The programming thread.

September 4th, 2021, 05:37
Opti what? Well, "opti" - so I guess this has something to do with computer cameras?
--
The very powerful and the very stupid have one thing in common: instead of altering their views to fit the facts, they alter the facts to fit their views….
-- Doctor Who in "Face of Evil"
Zloth is offline

Zloth

Zloth's Avatar
I smell a… wumpus!?

#21

Join Date: Aug 2008
Location: Kansas City
Posts: 7,645
Mentioned: 34 Post(s)
+1:

Default 

September 4th, 2021, 16:08
tl;dr: Hello World the Qt5 way

OK.. Here's that famous program wrtitten for Qt 5, using the Qt Creator IDE. Except for the Xml, it's much simpler than the Win32 API version. And most of the code was created visually. And there's far more C++ code.

It's not as beautiful as the Win API (IMO), but it's practical (and probably powerful) so I'll explore it further. And it will work on Linux.

4 files:
//main.cpp: Main Program
#include "mainwindow.h"

#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

-----------------------------------------------------------------------------------------------
//mainwindow.h: Main window class declaration
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();

private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H

----------------------------------------------------------------------------------------
//mainwindow.cpp: Main window cclass definition
#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}

MainWindow::~MainWindow()
{
delete ui;
}

---------------------------------------------------------------------------------------------
//mainwindow.ui: User interface
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QLabel" name="StatusLabel">
<property name="geometry">
<rect>
<x>170</x>
<y>250</y>
<width>191</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Hello Pibbur</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

protected: pibbuR

PS. Whatabout MFC? Mostly given up on that. It's old, as is most documentation. And VS support left something to be desired. Wizards worked (after changing a few settings). Building MFC applications from the ground up, which is the way I like to learn things caused linking problems (where is the cdecl __main function?). No help found when searching the net (admittedly I used Startpage in stead of Google, maybe Google could have found some). I finally got it working after installing VS 2015, using the exact same source code. I suppose I could have got it working on 2019 by adjusting more VS properties, but I couldn't find any info about what to change, and there are a lot of them!!! (Yes, I already had set MFC to be used as shared libraries). Got a bit fed up, and assuming that more problems would appear the further I went, I tried Qt, and haven't looked back. DS.

PPS: Thanks to the zloth for the emoji riddance tip . DS.
--
Over the mountain watching the watcher
Last edited by pibbuR; September 4th, 2021 at 16:30.
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#22

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)

Default 

September 4th, 2021, 16:15
Originally Posted by GothicGothicness View Post

C# is not only quite fast now, if you want to do new things you should use .NET core, which means everything will run on linux and/or windows.
Didn't know that about .Net Core. I knew that you can develop for linux using VS, but I assumed that only applied to console applications. And you still have to do the programming in Windows.

pibbuR who will appreciate being corrected if he's (not unlikely) wrong.
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#23

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)

Default 

September 4th, 2021, 21:12
Originally Posted by pibbuR View Post
Didn't know that about .Net Core. I knew that you can develop for linux using VS, but I assumed that only applied to console applications. And you still have to do the programming in Windows.

pibbuR who will appreciate being corrected if he's (not unlikely) wrong.
https://medium.datadriveninvestor.co…l-bf3dbba9afa0

All possible, see above link.

You can also use Microsoft Maui , but it is very new, and might not work perfectly yet.
GothicGothicness is online now

GothicGothicness

GothicGothicness's Avatar
SasqWatch

#24

Join Date: Oct 2006
Posts: 6,234
Mentioned: 12 Post(s)

Default 

September 5th, 2021, 15:19
WinForms is mature, supported by both Windows and Mono, but it's dated and requires some amount of boilerplate code (usually generated by VS).

It's possible to take the problem the other way round, and use Gtk with .NET (GtkSharp), but I honestly don't know if that's easy. There is an integration package for Visual Studio, or you can use MonoDevelop (but it's probably less user-friendly).
Redglyph is online now

Redglyph

Redglyph's Avatar
SasqWatch

#25

Join Date: Aug 2020
Location: Good old Europe
Posts: 4,898
Mentioned: 86 Post(s)

Default 

September 21st, 2021, 16:33
I am studying now programming language - C++ and I am interested in it!
Huynh is offline

Huynh

Traveler

#26

Join Date: Sep 2021
Posts: 2
Mentioned: 0 Post(s)

Default 

September 30th, 2021, 17:56


pibbuR who is something in between. No academic career in sight. And no commercial. In other words, a waste of … things.
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#27

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)
+1:

Default 

September 30th, 2021, 18:47


pibbuR who has been there, should have done that
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#28

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)

Default 

October 2nd, 2021, 03:49
I think I need to put that error message in somewhere - except I'll blame Microsoft.
--
The very powerful and the very stupid have one thing in common: instead of altering their views to fit the facts, they alter the facts to fit their views….
-- Doctor Who in "Face of Evil"
Zloth is offline

Zloth

Zloth's Avatar
I smell a… wumpus!?

#29

Join Date: Aug 2008
Location: Kansas City
Posts: 7,645
Mentioned: 34 Post(s)

Default 

October 13th, 2021, 17:34
I am at the moment exploring Gtk for GUI applications (have tested Qt, but I want to look at alternatives). ATM I've switched to Linux, as using Gtk seems a bit easier there.

One question:. I would like to use the same compiler under Windows and Linux. Anyone having experience with installing g++ under Windows? An alternative could be the Intel OneAPI (assuming I get it to work on my Window machine with a Ryzen processor. I have an Intel CPU in my Linux machine). Or CLANG, but that one supports very few C++20 features AFAIK.

Regarding Gtk. I Would like to go for version 4, but for Ubunto, the only C++ interface (Gtkmm) supported is version 3.24 (Gtk 4 installs fine using apt, but not Gtkmm 4. I assume C++ under Gtk4 needs gtkmm 4). Allegedly openSuse support gtkmm 4, but I don't think I'll change the OS for that. It IS possible to install gtkmm from source, but that seems a bit more complicated than my current Linux programming knowledge supports.

pibbuR who is nonetheless having FUN!!!!!

PS I'm using VSCode as my IDE. I must say, with the neccessary extensions it works very well. DS.

PPS. One more thing: I've previously used Make for building large projcets. But that is a loong time ago. Trying out CMake now, it's huge and complicated, with LOTS of options, but the basics aren't too difficult. And VSCode supoports it. DS.
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#30

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)

Default 

October 28th, 2021, 11:53
I think I'm going to learn yet another programming language: Aussie++

G'DAY MATE!

IMPOHT ME FUNC HitTheSack;
IMPOHT ME FUNC ChuckSomeDice;

THE HARD YAKKA FOR dreamtime IS () <
GIMME "'boutta get some winks mate";

I RECKON I'LL HAVE A WALKABOUT UNTIL (YEAH, NAH) <
GIMME "zZz…";

HitTheSack(1000);

YA RECKON ChuckSomeDice(0, 6) == 0 ? MATE FUCK THIS;
>

GIMME "that nap was bonza mate!";
>

dreamtime();

CHEERS C***!


Code example is taken from here: https://aussieplusplus.vercel.app/ which also to some degree documents the language.

Apparently it is possible to use the language. There is a Github project: https://github.com/zackradisic/aussieplusplus/

pibbur who also would like to take a look at TenneC if he could find a link to it.

PS. I am a bit disappointed that there doesn't seem to be a "Hello world" program in Aussie++, so here is my attempt:

G'DAY MATE!

IMPOHT ME FUNC HitTheSack;
IMPOHT ME FUNC ChuckSomeDice;

THE HARD YAKKA FOR dreamtime IS () <
GIMME "Hello world";
>

dreamtime();

CHEERS C***!


I'm pretty sure about the syntax, but I must admit I'm abit unsure about the correct spelling of "Hello world".
DS.

PPS. Regarding TenneC, I have, a loong time ago, seen it on the net, but I can find it now. DS.
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#31

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)

Default 

December 8th, 2021, 13:29
Most popular programming languages in November:



A couple of things puzzles me:
  • C at number 2. more polpular than C++ and C#
  • Visual Basic at number 6
  • Assembly language at number 8.
  • Several programming languages which I thought would be included are mssing, such as Kotlin, Ruby, Javascript…
And one more question: Is Sql really a programming languag? Oracle PL/SQL is, so is MS TransactSql. But Sql in itself?

select r.nick || ' who writes things' from sysadm.rpg_watch_member_list r where r.knows_sql=true and r.first_name like 'la*' and r.nationality='NO' and p.does_occasionally_make_mistakes=true
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#32

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)

Default 

December 8th, 2021, 14:01
Originally Posted by pibbuR View Post
A couple of things puzzles me:
  • C at number 2. more polpular than C++ and C#
  • Visual Basic at number 6
  • Assembly language at number 8.
  • Several programming languages which I thought would be included are mssing, such as Kotlin, Ruby, Javascript…
And one more question: Is Sql really a programming languag? Oracle PL/SQL is, so is MS TransactSql. But Sql in itself?
Maybe part of the answer is what they meant by "popular", it's vague. There's not much information on the population they surveyed either: The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written. - I wouldn't trust that.

I rather like StackOverflow's statistics, their questions are more precise:
No travesty like Visual Basic there, thankfully; not in the top 20 anyway, it's lower than that (probably people who have to suffer it in Excel for scripts in small companies).

As for SQL, I'd say that it depends on the context. It is a domain-specific language, you can program server requests, but it's not a general-purpose programming language.

I'm surprised Kotlin is not higher, shouldn't Android development have boosted it more? I would really hate to use Java for that (I've done it a little bit in the past), it has badly evolved and using patterns such as coroutines or even lambdas requires so much more boilerplate code.
Redglyph is online now

Redglyph

Redglyph's Avatar
SasqWatch

#33

Join Date: Aug 2020
Location: Good old Europe
Posts: 4,898
Mentioned: 86 Post(s)
+1:

Default 

December 8th, 2021, 14:14
Originally Posted by Redglyph View Post
….
I observe that Dart is at number 7.

pibbuR who won't nudge and won't say no more
--
Over the mountain watching the watcher
pibbuR is offline

pibbuR

pibbuR's Avatar
Feeling … lonely?

#34

Join Date: Nov 2019
Location: Bergen@Norway
Posts: 1,003
Mentioned: 37 Post(s)
+1:

Default 

January 5th, 2022, 11:27
(copying this from another thread because I'm going off-topic)

Originally Posted by Ripper View Post
Good stuff.

Bit off-topic, but after collecting this stuff, I use an open-source Bookstack server to organise things into electronic scrapbooks. It's technically a wiki, but I don't really think of it like that; it has a paradigm of organising things into shelves, books, chapters and headings, and to me it's just a great way to organise pretty much anything I want to write down. I've used other software over the years that had more functionality, but I've found the clean simplicity of this system works best, for me.

When I find interesting new images, I'll add them to a notebook with perhaps a couple of ideas. I find the bookcase metaphor just helps me organise things in context, which makes it more likely that go back and get some value from past ideas. (And also for website bookmarks - a pile of a thousand bookmarks is of almost no value, but when I put the links in context, I'll actually go back and use them.)
That software could be interesting to organise a scrapbook of scripts and pieces of code, it looks like it can handle highlighting of a multitude of languages with CodeMirror.

For example, I try to keep trace of typical problems I encounter in Linux, like fixing a problem with the greeter or useful operations with pacman, zypper, apt, and so on. Or pieces of code and patterns of frameworks.

I used DokuWiki in the past. It can be very simple to install since it has a file mode, which should not have any performance issue except for very large wikis. I still requires a web server with a PHP module, of course. I'm not sure if it can do nice printouts, I have never tried.
Redglyph is online now

Redglyph

Redglyph's Avatar
SasqWatch

#35

Join Date: Aug 2020
Location: Good old Europe
Posts: 4,898
Mentioned: 86 Post(s)

Default 

January 5th, 2022, 13:36
I just use MS Notes. It uses the same notion of books, chapters and pages, but names them differently. I also don't need a separate server and it is synced on all my devices automatically. I don't use the storage space for anything else, so the free version has more than enough room for notekeeping.
--
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. Douglas Adams
There are no facts, only interpretations. Nietzsche
Some cause happiness wherever they go; others whenever they go. Oscar Wilde
Myrthos is online now

Myrthos

Myrthos's Avatar
Cave Canem
Administrator
RPGWatch Team

#36

Join Date: Aug 2006
Location: Netherlands
Posts: 10,633
Mentioned: 210 Post(s)

Default 

January 5th, 2022, 14:43
Originally Posted by Redglyph View Post
No travesty like Visual Basic there, thankfully; not in the top 20 anyway, it's lower than that (probably people who have to suffer it in Excel for scripts in small companies).
I'm still running big VB6 monoliths for my company, running like a charm on Windows Server 2019 / Citrix. The VB6 runtime is included in every Windows installation. (Every other needed .dll or .ocx file kann be included in the same directory as the .exe file via an additional .manifest file)

VB6 in the hands of a good programmer, still runs circles around every C# or C++ programmer regarding development time and is very friendly for agile development.
For me it is the last real RAD-platform. Delphi is still there, but bloated up a bit.
HiddenX is online now

HiddenX

HiddenX's Avatar
The Elder Spy
RPGWatch Team
Original Sin 1 & 2 Donor

#37

Join Date: Oct 2006
Location: NRW/Germany
Posts: 15,291
Mentioned: 129 Post(s)

Default 

January 5th, 2022, 17:00
Originally Posted by HiddenX View Post
I'm still running big VB6 monoliths for my company, running like a charm on Windows Server 2019 / Citrix. The VB6 runtime is included in every Windows installation. (Every other needed .dll or .ocx file kann be included in the same directory as the .exe file via an additional .manifest file)

VB6 in the hands of a good programmer, still runs circles around every C# or C++ programmer regarding development time and is very friendly for agile development.
For me it is the last real RAD-platform. Delphi is still there, but bloated up a bit.
I doubt many languages can be more efficient than C# or Kotlin, especially with asynchronous code, but we must both be biased with what we're used to. VB has probably evolved since I last saw it, I see it received features like collections, regular expressions, LINQ and generics, for ex. I suppose C# and VB share a lot in common from .NET.

My comment was for the most common programming needs these days and honestly, I'm surprised C# is that high on the list because it's quite MS-oriented too. I know there's Mono for Linux and macOS, but the advantages are uneven, and the main frameworks only partially ported and compatible. Maybe it comes from gaming development.

Javascript/Typescript, HTML, Java and Python don't surprise me at all.
Redglyph is online now

Redglyph

Redglyph's Avatar
SasqWatch

#38

Join Date: Aug 2020
Location: Good old Europe
Posts: 4,898
Mentioned: 86 Post(s)

Default 

January 5th, 2022, 17:05
Originally Posted by Myrthos View Post
I just use MS Notes. It uses the same notion of books, chapters and pages, but names them differently. I also don't need a separate server and it is synced on all my devices automatically. I don't use the storage space for anything else, so the free version has more than enough room for notekeeping.
I've never really used it, it seems nice. And I think that their online web versions must be almost the same as the local app? I've tried the online 365 version of Outlook, Excel and Word a few months ago (because we were migrating the workstations to Linux) and I was really surprised.
Redglyph is online now

Redglyph

Redglyph's Avatar
SasqWatch

#39

Join Date: Aug 2020
Location: Good old Europe
Posts: 4,898
Mentioned: 86 Post(s)

Default 

January 5th, 2022, 20:18
From the perspective of using it, the online version and the app are the same. There are some very specific technical things, like migrating your Notes database to another person, which requires the app, but none of that stuff is needed in normal usage.
--
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. Douglas Adams
There are no facts, only interpretations. Nietzsche
Some cause happiness wherever they go; others whenever they go. Oscar Wilde
Myrthos is online now

Myrthos

Myrthos's Avatar
Cave Canem
Administrator
RPGWatch Team

#40

Join Date: Aug 2006
Location: Netherlands
Posts: 10,633
Mentioned: 210 Post(s)
RPGWatch Forums » General Forums » Off-Topic » The programming thread.
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 22:14.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
vBulletin Security provided by DragonByte Security (Pro) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
Copyright by RPGWatch