Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
kitten smoothie
Dec 29, 2001

Cheekio posted:

Apparently Microsoft released the source code for MS-DOS and Word for Windows? I found this article but I can't seem to track down the actual code:

http://blogs.technet.com/b/microsof...-to-public.aspx

Here you go. Enjoy picking through the assembly code for edlin.

DOS: http://www.computerhistory.org/_static/atchm/microsoft-ms-dos-early-source-code/
Word: http://www.computerhistory.org/_static/atchm/microsoft-word-for-windows-1-1a-source-code/

Adbot
ADBOT LOVES YOU

Dren
Jan 5, 2001

Pillbug
Is json schema ever going to become a real standard? I didn't know about the surrogate pair quirk or the small incompatibilities with JavaScript objects but at least json's not XML.

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

This is awesome and will entertain me for weeks.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Dren posted:

Is json schema ever going to become a real standard?

The IETF drafts expired a year ago, so there is reason to hope that it won't.

ManoliIsFat
Oct 4, 2002

Cheekio posted:

Apparently Microsoft released the source code for MS-DOS and Word for Windows? I found this article but I can't seem to track down the actual code:

http://blogs.technet.com/b/microsof...-to-public.aspx

http://www.computerhistory.org/atchm/microsoft-ms-dos-2-0-source-code/
http://www.computerhistory.org/_static/atchm/microsoft-word-for-windows-1-1a-source-code/

both have download links in the middle of the articles.

Deus Rex
Mar 5, 2005

tef posted:

json is a crime against serialization formats. just simple enough to work and then everyone writes their own incompatible extensions atop to shoehorn in other data types. the rfc is wrong in many places (unicode esp).

it's arguably an even worse crime against configuration formats!

pseudorandom name
May 6, 2007

Well, if its a configuration format it doesn't have to interop with anything else and is more readable than XML.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

pseudorandom name posted:

Well, if its a configuration format it doesn't have to interop with anything else and is more readable than XML.

Yeah, "whitespace-independent nested lightly-typed key-value pairs with lists" seems like a pretty decent basis for configuring things.

qntm
Jun 17, 2009
JSON doesn't permit comments, which pretty much terminates that discussion.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Use JSON-Plus instead.

canis minor
May 4, 2011

Use YAML instead!

qntm
Jun 17, 2009

tef posted:

just simple enough to work and then everyone writes their own incompatible extensions atop to shoehorn in other data types.


Conversation complete.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
There's also JSON5 too.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The thing is that BSON had an opportunity to have the same data model as JSON, but provide benefits, like the fact that you can mmap it and retrieve fields in constant time.

Unfortunately, they seemed to define a data structure that has to be read into memory and parsed. Which is insane, because it's what's stored on disk in MongoDB.

Like, the whole thing about NoSQL databases is how they make the database more parallelizable. You would think that that would mean that if you had an array, you could just split the drat thing in two and farm both sides out to different workers to do MapReduce, but nope.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I've been Stockholm Syndrome'd by JSON because, for the stuff I usually do, it's often the least bad option that you can hope will be available. I want to give up on the API every time I want to use one that only returns XML.

EntranceJew
Nov 5, 2009

I had to work with a WSDL that only had one method and its functionality depended on what arguments were passed to it. Bonus points that sometimes it returned yes/no. Other times our in-house XML parser fed me back nothing when the returned value was "0". I'm glad to not be working there anymore.

Dren
Jan 5, 2001

Pillbug
So what would you pick for a configuration file format if you wanted it to be parseable in multiple languages and able to deal with lists, associative arrays, and scalars?

I have done XML and I've found that XML parsing in C/C++ sucks rear end. I have done JSON and liked it. I'm willing to try whatever though, as long as there's a good reason.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Dren posted:

So what would you pick for a configuration file format if you wanted it to be parseable in multiple languages and able to deal with lists, associative arrays, and scalars?

I have done XML and I've found that XML parsing in C/C++ sucks rear end. I have done JSON and liked it. I'm willing to try whatever though, as long as there's a good reason.

