« first day (2981 days earlier)      last day (1965 days later) » 

12:04 AM
@StackedCrooked So I think the underlying problem is that you are notifying a collection of objects with your own loop. A more paradigmatic way is to have the loop performed implicitly, aka connect the signal to each object.
I've been doing Qt for years and haven't had to delete later anything, ever.
Typically, if you want GUI manipulation like deleting rows from a table, there are specialized commands like removeItem()that are responsible for freeing memory. A common mistake is keeping a series of pointers to widgets, mirroring the functionality of a layout. You should always directly access the layout.
My more serious problem with Qt is that it takes forever to code because there aren't many good default delegates. So one of my apps has hundreds of custom widgets. This wasn't fun.
 
 
4 hours later…
4:39 AM
So, the mime type system is bullshit right?
 
One has to submit a privacy policy with each app submission/update. So I copied and pasted the two lines it from my other app. After 10 hours, I suddenly realise that I have not altered the app name in the privacy policy.
How do we know humans don't exist on earth like fish in an aquarium and geniuses are not just good receptors of aliens transmissions?
 
5:44 AM
@Morwenn Once you meet up in real life, you become real life friends. You could say someone is 0.1r + 0.9i friend, but it gets awkward when telling people you have altogether 3.14 real life friends.
 
6:31 AM
@Mikhail it’s really a clown fiesta
 
 
2 hours later…
8:40 AM
@sehe He's literally spent years on that and it shows
somehow makes me glad I dumped all that Lua-C++ effort
with all the years, and all the effort, C++ is still so unusable that you can't get it done right
it's the same with OpenGL wrappers and every other library
it looks promising, it shows signs of being doable, you see the idea, and then it turns out that one language "feature" or another fucks up miserably and you can never quite get it to be good and usable
Incidentally, I just finished a 3-day "Advanced Modern C++" training which was a good reminder of mostly what I already knew, but also of what I hate about C++
TL;DR that language is doomed, they're paying me to write it and so I'll have to keep learning it but frankly I wish for it to die ASAP.
at this point I don't even mind the useless knowledge of it I have, it's kinda amortized already
I'd happily lose all that and start all new with something that's actually sensibly designed
 
nwp
9:35 AM
If only we had such a thing.
 
@sehe nice way of describing it
1) if you don't try to get out of the trap, you best get comfortable
2) it's not going to die any time soon
 
 
2 hours later…
11:30 AM
I still like C++ :3
 
Me too.
But I do feel the language is doomed.
 
I'm doomed too and still like myself :p
 
We're all doomed.
 
 
2 hours later…
1:26 PM
@nwp we don't, hence
we have potential replacements
@Morwenn it's fun as long as you don't have to deliver anything
 
nwp
1:41 PM
I don't think that's C++-specific. Anything is more fun if you have no pressure and can just experiment.
 
1:55 PM
@BartekBanachewicz that's why I do Python professionally x)
 
@nwp Python is fine if you also want to get something done
C++ is just such a drag
 
To me the major pains of C++ are the ergonomics, overall I'd say it's on the same level as Rust. Rust to me has the ergonomics issues in the language itself. C++ has them more distributed everywhere.
That said I wish the cult of rust would stop being so absolutist on "Rust would have saved you" every single time a bug comes out
 
2:40 PM
I like Python because I generally can just be pragmatic all over the place instead of overthinking everything
Got a problem? Is it a bit difficult to code that thing by yourself? Welp, let's just install that library x)
And allow more time to think about actual problems
 
I might not know python that well, but I really dislike the space determine scope syntax.
 
I like it
it forces people to fucking indent their code
which is a god-sent when taking over someone else's code *-*
 
I copy and paste code a lot from all over the places, and I used spaces and tabs inter-changeably.
 
nwp
Python is after QBasic the first language I used, and I switched away from it due to a lack of tooling and features. No debugger, no breakpoints, no auto-complete, can't define a function that takes an int, no diagnostics for anything unless it causes a runtime error and so on.
 
I don't use tabs, it's evil
 
nwp
2:49 PM
I do believe they fixed some of those issues and I want to take a closer look at it again some time.
 
with a good IDE you get all of those nowadays
 
With a few loops and condition statements within each other, indentation can get quite ugly quite quickly, especially when you use longer and more explicit names for variables.
 
Never been a problem to date v0v
Maybe don't indent with 8 spaces x)
 
If you have 3 nested loops and 3 nested condition statements and 3 spaces for each layer, then you have variable names such as InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNot‌​FocusedState.
I actually searched for the longest variable name and that's one in com.sun.java.swing.plaf.nimbus :p
 
then you're probably doing something wrong x)
 
2:59 PM
@TelKitty I wouldn't call swing a paragon of best programming practices... even in Java
it's notorious for making people think Java is slow
 
It's GUI stuff, so ...
GUI stuff are generally not designed for speed.
 
3:27 PM
@nwp You mean all of that is lacking in QBasic? Because I think Python has everything you mentioned right now.
 
