r/programming • u/magenta_placenta • Apr 12 '19
Windows 10 source code: over 0.5 TB source code, over 4 million files, more than a half million folders
https://www.quora.com/Which-programming-language-is-used-for-making-Windows-10/answer/Axel-Rietschin?share=1155
u/purtip31 Apr 12 '19
Saw a graph of lines of code by section in the linux kernel a while back (here: https://www.reddit.com/r/linux/comments/9uxwli/lines_of_code_in_the_linux_kernel/).
The part that I find interesting is that the vast majority of the LOC growth in the source is in driver code. Makes me wonder what the Windows equivalent would look like
240
u/Tipaa Apr 12 '19
0.49TB of that code is just backwards compatibility
if-chains76
u/bitwize Apr 12 '19
It looks like Yandere Simulator in there.
24
u/re_anon Apr 12 '19
what do you mean?
127
u/bitwize Apr 12 '19
Yandere Simulator is notorious for its naïve coding style, which involves using IF statements to check for every possible combination of conditions, rather than something sensible like state machines for enemy AI and OO polymorphism to specialize object behaviors.
34
u/LaughterHouseV Apr 12 '19
That's what Age of Empires 2 does as well.
→ More replies (4)27
u/lvl12TimeWizard Apr 12 '19
I don't know about Age of Empires 2 but I know in Warcraft 2 if you turned on the instant build cheat and the gold/supplies cheat the computer would actually outperform you and win...or I was just 12 and sucked even with cheats.
15
18
u/fiqar Apr 12 '19
How do you know this?
72
u/deathride58 Apr 12 '19
Unity games are notoriously easy to decompile. Publicly available tools are more than capable of giving you a surprisingly accurate glimpse at what the original source code for a given unity game looks like, as unity's compiler doesn't do many optimizations at all
26
u/PendragonDaGreat Apr 13 '19
Yep, this is how the mixing scene for Stardew Valley popped up. Broke down the source and documented it and now there's a nuget package that you can load as an API to mod the game.
Fun fact, did you know that when breaking geodes the outcome is determined by a save wide seed and is thus deterministic from the very first time you start a new game? Most other random events (ores and mob drops in the mines, artifacts, couple others) are not and are my related to your daily Luck stat.
6
Apr 13 '19
Having fixed seeds is better for preventing loot scamming though
3
u/PendragonDaGreat Apr 13 '19
While true, that's not a huge problem in SDV solely because the game is designed to be a chill farming sim. There's no way to save manually except to go to sleep at the end of the day. This way in a multiplayer farm where each player's daily luck is calculated separately someone can still contribute, especially late game after partial automation has occurred.
11
u/ygra Apr 13 '19
In case the source code was C# that's not very surprising, as the C# compiler doesn't optimize much and leaves the heavy lifting to the JIT.
9
u/Adobe_Flesh Apr 12 '19
Does it perform well though with this style?
51
u/bitwize Apr 13 '19
It performs quite poorly, often chugging on even high-end hardware despite the graphics not even taxing a midrange Intel GPU. The entire school campus map is loaded into memory and active, with something like a few hundred students milling around and other sundry objects all active at the same time. Oh, and he doesn't do occlusion culling so there's MAD overdraw. The massive amount of if-then checks for a combinatorically explosive number of possible game conditions not only causes slowdown, it causes frequent bugs and glitches because it's hard to keep track of all the conditions that need to prevail in order for a character to behave a certain way, and it's almost impossible to account for unexpected conditions that may trigger some bizarre behavior. He doesn't use state machines or make any attempt to pare down the space of possibilities. He just writes a bunch of if statements, tests the game, and if something funny happens he writes more if statements to get around it.
21
u/erasmause Apr 13 '19
As a developer, just reading this made me feel dizzy. I can't imagine trying to maintain that.
19
Apr 13 '19
I can. That's what a lot of code written in the last two decades looks like.
"We should refactor this."
"No, I'm serious."
"Why are you laughing."
Hint: if you can't keep the state of a class in your head, neither can the guy coming after you. Don't put another state variable in and make it worse. Just use a fucking state machine like you should have to begin with.
4
u/bitwize Apr 13 '19
That's the thing. The developer of YS is not a professional developer, nor does he have any real development experience or background beyond this game and his "Lunar Scythe" demo he tried to impress the Skullgirls dev with.
A while back he attempted to partner with a publishing company with a small publisher called TinyBuild (I think they're doing Hello, Neighbor!). One of the stipulations was that they would have one of their in-house devs refactor the code of the game, and rewrite it in C# instead of JavaScript.
The partnership with TinyBuild fell through the floor. What it looks like happened was that Yandere Dev got upset because he couldn't understand the code to his own game anymore. Fixing his broken-ass code made it all go right over his head.
1
1
u/meneldal2 Apr 15 '19
It's a shame because he has some nice ideas about the gameplay and the like, but he went in without enough coding experience and it ends up wasting so much time.
1
u/bitwize Apr 15 '19
Most of his game ideas were cribbed from other games like Hitman and Natsuiro High School.
That's not damning in and of itself -- a game with unoriginal ideas can stand out if it's executed well. But execution is where Yandere Dev really falls down.
1
u/meneldal2 Apr 15 '19
I know it's not entirely new concepts or anything, but there are interesting elements mixed together with a lot of potential and there aren't many games in that niche.
6
1
47
u/Iwan_Zotow Apr 12 '19
You have to add whole X11 with all their drivers, OpenGL, some windows manager with composer, toolkit (say, GTK), file manager, all GNU utils, all core utils, ...
36
u/kukiric Apr 12 '19
And a Chromium-based web browser.
12
-8
u/indrora Apr 12 '19
Times four or five.
Spotify, Discord, Slack, Skype, probably your desktop environment, Atom, VS Code, etc.
2
0
Apr 13 '19
[deleted]
1
u/Iwan_Zotow Apr 14 '19
Well, not dev.tools, no, say, python and related stuff, but yeah, more or less...
16
Apr 12 '19
There are always new devices coming out that have to be supported, much more rapidly than new filesystems, networking protocols, IPC mechanisms, or anything else. For Windows, you need to add a few MLOC each for the Win32 API, the OS/2 subsystem, and an obsolete POSIX interface, but beyond that it's probably similar.
15
u/SilverCodeZA Apr 12 '19
and an obsolete POSIX interface
It is interesting to think that with the recent "Linux on Windows" venture the old POSIX code might finally be coming in handy.
34
Apr 12 '19
The Windows Subsystem for Linux doesn't use the old POSIX compatibility interface, but a brand-new purpose-built one.
6
u/tracernz Apr 13 '19
A large proportion of drivers on a typical Windows install are closed source, vendor-supplied, so there's no way to really know. Each driver shares a LOT less code than an equivalent Linux one so the numbers are bound to be mind boggling.
536
u/FCJRCECGD Apr 12 '19
Now we're just giving NPM and `node_modules` higher heights to aspire towards.
82
u/andrewsmd87 Apr 12 '19
1
Apr 13 '19 edited Mar 07 '24
I̴̢̺͖̱̔͋̑̋̿̈́͌͜g̶͙̻̯̊͛̍̎̐͊̌͐̌̐̌̅͊̚͜͝ṉ̵̡̻̺͕̭͙̥̝̪̠̖̊͊͋̓̀͜o̴̲̘̻̯̹̳̬̻̫͑̋̽̐͛̊͠r̸̮̩̗̯͕͔̘̰̲͓̪̝̼̿͒̎̇̌̓̕e̷͚̯̞̝̥̥͉̼̞̖͚͔͗͌̌̚͘͝͠ ̷̢͉̣̜͕͉̜̀́͘y̵̛͙̯̲̮̯̾̒̃͐̾͊͆ȯ̶̡̧̮͙̘͖̰̗̯̪̮̍́̈́̂ͅų̴͎͎̝̮̦̒̚͜ŗ̶̡̻͖̘̣͉͚̍͒̽̒͌͒̕͠ ̵̢͚͔͈͉̗̼̟̀̇̋͗̆̃̄͌͑̈́́p̴̛̩͊͑́̈́̓̇̀̉͋́͊͘ṙ̷̬͖͉̺̬̯͉̼̾̓̋̒͑͘͠͠e̸̡̙̞̘̝͎̘̦͙͇̯̦̤̰̍̽́̌̾͆̕͝͝͝v̵͉̼̺͉̳̗͓͍͔̼̼̲̅̆͐̈ͅi̶̭̯̖̦̫͍̦̯̬̭͕͈͋̾̕ͅơ̸̠̱͖͙͙͓̰̒̊̌̃̔̊͋͐ủ̶̢͕̩͉͎̞̔́́́̃́̌͗̎ś̸̡̯̭̺̭͖̫̫̱̫͉̣́̆ͅ ̷̨̲̦̝̥̱̞̯͓̲̳̤͎̈́̏͗̅̀̊͜͠i̴̧͙̫͔͖͍̋͊̓̓̂̓͘̚͝n̷̫̯͚̝̲͚̤̱̒̽͗̇̉̑̑͂̔̕͠͠s̷̛͙̝̙̫̯̟͐́́̒̃̅̇́̍͊̈̀͗͜ṭ̶̛̣̪̫́̅͑̊̐̚ŗ̷̻̼͔̖̥̮̫̬͖̻̿͘u̷͓̙͈͖̩͕̳̰̭͑͌͐̓̈́̒̚̚͠͠͠c̸̛̛͇̼̺̤̖̎̇̿̐̉̏͆̈́t̷̢̺̠͈̪̠͈͔̺͚̣̳̺̯̄́̀̐̂̀̊̽͑ͅí̵̢̖̣̯̤͚͈̀͑́͌̔̅̓̿̂̚͠͠o̷̬͊́̓͋͑̔̎̈́̅̓͝n̸̨̧̞̾͂̍̀̿̌̒̍̃̚͝s̸̨̢̗͇̮̖͑͋͒̌͗͋̃̍̀̅̾̕͠͝ ̷͓̟̾͗̓̃̍͌̓̈́̿̚̚à̴̧̭͕͔̩̬͖̠͍̦͐̋̅̚̚͜͠ͅn̵͙͎̎̄͊̌d̴̡̯̞̯͇̪͊́͋̈̍̈́̓͒͘ ̴͕̾͑̔̃̓ŗ̴̡̥̤̺̮͔̞̖̗̪͍͙̉͆́͛͜ḙ̵̙̬̾̒͜g̸͕̠͔̋̏͘ͅu̵̢̪̳̞͍͍͉̜̹̜̖͎͛̃̒̇͛͂͑͋͗͝ͅr̴̥̪̝̹̰̉̔̏̋͌͐̕͝͝͝ǧ̴̢̳̥̥͚̪̮̼̪̼͈̺͓͍̣̓͋̄́i̴̘͙̰̺̙͗̉̀͝t̷͉̪̬͙̝͖̄̐̏́̎͊͋̄̎̊͋̈́̚͘͝a̵̫̲̥͙͗̓̈́͌̏̈̾̂͌̚̕͜ṫ̸̨̟̳̬̜̖̝͍̙͙͕̞͉̈͗͐̌͑̓͜e̸̬̳͌̋̀́͂͒͆̑̓͠ ̶̢͖̬͐͑̒̚̕c̶̯̹̱̟̗̽̾̒̈ǫ̷̧̛̳̠̪͇̞̦̱̫̮͈̽̔̎͌̀̋̾̒̈́͂p̷̠͈̰͕̙̣͖̊̇̽͘͠ͅy̴̡̞͔̫̻̜̠̹̘͉̎́͑̉͝r̶̢̡̮͉͙̪͈̠͇̬̉ͅȋ̶̝̇̊̄́̋̈̒͗͋́̇͐͘g̷̥̻̃̑͊̚͝h̶̪̘̦̯͈͂̀̋͋t̸̤̀e̶͓͕͇̠̫̠̠̖̩̣͎̐̃͆̈́̀͒͘̚͝d̴̨̗̝̱̞̘̥̀̽̉͌̌́̈̿͋̎̒͝ ̵͚̮̭͇͚͎̖̦͇̎́͆̀̄̓́͝ţ̸͉͚̠̻̣̗̘̘̰̇̀̄͊̈́̇̈́͜͝ȩ̵͓͔̺̙̟͖̌͒̽̀̀̉͘x̷̧̧̛̯̪̻̳̩͉̽̈́͜ṭ̷̢̨͇͙͕͇͈̅͌̋.̸̩̹̫̩͔̠̪͈̪̯̪̄̀͌̇̎͐̃
1
93
u/AngularBeginner Apr 12 '19
I'm pretty sure you end up with more files when you install more than 10 packages.
35
14
84
Apr 13 '19
[removed] — view removed comment
75
u/perspectiveiskey Apr 13 '19
It is a security disaster, honestly. At this point, I don't see how it can be salvaged.
29
u/theferrit32 Apr 13 '19 edited Apr 13 '19
It can't. But it isn't going anywhere anytime soon. A lot of organizations bought fully into the ecosystem. It'll take a decade to fully transition out to whatever next thing comes along from the time it comes onto the scene, and we still don't know what that will be yet.
7
u/iphone6sthrowaway Apr 13 '19
To be fair, most programming languages/environments have had (and many still have) atrocious security practices until it blows to their face, and then it’s often too late to plug all the holes without breaking everything. Think of C/C++ undefined behaviors, PHP’s register_globals, Java applets, Flash, etc.
(Inb4 Rust)
43
u/NoInkling Apr 13 '19
gkt: console.log('Smarty Smart Smarter');
I had to look it up: apparently PM2 (a very popular package) uses a self-hosted version of it as an optional dependency to ping a URL for analytics purposes. Words fail me...
Also that still doesn't explain why it's published to the NPM registry.
1
u/usedprestige Apr 13 '19
try copying 300mb worth of node_modules to a usb 2.0 flashdrive, it takes more than an hour
5
45
u/philthechill Apr 12 '19
Someone run cloc on that source tree
9
-4
107
u/TyIzaeL Apr 12 '19
It's fun to think that the Windows source code all lives in a SCM created by Linus Torvalds.
78
u/tracernz Apr 13 '19
Created specifically for Linux kernel development.
20
u/ButItMightJustWork Apr 13 '19 edited Apr 13 '19
They [Microsoft] dont even use the vcs which they created themselves [Team Foundation].
edit: clarified
10
u/GYN-k4H-Q3z-75B Apr 13 '19
Git has been implemented as part of TFS for years now because it is better than their old source control. When you setup a team project now, you can access it using both, but by default it is using Git.
1
u/halbaradkenafin Apr 13 '19
They do, just not for Windows. They've got a bunch of projects using TFVC. The preference is for git now but it's up to each team and project what they want to use.
1
u/tracernz Apr 13 '19 edited Apr 13 '19
What? Yes they do. Are you thinking that because they send patches by email? There's a reason git has excellent support for email patches (git-am). ;)
You can find all the kernel.org repos here: https://git.kernel.org/. The most interesting are torvalds/linux (basically the master), and Greg Kroah-Hartmann's linux-stable.
5
u/ButItMightJustWork Apr 13 '19
I know that linux uses git.
I was speaking about Microsoft who dont use their own vcs (team foundation). Updated my comment to clarify that.
1
u/tracernz Apr 13 '19
Sorry. Right you are! I was under the impression there is some level of git integration in TFS these days?
3
2
Apr 13 '19
Pretty sure ButItMightJustWork was talking about MS not using their own VCS, not linux devs.
13
u/bart2019 Apr 13 '19
You mean Git can handle this size of codebase? Impressive... Is it one repository, or does it depend on submodules?
The article mentions a branch that got 60000 commits in a few weeks. That seems to imply a single source tree.
33
u/theferrit32 Apr 13 '19
Seems like one repository. But Microsoft created and uses Git VFS to handle this. Developers don't need to download the entire repository, files are downloaded on demand as you need them.
14
u/smacdo Apr 13 '19
One repo with lots of branches. Heres a great overview of how it's done
https://devblogs.microsoft.com/bharry/the-largest-git-repo-on-the-planet/
1
u/ugnyteaaa Jan 02 '22
git might've been programmed by Linus, but all of the features and concepts that it has have already existed years before.
117
u/Kcufftrump Apr 12 '19
And a lot of that is drivers and software dealing with drivers. Everyone forgets that Windows was the answer to the device driver problem. Prior to Windows and the GDI, every vendor of every device had to write their own drivers for every unique configuration. Windows abstracted that away with the GDI so vendors of peripherals could write to that with at lease some expectation that as long as they wrote to spec, their devices would work on Windows system.
2
u/pdp10 Apr 16 '19
Everyone forgets that Windows was the answer to the device driver problem.
Windows was. NT had a different mission, though. Eventually they merged.
-30
u/Iwan_Zotow Apr 12 '19
> Windows abstracted that away with the GDI so vendors of peripherals could write to that with at lease some expectation that as long as they wrote to spec, their devices would work on Windows system.
Ha-ha-ha-ha-ha-ha-ha, Windows, did you ever hear about PostScript?
9
0
Apr 12 '19
[deleted]
1
u/pdp10 Apr 16 '19
Windows was a huge disruption because the apps that were dominant partly because of their extensive driver support no longer had that driver advantage on Windows.
That was probably one of the two biggest factors that led to WordPerfect's downfall. The driver and template/keystrokes situation is largely what led to the lag in supporting Windows directly, not the other way around. With CUA dictating much of the interface, and print and display drivers now provided by the OS, it was now the OS that was providing much of the value, entirely unlike DOS. This was hugely disruptive to WordPerfect's value proposition (on IBM PC. I had WordPerfect on Unix, where it already didn't apply much.)
Probably the other big factor was WordPerfect being slow to reduce prices, as the cost of application software plummeted seemingly around the time of the 1990-1991 recession. Today we think of MS Office as being the winner because it was integrated and high quality, but at the time it was the aggressive OEM bundling and the extremely attractive bundle pricing of first-party software that carried the day and doomed 1-2-3, WordPerfect, Borland, etc.
-20
u/Iwan_Zotow Apr 12 '19
Yeah, but in non-Windows world problem was solved long time ago with invent of PostScript.
40
u/TheSkiGeek Apr 12 '19
PostScript solves the “what do I tell my printer to print” problem, not the “HOW do I tell my printer to print” problem.
-15
u/Iwan_Zotow Apr 12 '19
Well, that was rather trivial - serial line connection, serial driver, send raw PostScript to printer for rendering. This is how Apple LaserWriter worked, IIRC
23
u/gnu-rms Apr 12 '19
Yeah, that's not how this works. Especially when you get to different print options, e.g. print my PS as duplex, or A3, or monochrome. Then the concept of multifunction printers comes about.
33
u/indrora Apr 12 '19
Not entirely.
Remember that the GNU project was started because of a fucking printer. It would take Apple building the printing system most Unix systems use before anyone had anything consistent.
PostScript is actually a really complex bit of work. It's a whole language with its own stack, a whole bunch of elided math, and stuff that can get you. Until about the early 2000s, unless you did a ton of work (or put a beefy processor in your printer), you're gonna be doing a lot of work to print on the computer side.
A PostScript printer cost 10x that of a normal printer because it had to have a beefy about of RAM. Until HP introduced the LaserJet, which had an ASIC PostScript processor and a lot (4MB!) of dedicated PostScript RAM, you basically had a beefed up computer that handled printing. You still do -- I've had a printer that had an ARM chipset and ran FreeBSD.
Every printer company has their own control language as well. If you go look at CUPS, what you'll see is that most of what a PPD does nowadays is transform PostScript and mangle some control values. Brother, HP, Okidata, Canon, etc all use something different. This is mostly the result of nobody wanting to talk to each other and in some cases maintaining backwards compatibility with the control language their word processor printers used, making it cheaper to produce the printers themselves.
"IPP!" I hear you exclaim. "It's a standard!" Well not really. Sure, the transport is consistent but oh boy. Any time you add the ability for a vendor to add "vendor specific extensions" you'll have vendors that only use those extensions for actually doing work except for the bare minimum the standard requires. IPP doesn't actually require you to print using PostScript over IPP. For, you know, backwards compatibility.
It wasn't until the 2000s when HP won the Printer Wars that everyone started talking JetDirect and PCL6. Yes, the 6th generation of Printer Control Language. I still have to deal with a PCL3 device on occasion and I'd rather not and say it's fucked but there's only one or two devices that can handle the bullshit that is some thermopaper that has self adhesive.
As an aside, you'll hear a lot of people exclaim their love for a specific driver, the LaserJet5 printer driver. This printer was popular: a black and white laser printer that could pump out pages. They were so popular that they became a defacto standard among application developers who didn't want to dick around with windows' printer stack, which wasn't totally uncommon back in the day.
For a whole couple of generations of printers, that printer was the standard printer, and what most things tried to emulate, to varying degrees of success. Today, this printer driver does most of its work doing PostScript rendering on the PC side, since it can't handle anything modern, but it produces clean PCL and raster PostScript blocks. It's slow but often just enough to make the standard work.
20
0
u/pdp10 Apr 16 '19
It wasn't until the 2000s when HP won the Printer Wars that everyone started talking JetDirect and PCL6.
I'd have said it was slightly earlier -- mid 1990s and PCL5, possibly. And speaking Jetdirect is just raw
tcp/9100, which is really more of a convention than a standard.Say what you will about printing from the 1980s to the early 21st, but you could invest in a quality printer then, and try to standardize, and I'm not at all sure you can do that today even if you try.
1
u/indrora Apr 16 '19
IPP and PPDs have made it a fair breeze on Unix, but there's quirks to the Windows printing framework that make it harder, plus the propensity of hardware makers to obscure the actual printer driver in a broader framework. There's a push to use IPP internally, but it's harder for the average user due to inherent complexities and legacy support for extreme integration of vendor extensions into the printing dialog entirely for backwards compatibility.
0
u/pdp10 Apr 16 '19
PostScript.
Truly a brilliant innovation, but quite strongly proprietary and thus limited. It was successful in printing for a long time, until the economics and tech aligned to do the rastering in host-side software, with "winprinters". It was less firmly successful in display, being used briefly in Sun NeWS and by NeXT, because X11 was entirely unencumbered by comparison.
0
Apr 12 '19
[deleted]
7
u/frezik Apr 13 '19
PostScript printers were expensive because it's a whole programming language of its own, so you needed a beefy processor on the printer to be able to handle it. Lots of RAM, too.
0
Apr 12 '19
[deleted]
38
u/MotorAdhesive4 Apr 12 '19
printers
45
10
u/mustang__1 Apr 13 '19
Lost a day of my life over hp printer drivers this week alone. Fuck printers. Fuck hp. fuck hp printers.
2
u/MetalSlug20 Apr 13 '19
Many hp printers are open source now actually. There are a few yet like the big business printers that still have some proprietary code blocks that are stripped out of the open source code
81
140
u/pistacchio Apr 12 '19
Time to rewrite it in Rust
104
14
u/Waghlon Apr 13 '19
One of my favourite programming jokes is "time to rewrite it in Rust".
3
u/luzzif Apr 13 '19
Why? What are Rust's negative points?
19
u/Waghlon Apr 13 '19
I'm not saying Rust is bad. I've just heard the phrase "rewrite it in Rust" so many times it's become bit of a meme.
6
u/luzzif Apr 13 '19
Oh okay, got it. I didn't want to come off like a Rust fanboy btw. I was genuinely curious about what you'd think its negative points were :)
2
u/red75prim Apr 14 '19
Actually, it's other way around. You heard the phrase so many times because it became a meme of sorts.
36
u/fluffy-badger Apr 12 '19
If that's true I'm actually kind of impressed it works as well as it does. What a maintenence nightmare.
There was an Oracle horror story here a while back that was similarly disturbing.
5
11
u/Deoxal Apr 13 '19
I love how someone asks a simple question, and then an extremely detailed answer is often given on quora.
18
6
16
u/saijanai Apr 12 '19
And of course, one of hte goals of VPRI was to create a fully functional OS with capabilities that rival that of WIndows 10, using a code base roughly the same size as Squeak 1.0's:
20,000 lines of code — small enough that a single person could fully understand and maintain the entire OS.
.
Their solution was to create ad hoc specialty languages that would simplify and reduce the number of lines of code required for specific applications that would then be compiled into the base ISA for actual processing.
They achieved their goal, by the way.
6
u/jediknight Apr 13 '19
They achieved their goal, by the way.
No, they did not. They ran out of funding before they reached their goal BUT, they did get very close.
0
Apr 12 '19
[deleted]
19
u/saijanai Apr 12 '19
Well, the most unique example is using the RFC diagram as the source code for the implementation of the functionality described BY the official RFC diagram:
http://www.moserware.com/2008/04/towards-moores-law-software-part-3-of-3.html
.
This paper shows a working text editor and text wraparound in 37 lines of domain-specific code:
http://www.vpri.org/pdf/m2010002_lobjects.pdf
.
THis report gives an over view of their work:
http://www.vpri.org/pdf/tr2012001_steps.pdf
.
This is the full list of official VPRI reports and publications:
4
Apr 13 '19
There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.
15
Apr 12 '19
I wonder what the future holds. I hope MS are letting the senior devs mentor and teach the new talent how the code works. I can't even imagine how much a newly hired programmer must study to make any change to the source code.
34
u/possessed_flea Apr 12 '19
Very little, every dll and executable in the project will compile standalone, most teams would be responsible for one executable at the very most, for larger executables a team would be only responsible for a portion of a single executable .
If you are brought into the GDI font rendering team there is exactly zero chance of you ever touching a line of code outside that.
13
2
u/nikgon Apr 13 '19
Well, that doesn’t address the comments question. Making a (shippable) reasonable change to the code base can indeed take months (if not years) of training (and politics) even within the scope of a single executable. Yeah, it's modular to an extent, but it doesn't mean that it's not easy to break or simple to test. It is very difficult to work with indeed.
6
u/possessed_flea Apr 13 '19
A single shippable change would probbably take a new hire at most 3 months.
It’s not modular “to an extent”, completely and utterly modular in every sense of the word.
I think you fail to understand how rigorous the engineering process is, breaking changes are pretty much impossible because review meetings bring in a LOT more people than you would expect. ( once on a “large” project we had about 40 people crammed into a conference room, of whom i definitely didn’t know the name of half of them without looking at their badges. )
And in the off chance a big slips past review I can guarantee that v&v would pick it up
1
u/brainwad Apr 13 '19
If they haven't coded for the Win32 API before: a long time. But at least everything is well-documented, thanks to the 2000 anti-trust case.
14
u/LukeLC Apr 13 '19
Windows' backwards compatibility has long been one of its strongest features, but at this point, I honestly feel like it's holding things back. Virtualization and emulation have come a long ways and we now have powerful enough hardware to eat the overhead of doing it. It would really be better to cut out all references to code from previous versions of Windows (that aren't actively being developed for Windows 10) and use something like the upcoming Sandbox feature for any and all legacy apps.
I mean, really, if the argument is "we have to maintain this massive codebase to avoid breaking things"... and then that codebase is so unmanageable that you end up breaking things... it's kind of a moot point. If stuff has to be broken, break the past to build a better future.
21
u/deal-with-it- Apr 13 '19
break the past to build a better future.
People are paying big money to keep the past as-is. Legacy code.
9
u/GYN-k4H-Q3z-75B Apr 13 '19
Reminds me of how my dad wrote various accounting tools in the early 80s. There are various local insurance brokers that adopted it because his friends got into that back in the day. They make tons of money and run my dad's old ass accounting software in DosBox instead of switching to something else. My dad had some other job since 1981 and did this in his free time. He's retired, but they still offer him well paid freelance gigs to update and support, rather than upgrading to some other software.
5
Apr 13 '19
If the software does the job and everyone at the company is already trained in it, it makes a lot of sense. Why fix what isn't broken?
7
u/LukeLC Apr 13 '19
Like I said, we now have the ability to keep running legacy code without it being built into the OS itself. Actually, we can do it far better than that. If Microsoft wanted to, they could virtualize every version of Windows and even DOS so that everything runs in its original environment, segregated from Windows 10 proper.
2
Apr 13 '19
The other week I stumbled across my old university programming notes from the early/mid-90s. An hour later I had dosbox on my Linux workstation, with Borland C++ 3.1, FoxPro 2.6, and Norton Commander. Nostalgia overload.
1
u/spinicist Apr 13 '19
Agreed. Ship an official version of DOS Box, with a Win95 Box, a WinNT box, etc. Seems much cleaner than having all that functionality sitting in Windows 10 forever?
3
6
u/space_fly Apr 13 '19
They do get rid of legacy stuff from time to time. For example, during the transition to 64-bit, they completely got rid of all the DOS emulation, 16-bit real mode stuff.
Given their recent developments, if they were to rewrite Windows it would probably not be as open, programs would be much more limited. Look at how WinRT turned out, which is one of the places where they didn't have to do any legacy stuff.
3
1
u/dustarma Apr 13 '19
Only for 64-bit processors because x86_64 is limited that way, in 32-bit Windows the DOS emulation layer still works
1
u/space_fly Apr 14 '19
They could have built an emulation layer, similar to dosbox, to keep support for these old programs. They decided not to do that, and completely dropped support.
8
u/enygmata Apr 12 '19
How is it so big yet so empty after the install?
55
u/Acceptable_Damage Apr 12 '19
Empty? It comes with candy crush...
15
u/theferrit32 Apr 13 '19
Lmao, this will never stop making me angry.
3
u/dustarma Apr 13 '19
One of the things I've never gotten about the hate for Candy Crush being included is that it hasn't been the first time that Microsoft has bundled games with the OS, they even had a sort of demo for a pinball game in the form of Space Cadet Pinball.
6
3
1
9
1
u/KotomiIchinose96 Apr 13 '19
And they still haven't figured out how to update without pissing off half the people who use it.
13
Apr 13 '19
No amount of perfection at that level can overcome the near infinite user configurations that work against you. And then you have viruses. And malware. And weatherbug (showing my age here).
3
u/SirWobbyTheFirst Apr 13 '19
True but when you also fire your entire QA department, that also contributes to the work against you.
Sincerely someone who hasn’t stopped drinking since he finished fixing the huge fleet of machines killed by Tuesdays Update to Windows 7.
1
u/Uristqwerty Apr 15 '19
Applications already survive being suspended to disk and resumed from hibernate mode. Would there be a way to suspend applications, update much of the kernel out from underneath them, then resume without any loss of user data? (Especially transient web page state!)
Maybe it wouldn't be cost-effective to support some parts of the win32 API, so then why not make sure there are newer APIs that can be used to achieve the same results, then say "We can automatically preserve your state if you upgrade" as incentive?
0
u/Tweenk Apr 13 '19 edited Apr 13 '19
The diversity of configuration has very little to do with this. The reason why Windows updates suck are:
The OS is too large.
There is no rigid separation between system files and user files.
Chrome OS and Android can install updates to the second partition in the background and then just reboot into the updated version, but only because they are leaner (so that two full copies of the OS fit in storage) and have a read-only system partition.
-1
Apr 13 '19
You're an ignorant fool. End of story.
7
u/heavyish_things Apr 13 '19
What an unnecessarily rude reaction to something reasoned, technical, polite, and correct.
1
Apr 14 '19
The post that exists now was not there before. I don't recall the comment that did, but it was worthy of my response.
1
u/vitorgrs Apr 14 '19
Actually, yes they did. They won't force Windows Feature updates for 18 months. https://blogs.windows.com/windowsexperience/2019/04/04/improving-the-windows-10-update-experience-with-control-quality-and-transparency/
1
u/potatomolehill Mar 20 '23
Yea, they made windows 11 which is far worse. 95, ME, XP, VISTA, 7 and 10 are the prime time of Microsoft.
1
1
1
1
u/longm0de Apr 14 '19
That's interesting about the size of the entire operating system. If anyone is interested about a more narrow analysis of the core components of the kernel, Microsoft published essentially how many LOC the core kernel and its key subsystems have. ( https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/One-Windows-Kernel/ba-p/267142 ) It's roughly 1.7 million lines of code.
1
1
0
0
0
Apr 13 '19
C is a nice language but really make you have to understand how computers handle memory etc; besides that, Microsoft sure knows how to compress an OS into a few gigs.
3
u/brainwad Apr 13 '19
Windows is written in C++; but the point stands, memory management is a bitch. We always had dangling pointers and heap corruption when I worked on MSHTML.
1
Apr 13 '19
The article says; most is written in
Cnot until recent versions is there a little more ofC++.
-1
-6
-1
u/CODESIGN2 Apr 13 '19
has anyone ever run analysis on the AST for windows to try to reduce those LOC down?
I suppose you'd need an abstract intent analysis for it to be truly useful, but it could help reduce by even 5 or 10 percent, then surely it'd be worth it?
-16
u/chidoOne707 Apr 13 '19
No wonder it still is a horrible OS system.
10
Apr 13 '19
The NT kernel is pretty good, actually. It's a well designed and well written OS.
But a lot of the stuff built on top of it, not so much. There are a lot of pretty crappy components, and then some *really shitty* ones. I was talking with one of the original NT developers (he now works where I work) a few days ago about the Setup APIs and he just buried his face in his hands.
-57
Apr 12 '19
That shit has more bugs than lines!!!
58
u/the_bananalord Apr 12 '19
I think it does pretty well for software that can run out-of-box on millions of hardware combinations
1
-25
Apr 13 '19 edited Apr 13 '19
Out of the box?... So you never needed to install drivers I guess, very different it is that all hardware share the same basic init instructuons... For exactly that reason allowing an os to use it at least its most basic instruction set... How is that a win for windows?...
24
u/the_bananalord Apr 13 '19 edited Apr 13 '19
Out of the box?... So you never needed to install drivers I guess
Not for probably a decade now.
How is being able to plug-and-play an incredible amount of hardware a win for Windows? How is it anything but a win? Windows 10 loads a basic driver when it detects hardware and downloads a full one via the Windows Update Service if available. Brilliant way to do it.
→ More replies (4)1
-11
u/dalepo Apr 13 '19
is that why it is so slow then?
7
u/VirtualHorizon_ Apr 13 '19
Maybe your pic just sucks REALLY bad bc it runs buttery smooth if not better than it did when I had 7 installed
-8
u/dalepo Apr 13 '19
I guess you never tried linux
→ More replies (1)15
Apr 13 '19
Why is Windows 10 so slow?
Windows 10 runs better than Window 7
I guess you never tried Linux.
This is why we should still be teaching how to debate at schools.
-7
Apr 13 '19
eh? is this Microsoft fan boys lurking around?
1
u/VirtualHorizon_ Apr 18 '19
I mean I’m just stating my opinion. I personally use Linux but when using win10 on my other machine it runs damn smooth. And better than win7 did. More bc of optimization of win10 but it’s whatever.
1
Apr 18 '19
not on my watch.
1
u/VirtualHorizon_ Apr 18 '19
Hmm?
1
Apr 19 '19
It lags in my machines
1
u/VirtualHorizon_ Apr 19 '19
What are your specs? I mean I have a few hiccups on mine with both win7 & 10. Although I have to admit on my laptop the windows key takes a shit long of a time to load.
1
Apr 19 '19
old laptops
and hence linux
1
u/VirtualHorizon_ Apr 19 '19
No no no I use my laptop for YouTube and basic web browsing using win10 on my actual pc i have a dual boot set up using win10 and Linux (for programming)
-17
u/NoahJelen Apr 12 '19
I bet my custom linux system will only be about 1-2 GB of source code (including the kernel)!
-4
-4
-10
-34
Apr 12 '19
Do they realistically believe that they can make any kind of progress with a code base like that?
I mean, sure, someone might get lucky and be able to figure out some trivial bug and fix it, but most bugs won't be trivial. It would require an army to prevent bitrot.
→ More replies (1)
248
u/TimeRemove Apr 12 '19
Here's a post about Microsoft's effort to store it in Git:
https://devblogs.microsoft.com/bharry/the-largest-git-repo-on-the-planet/
TL;DR: They invented a "Git Virtual File System" to do the job.