HaikuUser has quit [Quit: Vision[]: i've been blurred!]
HaikuUser has joined #haiku
HaikuUser has quit [Quit: Vision[]: i've been blurred!]
jmairboeck has quit [Quit: Konversation terminated!]
mr_lou has quit [Quit: Leaving]
erysdren has quit [Quit: Konversation terminated!]
erysdren has joined #haiku
Eric_ has joined #haiku
TheEricExperiment has quit [Ping timeout: 480 seconds]
Eric_ is now known as TheEricExperiment
<B2IA>
(binky) .
gouchi has quit [Remote host closed the connection]
<erysdren>
binky
<erysdren>
:rabbit:
Diver has quit [Quit: Leaving.]
Maylay has joined #haiku
Diver has joined #haiku
Diver is now known as Diver
Diver has quit []
HaikuUser has joined #haiku
HaikuUser has quit []
HaikuUser has joined #haiku
HaikuUser2 has joined #haiku
HaikuUser has quit []
HaikuUser2 has quit []
Diver has joined #haiku
Diver is now known as Diver
roracle has joined #haiku
roracle has quit []
roracle has joined #haiku
<roracle>
hey i'm asking again: is there a good video on youtube or a good tutorial for C++ programming? Something in line with what will normally be used, none of that stuff like "we're going to do it this way" only to find out "now we're doing it this way for no reason and no explaination"?
<erysdren>
for C++ i really don't think i have a good answer
<erysdren>
for example, with file i/o you could use generic fstreams, or ofstreams/ifstreams, or the C file API
<erysdren>
they'll all get you there some way or another
<erysdren>
same deal with printing, you could use C printf or C++ cout/cerr
<erysdren>
generally using C functions is discouraged, though, so there *is* a C++ey way to do everything
<erysdren>
"what is normally used in C++ code" differs from group to group and person to person
<erysdren>
some people use C++ as "C with classes" and that's what i prefer
<erysdren>
but other people go all-in with templates, using the full STL, exceptions, etc
<roracle>
like i said, i just get discouraged when they change up and don't explain
<erysdren>
a person making a tutorial is not likely to explain why they're doing each thing a particular way
<roracle>
expecting a newcomer to NOT go "what is this, and that, and this, and that" is kind of a miss on my end
<erysdren>
they have an "agenda" so to speak of how they wish to teach it
<roracle>
hmmm, so uh... what's even the point of learning if everyone's learning a different way? surely there are "best-practices" that everyone can agree on?
<erysdren>
well, as a random example, python has like 5 ways to do printed formatted text
<erysdren>
whichever you use is whichever you prefer
<roracle>
see that's just bizarre to me
<erysdren>
i'm sorry but most programming languages are like that
<roracle>
i mean, i could handle it if the tutorial said "here's all the ways to do this one thing" but they rarely do, they just swtich up when they want
<erysdren>
unless they have a really strict, clearly defined feature set
Diver has quit [Quit: Leaving.]
<roracle>
THEY know why they're switching up, then they teach the new way they're doing it, but they will never explain WHY they do it
<roracle>
i HAVE to know the "why" side of it or else i'm lost
<roracle>
some of us aren't just robots doing as we're told, i can't retain information unless i can comprehend the meaning behind the thing i'm doing
<roracle>
another thing i'm not keen on: when they want me to use Visual Studio or something similar. If I can't do it in Pe on Haiku or Notpadqq in Linux, then I get really confused because I know the OS has libraries integrated already, and on top of that the version differences between when the tutorial was made vs when I'm going with it are often so different that I cannot keep up
<erysdren>
micro$oft products
<roracle>
well how about this then: I've heard I should learn Python if I'm new to coding, and that could help me understand C++ easier when I get around to it. is this true?
<roracle>
for the record, i played around with Basic WAY back in the 90's on the school comptuers, so I'm not ignorant of coding, just ignorant of the complications that arise with the crazy languages
<erysdren>
python is a really really easy language to grasp
<erysdren>
it doesn't help with C++ in particular though
<erysdren>
it just gets you started with functions, parameters, arrays, etc
<roracle>
well like i said, concepts
<roracle>
it's OO isn't?
<roracle>
python that is?
<erysdren>
it has OO yeah
<erysdren>
but it's typeless
<erysdren>
it has no types for anything, i mean
<roracle>
what does that mean?
<roracle>
oh
<roracle>
jargon, yay :P
<erysdren>
anything can be any type and most things can be converted
<erysdren>
implicitly, by the interpreter
<roracle>
you mean so far as intergers go, they're typeless?
<erysdren>
everything is typeless
<erysdren>
you don't specify
<erysdren>
int i = 5;
<erysdren>
in python you'd do
<erysdren>
i = 5
<roracle>
variables, i should have said
<erysdren>
the language will infer the type from the data you give it
<erysdren>
this goes for every variable/object
<erysdren>
you can ensure something is a particular type by using the type construcor
<roracle>
can "i =" a jpg?
<erysdren>
constructor*
<erysdren>
well sure, if you use the PIL module or something
<erysdren>
i = PIL.Image.from_file("image.jpg")
<erysdren>
or something
<roracle>
okay, i'm just trying to see how far what yo usaid goes
<erysdren>
i will now be an object with a buffer of pixels, width, height, etc
<erysdren>
object oriented programming
<erysdren>
a constructor for a more simple type would be something like
<erysdren>
i = 5 # probably will be an int, but maybe a float
<erysdren>
i = int(5) # will definitely be an integer
<erysdren>
i = int(5.75) # will round to an integer with the value 6
<roracle>
but it can take a whole number and float it if needed?
<erysdren>
a float is a type
<erysdren>
it means floating point math, i.e. a number with points after the decimal
<roracle>
and it's typeless, which is why i ask
<erysdren>
integers can only store whole numbers, floats can store points after the decimal
<roracle>
what we would refer to as a normal interger vs a floating point interger, python is like "ugh, whatever"
<erysdren>
yeah
<erysdren>
it chooses whatever fits best
<roracle>
okay
<erysdren>
like if you have a really really large integer, too large for an integer type, it might round up to use a double-wide float instead
<erysdren>
or a double-wide integer, who knows
<erysdren>
it usually doesn't matter in practice, using python
<erysdren>
it matters greatly in strongly typed languages like C, C++, etc
<erysdren>
if you try to assign a value thats too big a 32-bit integer, it will either overflow and round back to 0 or throw a runtime error
<erysdren>
in C or C++ etc
<erysdren>
in my honest opinion, you should start with C and move to C++ later
<roracle>
oh?
<erysdren>
well C is the basis of C++
<erysdren>
it also has less bells and whistles
<roracle>
and both were made by IBM right? :P
<erysdren>
C was invented at bell labs
<erysdren>
in the early 1970s
<roracle>
ahh, right
Diver has joined #haiku
<erysdren>
i don't know anything about the history of C++, tbh