What are you working on, Sup Forums?
Old thread:
What are you working on, Sup Forums?
Old thread:
Daily reminder Lain is the only allowed anime girl itt.
Can someone explain why the output here is from the base class rather than the derived class?
class Test{
int a = 200;
}
class Test1 extends Test{
int a = 100;
}
public class Main {
public static void main(String[] args){
Test t = new Test1();
System.out.println(t.a);
}
}
Make sure to start your day off right with Lainos.
>tfw LainOS will never be finished
lainos.sourceforge.net
Methods are dynamic dispatch but member variables are not, the notion of "dispatch to property" is kinda wierd to start with but it does make this kind of asymmetry which is ugly.
The justification here is that it's to defend encapsulation. Like if a base class representing, IDK, like events has a private or package private property named "class" but one subclass represents like academic classes and has its own "class" property then both properties should be able to coexist in the same object, the subclass shouldn't be impacted by name collisions with superclass properties because it shouldn't have to know about (private) superclass properties.
Does it build and run on X86_64?
I'm taking an advanced OS class now and have kinda been hankering to hack at a toy OS
posting a different one just to blow it for you
His answer is good but just in case you need additional reference, stackoverflow.com
The biggest reason probably is because property access would be dogshit fucking slow if it was polymorphic
>.:02-15-05:.
>Quick and dirty update: LainOS is on hiatus for a few months more. Our project lead, Neovanglist is moving across the Big Pond and will be very unavailable for a while. Once his life has settled down appropriately we will be able to resume our Schumann and Accela development.
>Ciao,
>-Xuric
I never believed they'd finish it, but it still hurts.
Frequently asked Questions About the LainOS Project
>This Page is still being populated and should start to see content within the next few days.
She's not even the best slut from that show.
>The biggest reason probably is because property access would be dogshit fucking slow if it was polymorphic
Yee, perf is the real reason, as per the norm for OO sophistry the ideological justification is wholly post-hoc
The latest build is from 2003, the same year x86_64 was released, so it's highly unlikely.
>The latest build is from 200
hahaha, shit. What a shame, I wanted to work on a shitty anime meme OS. I guess I'll go back to my TempleOS clone idea
I agree m8, but I have a huge danbooru dump and it was already taking me long enough to find a face I recognized at all
Fair enough.
Who's your best girl though?
Lain is fucking shit. Why don't you post some animu grils that are actually cute?
You can always contribute to RedoxOs, it's being quite actively developed, or choose another from microkernel.info
hidamari is good but your answer
> Lain is fucking shit
Makes them even more shit tbqh.
>this is the state of current Sup Forums
Can we go back to being techloli/g/?
yandere chan no contest. I'm a sucker for that type of stuff
Why not contribute to something like ReactOS instead of solo hobby OS projects. I think hobby OSes are worthwhile but easy to get stuck on
How is your videogame engine coming along?
rewrite the entire thing in haskell
>Sepples
AHAHAHHAHAHHAHAHAHHAHHAHAH
fag.
>guy in class asks why nobody teaches to code in "exe"
legit question or just retarded?
>tfw I didn't fall for the engine meme and started to develop a game right on top of OpenGL
I still abandoned it tho.
That's what I'm doing, though?
>yandere chan
Wut
There was a yandere?
Sup Forums is Maki territory, all other girls need to get out.
what language should zhe use?
>inb4 C
C
Why'd you make a statement into a question? Are you retarded?
Make is a forced meme slut.
WHICH PROGRAMMING LANGUAGE WOULD YOU FUCK?
ActionScript for that hot loli action.
C is a poorly designed language to be honest and C++ doesn't even fix C's problems but extends them.
...
all anime girls are welcome
haskell
Suck my cock, dude.
why are you passing a built in type (long long) by const reference?
>no RAII
which one of them has a benis
>Lain is fucking shit
get out
C is actually designed very well. If you consider C's actual goals, it does a very good job.
There is a good reason why C is so entrenched in its niche, and that no language is even close to displacing it.
Fuck off with your hidden state changes.
I am writing a 32 bit program. If I passed the long long (64 bit) by stack, it would take two clock cycles. Passing it by reference ensures only a single clock cycle is needed because it's the relative address that gets passed.
Make sure to use this with it for fun: libcello.org
Definitely Shell, would be something like this:
Pic related.
Not really true. C became popular when UNIX became popular and nothing is really going to displace C because there is so much C code that nobody wants to port to another language, especially since there aren't really many options in the systems programming space in the first place.
>stomach deformation
yes
Yes
YES
but it'd be std::move'd...
>complaining about hidden state changes
>says that C is designed well
I guess you are a brainlet then if you don't understand that C also has hidden state changes.
>currentParameters.speedMult
>(long long)
>currentTime >= ...Duration;
>allman style
>How is your videogame engine coming along?
Haven't touched it in years but I can tell you it's going better than yours
>Implying there's any better language than C
C is actually a pretty explicit language when it comes to that sort of shit.
The only code that gets generated is the code that you put there.
Why would one want to learn how to program without desire to get a job as a programmer?
Full retard
To write custom tools and utilities for your own convenience.
This is not how it works, you fail to account for the cache. It's faster to pass 8 bytes as value via stack which is likely to be in cache than to pass an address and then waste cycles actually reading the value from the memory.
>this is what Cfags actually believe
HAHHHAHAHAH
Let me say that I actually like C, but you are delusional if you believe that. At the very least, you have a superficial understanding of C.
Because writing programs is fun. Also, you can write useful shit for yourself.
I actually have a very good understanding of C, and have a good idea why it's designed like it is.
How is C not explicit when it comes to state changes?
Different user here. Care to elaborate about C's behind-the-scenes state changes? Specifically, provide some examples that happen automatically and cause observable changes without invoking undefined behavior.
Okay Mr Brainlet, explain this code for me then.
#include
int array[] = {1, 2, 3, 4, 5, 6, 7};
#define LEN (sizeof(array) / sizeof(array[0]))
int main()
{
int d = -1;
if (d
>actual goals
What do you think count as C's design goals? The standards committee is so fucked, occult, and political asking "what are the committee's design goals" is like asking "what is the goal of abstract nationstates". The design goal of compiler design is to beat everyone else in the penis-measuring contest called micro optimizations. The design of the C programming culture as a whole is like 80% "fuck you, I'll do it my way because I know best" and 20% "I'm morally superior to everyone because I write portable assembly®!".
C as anything considered "designed" besides in the blind-watchmaker sense is a clusterfuck. As a language it just happens to be really useful.
>C is actually a pretty explicit language when it comes to that sort of shit.
quick, tell me how many bytes are in an int!
It prints 1
d is less than sizeof(array)/sizeof(array[0]
That's not a state change, you fucking retard. It's you not understanding integer conversions and unsigned types.
Implementation defined.
That has literally nothing to do with state changes.
Don't confuse the C standards committee with the C++ standards committee.
Right, but did you even look at what is going on? How is -1
It wasn't the focus but she had her moments
Just did a basic test on godbolt, it's one more instruction in the callee with & and many more in the caller.
// Type your code here, or load an example.
long long __attribute__ ((noinline)) foo(const long long &num) {
int foo = num*2;
return foo*2;
}
int square(long long num) {
return foo(num)+1;
}
In that case, I will simply say that it's to prevent me from modifying the deltatime in between calls :o)
That's an example of implicit conversion, not hidden state changes.
>It's literally changing the value of an integer without being explicit
An integer conversion is not changing the program's state. Arithmetic and the like exist outside of the state of a program.
Writing something useless like:
int s = -1;
size_t u = 1;
s
>Implementation defined.
>explicit language
>compiler can arbitrarily rewrite code if "undefined behavior" occurs to literally anything
>memcpy was literally undefined behavior for many years of C being in massive deployment
yeah no
>Don't confuse the C standards committee with the C++ standards committee.
They're both cancer, at least the C++ committee know what they are.
>>memcpy was literally undefined behavior for many years of C being in massive deployment
is this for real?
I am learning python because I want results asap.
I dont give a shit about programming though it is addictivly fun. I am grad student in economics and I couldn't handle anymore data entry or excel fuckery.
took me 2 days to figure out how to do 50% of the stuff I wanted.
3 months later I am just seeing the possibilities of this shit. I have wasted so much time writing papers about fully autonomous taxis/apartment buildings/vending machines that upgrade, fuel, repair, advertise themselves.
I wasted even more time creating a program that reads the dictionary to itself. And then flags all the words it doesnt say properly.
If I can figure out how to make it try to fix its phonetics and then apply this to economics as a model of self correcting market action.
cache bro is almost certainly correct. Be scientific about it and actually profile your code. Disassembling or counting clock cycles isn't enough. That shit gets executed out of order, some registers depend on the state of others, sometimes that shit isn't even documented, the hardware cache has a mind of its own.
Unless you actually profile you are just guessing.
>It's literally changing the value of an integer without being explicit.
It's not changing the value of the integer. It's just implicitly changing the meaning of the expression. No state is being modified. Either way, it's a good example of C's cancerous bits.
Yee, see
>yodaiken.com
fun read on the whole.
Didn't gcc version 1.5 have #pragma stop compiling and start running a game since #pragma is implementation defined?
>Implementation defined.
>compiler can arbitrarily rewrite code if "undefined behavior" occurs to literally anything
>memcpy was literally undefined behavior for many years of C being in massive deployment
All of those things are completely unrelated to "explicit state changes".
Stop attacking a strawman, you assblasted sepplesfag.
There were retards who used memcpy incorrectly, where they should have used memmove. The usage was always labelled as undefined behaviour.
glibc then changed how its memcpy implementation worked, and it broke several poorly written programs.
>completely fails to provide an example of hidden state changes without invoking undefined behavior
Pretty predictable.
I want to make love to C++-sama!
>It wasn't the focus but she had her moments
I was thinking you meant R=L, but I wanted to make sure I wasn't forgetting a girl. Nice taste though.
Personally, my favorite girl was the insane maido.
>>completely fails to provide an example of hidden state changes without invoking undefined behavior
>shifting goalposts to make arbitrary rewrites on undefined behavior without even a compiler warn in some cases somehow "explicit"
By definition, a program that has undefined behaviour is an invalid C program.
Please provide a valid C program.
The LEN has type long unsigned int.
Type cast it and the comparison works.
-1 as a unsigned int is a large number.
This is done because it makes arithmetic easier. Try calculating 5 + -1 in binary (or any number really).
where's the bara version of this
>The LEN has type long unsigned int
More precisely, it's a size_t.
>JavaScript fags will never get to feel this glorious
I don't know why you guy are arguing, the argument
>RAII is bad because it implicitly change state
itself is shit. Unless you're writing in Haskell, everything changes state, and there's nothing wrong with doing some maintenance stuff like closing a file or freeing a buffer implicitly, it's much worse to expect from a programmer to explicitly do it in the correct order in all the exit paths and not to fuck up. All you have to do to see why is to look for exploits, vulnerabilities and memory leak-type bugs in C projects.
>shifting goalposts
My post (), to which you responded with () specifically requested an example of observable state changes that doesn't invoke undefined behavior. Looks like you cannot deliver, and I don't see how UD examples are relevant.
>By definition, a program that has undefined behaviour is an invalid C program.
lol, how about you provide a valid C program (protip: if it's non-trivial you can't)
I'm not I'm
>accuses others of shifting the goal post
>proceeds to blatantly shift not only the goal post, but also the burden of proof
You're a confirmed brainlet who doesn't understand what state changes are or how C works. Off you go.
>all this fighting
I-I thought lolis were nice.
Fair enough, but "that sort of shit" in his post seems to refer to something different from what you're arguing.
...
anyone else stare at the gorgeous haskell website wishing they knew how to use it?