I don't believe in syntactic comments in configuration files, because they don't round-trip and so many configuration items are machine-manipulated now. Also because they quickly become a lovely syntactic extension mechanism (#!PLATFORM=PC). I just say that keys of the form __blat are to be ignored, usually via a censoring reviver, and put descriptive text in there. If you really want syntactic comments, JSON will probably be frustrating. Otherwise I think that it's the best choice in an annoying space.

XML also has a bunch of things you have to think about like whether to use a child node or an attribute, do entity processing, worry about CDATA, blah blah. Once you say your configuration file is XML, some rear end in a top hat is going to start changing the prefix for namespaces or otherwise bringing to bear the Full Power Of Markup, and then you have to find a toaster to put in his bath.

I used to wave the XML flag all the time, pre-JSON, and eval-as-decode still sort of repels me (you can avoid it even without native JSON though), but I think poorly of that old me.

Subjunctive fucked around with this message at 18:10 on Mar 26, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
It heavily depends on what your configuration is for, how sophisicated it is, and who/what is going to be editing it.

PrBacterio
Jul 19, 2000
All configuration files should come in the form of SQLite databases instead of some type of plain-text format :colbert:

floWenoL
Oct 23, 2002

PrBacterio posted:

All configuration files should come in the form of SQLite databases instead of some type of plain-text format :colbert:

Coding horror detected.

tef
May 30, 2004

-> some l-system crap ->

DaTroof posted:

If you really need to do that kind of thing with JSON, you might as well go full retard.

cf also the numerous ways in which people shoehorn in dates. for ex: / does not need to be escaped, but can be \/ , so some dialects have special meaning for "\/Obj(....)\/" strings.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Thermopyle posted:

for the stuff I usually do, it's often the least bad option that you can hope will be available.

The Web, in a nutshell.

QuarkJets
Sep 8, 2008

All of my configuration files are actually complex cryptography puzzles that the computer must solve before a program can run.

JawnV6
Jul 4, 2004

So hot ...
The challenge to the demon programmers was to convince their targets that the task set them had a definite conclusion that could be reached in a finite time.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
All my config files are copies of ascii goatse with the actual data encoded in non-printing characters (BEL is a zero, DEVICE CONTROL 3 is a 1)

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
if (!(foo > 0)) {
..
}

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
C++ code:
string fileContents;
readFileIntoString(filePath, fileContents);

unsigned long outBytes = 0;
const size_t bufSize = 16384;
unsigned char * in = (unsigned char *) malloc(fileContents.length());
unsigned char * out = (unsigned char *) malloc(bufSize);

memcpy(in, fileContents.c_str(), fileContents.length());
memset(out, NULL, bufSize);
someTransformation(in, fileContents.length(), out, bufSize, outBytes);
free(in);
in = NULL;
string s = string((char *) out);
free(out);
out = NULL;
The project is C++ but there was a dev on the team who always thought it should have been C instead. One way he expressed that was by writing code like this.

Cancelbot
Nov 22, 2006

Canceling spam since 1928

All of my config files are XML files.

:cripes:

At my current job. I can basically throw a dart at the solution explorer and find pure solid gold. This is the module where users can build custom fields based on calculating stuff based on other fields;
code:
public class CustomStatsFormulaeBLL
{
    private static VsaEngine _engine = VsaEngine.CreateEngine();
*snip*
Oh hey an obsolete reference to; http://msdn.microsoft.com/en-us/library/microsoft.vsa.ivsaengine(v=vs.110).aspx
Cool! A full JScript interpreter!

Scroll a bit and find;
code:
private static double? JScriptEval(string expr)
{
    try
    {
        return double.Parse(Eval.JScriptEvaluate(expr, _engine).ToString());
    }
    catch
    {
        return null;
    }
}
Oh and nothing is blocked/sanitised. Infact if you want to destroy the site just type while(true) because this stuff is Eval'ed for every row in their report.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Gazpacho posted:

C++ code:
string fileContents;
readFileIntoString(filePath, fileContents);

unsigned long outBytes = 0;
const size_t bufSize = 16384;
unsigned char * in = (unsigned char *) malloc(fileContents.length());
unsigned char * out = (unsigned char *) malloc(bufSize);

memcpy(in, fileContents.c_str(), fileContents.length());
memset(out, NULL, bufSize);
The project is C++ but there was a dev on the team who always thought it should have been C instead. One way he expressed that was by writing code like this.

Why malloc and memset, when you've got calloc available.
Also, why not mmap it and save a bunch of copying.

Anyway, I think my point was that he should write better C code if he's going to be an asshat about it.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



We've landed a man on the moon yet my company can't figure out how to not use Sourcesafe.

I watched two talks about clean and testable code and dependency injection and getting rid of global state last night. It depressed me greatly knowing that I'd have to go in to work and work with a system that I can only describe as being made by someone who watched that talk and decided that Misko Hevery was a raving lunatic and decided to go as far in the opposite direction as they possibly could.

This company recently launched a mentorship program that boggles my mind as I cannot think of a single person here I would want to be my mentor. I'm confident that anyone here with enough years of experience teaching me would also ruin my prospects of getting a job somewhere else.

piratepilates fucked around with this message at 00:34 on Mar 27, 2014

Jewel
May 2, 2009

piratepilates posted:

This company recently launched a mentorship program that boggles my mind as I cannot think of a single person here I would want to be my mentor. I'm confident that anyone here with enough years of experience teaching me would also ruin my prospects of getting a job somewhere else.

The concept of a mentor program seems weird. Pairing people together to work together and share information and tips and help between the two of them, is a pretty good idea, I think. It separates your mindset from the code and generally you can help eachother when one of you does something dumb, and you'll both probably learn a few things.

A mentor, however, doesn't seem to be a good option, as it'd probably leave the mentor thinking they're "better" than the other person, and the other person being frustrated that they're "better" than the mentor, with the likely scenario of the mentor's singular mindset polluting the protege's code ("No, don't do it that way, here's how I'd do it").

Of course, none of this could happen, and that'd be great, but from being in groups of similar skill, where one person's been appointed "leader", this stuff usually tends to happen v:shobon:v

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Jewel posted:

The concept of a mentor program seems weird. Pairing people together to work together and share information and tips and help between the two of them, is a pretty good idea, I think. It separates your mindset from the code and generally you can help eachother when one of you does something dumb, and you'll both probably learn a few things.

A mentor, however, doesn't seem to be a good option, as it'd probably leave the mentor thinking they're "better" than the other person, and the other person being frustrated that they're "better" than the mentor, with the likely scenario of the mentor's singular mindset polluting the protege's code ("No, don't do it that way, here's how I'd do it").

Of course, none of this could happen, and that'd be great, but from being in groups of similar skill, where one person's been appointed "leader", this stuff usually tends to happen v:shobon:v

I couldn't think of a better way to say it so I didn't include it before but,

I'm pretty confident that I'm better than anyone here who could be selected to be a mentor.

I could learn a lot about experience working in a team or in an office which I will admit I'm lacking but anything along the lines of technology would just corrupt minds that had potential with horrific thoughts of badly thought out decades old Windows programming.

I don't understand how so many people can seem to collectively reject notions of "being able to write code that other people can read" or "testing".

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

piratepilates posted:

This company recently launched a mentorship program that boggles my mind as I cannot think of a single person here I would want to be my mentor. I'm confident that anyone here with enough years of experience teaching me would also ruin my prospects of getting a job somewhere else.

Is that because you feel you're too stupid to do anything, or do you feel that the engineers you're working with are idiots who wouldn't really help?

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

leper khan posted:

if (!(foo > 0)) {
..
}

If that's the worst you're finding, you're in a pretty good place all things considered.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Suspicious Dish posted:

Is that because you feel you're too stupid to do anything, or do you feel that the engineers you're working with are idiots who wouldn't really help?

I'm venting a lot about my job and I have to restrain myself from going overboard but the amount of technical debt at this company overshadows the GDP of small African nations.

The style of development here results in unreadable, clunky, hard to test, very stateful, and often buggy code 100% of the time.

Flownerous
Apr 16, 2012

leper khan posted:

if (!(foo > 0)) {
..
}

int or float? I use that form if it's a float and I want to catch NaN too. Maybe I'm the horror?

JawnV6
Jul 4, 2004

So hot ...

Jewel posted:

A mentor, however, doesn't seem to be a good option, as it'd probably leave the mentor thinking they're "better" than the other person, and the other person being frustrated that they're "better" than the mentor, with the likely scenario of the mentor's singular mindset polluting the protege's code ("No, don't do it that way, here's how I'd do it").

If you look around and there's not anyone to learn from: leave.

You should be actively seeking out mentors in your company and industry. I have a longer post more suited to the oldie thread about the types of mentors you can't do too well without, but I can't really tell if you're responding to the specific instance or positing that you can't imagine someone unequivocally better existing at all.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Volmarias posted:

If that's the worst you're finding, you're in a pretty good place all things considered.

Volmarias posted:

If that's the worst you're finding, you're in a pretty good place all things considered.

The function was called something like 'setBar' and it sets the value of baz if foo is <=0.

It has nothing to do with bar, though bar is an actual thing.

Names are slightly more appropriate than that, but not really because the name of the function still has nothing to do with what it does.

Thanks outsourced developers doing things in my codebase.

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

Flownerous posted:

int or float? I use that form if it's a float and I want to catch NaN too. Maybe I'm the horror?
That would be a horror if you don't leave a comment noting the NaN behavior next to it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply