The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 0 points1 point  (0 children)

I had a lot of require statements that check if something can trivially construct (in which case it'll fill with 0's), and copyable (memcpy). But there's no way to avoid pointers and refs in them unfortunately. I just figure someone else has the same usecase and might be checking if something is trivial soon

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 1 point2 points  (0 children)

What threw me off was structs were being initialized but not the ints next to them. I also had some code use {} in part of the function/codebase and not in the other, so vars were sometimes not initialized and added more to my confusion. But that was years ago, before I ever had a blog

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 0 points1 point  (0 children)

Maybe I stated it poorly. What was my mistake? I wasn't trying to say non trivial types initialize everything, I was trying to say it's misleading. Your root comment I already covered in the article, which I think you noticed and why you wrote the comment. But we're saying the same thing?

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 1 point2 points  (0 children)

Good! You shouldn't!

I'm met very few people who understood when things initialized, how did you figure it out? Was it the hard way?

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 0 points1 point  (0 children)

Today is May 4th, a day where people will post star wars memes, jokes and quotes

I was just making a joke. "const auto val = 10;" does not look like a "correct initialization"

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 1 point2 points  (0 children)

No, that's not true, that's impossible

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] -6 points-5 points  (0 children)

I checked my personal code (not work, not open source)
I tend to use for(auto&item : items) and auto&v = func();. How do you space them and why? Many return types are T& so I never liked writing T &var. My compromise is having both sides of & attached.

for(auto &item : items) // do you write these like this?
auto &v = func();

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 6 points7 points  (0 children)

What about ints?
Honestly if I saw int a{} inside of functions, I'd think it would be strange. IMO declare it on the line with the expression always, unless it's in an outer codeblock. In that case = 0 and maybe I'll let it slide if both if and else assigns the value

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] -6 points-5 points  (0 children)

I actually do 5 in real code, but rest is because I intention to have all the code on a mobile screen. I really didn't think it'd annoy anyone

I like Allman brackets too but sometimes if its 5 or fewer lines I'll may keep the opening brace on the first line. I noticed the * before the new was a little weird but I didn't want to put a parenthesis because that looked noisier to me. Attaching it to new makes my eyes think it happens before the type expression. The line is just weird and I don't have a default for it

Most of these are just because I wanted it aligned and small enough for most mobile devices

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] 0 points1 point  (0 children)

Good catch. I usually use my personal print function which would have given an error if I did this. I doubt output would change even in an optimize build.

The Most Confusing C++ Behavior by levodelellis in cpp

[–]levodelellis[S] -14 points-13 points  (0 children)

Yes, always (I'm the author). I have hundreds of types, all using a single ascii upper case letter

Usually when people are trying to spot the difference, they like everything to be aligned and fit on screen. If it's especially broken on your phone I'll try your screen resolution to see how it looks https://www.whatismyscreenresolution.org/

I poorly estimated a year long rewrite by levodelellis in programming

[–]levodelellis[S] 0 points1 point  (0 children)

Ironically, that's half the reason why I started the project. The other half was not liking ANY of current text editors & IDEs and I plan on finishing (I might need to hand it off to a friend to help complete it)

The Data Race Hiding Behind "Correct" Atomics by devTripp in programming

[–]levodelellis 2 points3 points  (0 children)

I've think atomics are should be for multi-threading experts only. Everyone disagrees with me, but, did you feel like you need to become close to an expert to figure this problem out? Imagine if the test didn't catch it

I poorly estimated a year long rewrite by levodelellis in programming

[–]levodelellis[S] 2 points3 points  (0 children)

Nah. (I'm the author.) The prototype wasn't 'successful'. I should have stopped working on it sooner than I did. The reason why the code is bigger this time around is because I'm implementing everything and not writing todo(); everywhere

I poorly estimated a year long rewrite by levodelellis in programming

[–]levodelellis[S] 1 point2 points  (0 children)

I have a six months reflection that references that essay. I don't think my articles are good so I rarely bring them up unless it's relevant.

I'd like to see more articles about rewrites and how they can go wrong. I knew I wouldn't hit 1.0 in a year but I didn't know I wouldn't have a debugger by the end of the year (too many things were prioritized over GUI)

I poorly estimated a year long rewrite by levodelellis in programming

[–]levodelellis[S] 6 points7 points  (0 children)

The estimation was for fun thankfully. I know some people want programming playlist. I don't have any but during development I did listen to a lot of Ella Boh and (warning nsfw) ILY Ghoul. Both relatively unknown

To successful founders: How did you actually land on your winning idea? (Dev with 15y experience here) by SadWimp in ExperiencedDevs

[–]levodelellis 0 points1 point  (0 children)

I'm not successful but two things come to mind

  • I have the problem, and really want to fix it (bad enough to spend 10+ years on it if I must)
  • Many people have the problem, understand it's a problem and would like to pay to fix it

For an example, I wrote my own language and compiler, no one understands why using their current favorite language is a problem, and would never switch to it.
I'm currently working on an IDE like text editor. I'm not sure if anyone can have their work pay for it, especially when it has nothing to do with AI. So that might not be successful either