3,975 reputation
11427
bio website
location Kuopio, Finland
age 24
visits member for 2 years, 8 months
seen Nov 20 at 20:01

A curious, self-admitted Rust fanboy with an itch for low-level programming topics.


Nov
15
comment Optimizations in Compiler Design
It is pretty common in surprising places, and if applied inside a loop body, can save lots of cycles. I don't have time to write a thorough answer, but yes, there are lots of places where these algebraic facts can be used to simplify the code and turn expressions to constants at compile-time rather than evaluating them at runtime. Take a look at peephole optimizations.
Sep
30
awarded  Explainer
Sep
24
awarded  Autobiographer
Aug
22
reviewed Approve Questioning one of the arguments for dependency injection: Why is creating an object graph hard?
Jul
17
reviewed Approve Can someone help me understand MVC?
Jun
26
comment Why would a C executable be smaller when compared to C++ executable
There is no question here. Furthermore, even if there was, that question would be unanswerable without specific knowledge about compiler and compilation flags used. The only way to get a precise answer to a question why C++ executable would be so much bigger and what exactly takes up the bytes would be to use some kind of a binary analysis tool (e.g. readelf on Unix systems, part of GNU binutils) or a hex editor to investigate file sections and contents. What comes to languages themselves, there's absolutely no reason for a difference like that. C++ output could be just as small as C.
Jun
4
comment Design for an interface implementation that provides additional functionality
If being pedantic, I think in this case you are really dealing with two separate interfaces despite them being highly similar.
May
17
revised Only functions without a class in cpp file! good design or not?
edited body
May
17
revised Only functions without a class in cpp file! good design or not?
Further explanation about avoiding stateless classes
May
17
revised Only functions without a class in cpp file! good design or not?
Further explanation about avoiding stateless classes
May
17
answered Only functions without a class in cpp file! good design or not?
May
17
awarded  Pundit
May
16
revised Compilable modern alternatives to C/C++
Added mention of Rust and improved phrasing
Apr
1
awarded  Yearling
Mar
24
awarded  Enlightened
Mar
24
awarded  Nice Answer
Feb
6
awarded  Popular Question
Nov
7
awarded  Good Answer
Jul
25
comment Why do old C-style method names continue being used in modern languages?
make_directory does not carry any more information to the reader than what mkdir alerady does. Instead, it carries excess weight(as in, information/meaning per character is lower) and is easily confused with other similar words, because it is composed of two common words unlike mkdir which itself has very little chance of being confused with similar words, as such words don't exist. And of course some of us(myself included) simply prefer "unique" names for common entities in the context we operate, it is jargon and makes it easy to communicate with people who are familiar with it.
Jun
28
comment Why not have a High Level Language based OS? Are Low Level Languages more efficient?
I can't bother writing a full answer, but someone should cover at least the simple and exact nature of C(and C++ to some extent) and it's execution model compared to languages like Java or C#, let alone Python or JavaScript. I think this is the exact #1 reason why most OS stuff is in C.