nwp
Python didn't have those things when I switched to C++. Or I was too dumb to find them. I switched away from QBasic because it didn't have proper functions.
 
lol, what did it have instead?
 
nwp
Subroutines, but it didn't jump back to where it came from and you couldn't return to where you called it from. I did kinda hack it together by storing arguments and the line where I called from in global variables, but I couldn't figure out how to do that without manually typing out the line. It's very vague memory from a long time ago. There was probably a better way.
 
@nwp I tried to showcase every feature you asked for in one screenshot :)
@nwp lol, like manual RET
 
nwp
That x: int didn't exist back then. Very exciting.
 
3:34 PM
Not sure when it landed, but it was quite some time ago
of course you can still run this code, but the "42" highlight is a type... warning :)
 
nwp
Is nwp(3.14) allowed? Does it do a conversion?
And then I guess you need to add concepts so you can express x: integral.
 
@nwp let me think
 
nwp
@BartekBanachewicz Is that just a warning or does it cause a runtime error?
 
@nwp the type checks aren't part of the code, similarly to other, compiled languages
so you can still run this if you so choose
as for "concepts", bidirectional type inference, generics, callable types, abstract base classes, multiple inheritance and tuple types are supported by mypy specifically
Having optional typechecking means you can used different checkers with different capabilities
 
nwp
@BartekBanachewicz Yeah, but does it cause "Error: 3.14 is not an int" or "Error, cannot add int to string" at runtime?
 
3:42 PM
@nwp Nope, again, by default the type annotations are discarded by the interpreter, so it runs as if it was untyped
I believe there are libraries that can turn those annotations into checks, but aside debug runs, I am not sure why would you want that
The point of doing static analysis, after all, is to catch those issues before runtime
 
4:03 PM
Just wanted to ping the lounge. I have a question over in the C++ questions channel, and if anyone is willing to hope, I'd appreciate it.

https://chat.stackoverflow.com/rooms/116940/c-questions-and-answers
 
4:17 PM
BTW I wrote GADTs using C++17s deduction guides
apparently no one did that yet on the internet? (seemingly obvious)
should I write a blog post or something?
 
nwp
I don't know what GADTs are, but it quickly became known that they are turing-complete, so the bar for impressing people is somewhat high.
 
nwp
4:37 PM
I guess the hard part would be finding C++ people who have heard of GADTs and see the value. From my perspective it's kinda cool, but for example std::chrono has that or something similar without deduction guides.
 
@nwp I am pretty positive that it's impossible to implement without the guides
 
nwp
Also you can't get away with "We begin with an example of building a simple embedded domain specific language" with a C++ audience. I would expect people to stop reading as soon as you mention "DSL" because it doesn't apply to them.
 
@nwp why wouldn't it?
@nwp incidentally, I did just that
 
nwp
You just don't make DSLs in C++. It's a known antipattern. Either use C++ or don't.
 
depending on what you mean by DSL
 
4:39 PM
@milleniumbug a domain-specific language
@nwp [citation-needed]
 
Are expression templates in matrix libraries DSL? Is Boost.Spirit one? Is moc one?
 
I'm pretty sure that at least Spirit can be counted as a DSL, and there are many more
I need something nicer than just arithmetic to implement if I am to write a post out of that
something that requires static typing
it's nice because variadic templates can be used for e.g. statement blocks
 
nwp
I was told "I have a really cool solution, I'm just missing a problem for it" is a bad sign.
 
@nwp yes, if you're working on a regular project that is supposed to ship and have a certain functionality
someone has to make those tools and solutions
damn, is it possible to use a fold expression in an init-list?
sad if not true
ooh you just need an extra set of parens
 
5:47 PM
@nwp most cases I've seen for DSLs are for numerics, in which case my response is "Just use FORTRAN"
FORTRAN can still beat the heck out of C and C++ in most cases
 
Hmpfh the more I think about it the more I see that subtyping in C++ already allows you to do everything that I did
Well okay the guides for ops allow you to make the whole class a template and then make the inheritance base on template and the ctor arguments deduce the result
But this is only useful if the ops have multiple overloads themselves
If you treat each op as one ctor it can simply inherit from the proper type and so it's ctor will create the base value of that type thanks to subtyping
 
6:20 PM
 
7:11 PM
true
 
7:47 PM
@nwp DSLs are a known anti-pattern. You need a really specific use case to justify a DSL.
 
8
A: Difference in the end of lifetime rules?

Nicol BolasThis is an odd aspect of C++'s lifetime rules. [basic.life]/1 tells us that an object's lifetime ends: if T is a class type with a non-trivial destructor ([class.dtor]), the destructor call starts, or the storage which the object occupies is released, or is reused by an object that is no...

TIL
 
 
2 hours later…
10:16 PM
Hi there guys! Does anyone have much experience with C++ and numercal methods? I am trying to code up a c++ script for Runge Kutta 4th order and have hit a wall!!
 

« first day (2981 days earlier)      last day (1965 days later) »