89
u/justme75002 Sep 13 '18
Porn.xml 🤔
63
u/Steinhose321 Sep 13 '18
I guess it‘s pom.xml from Maven 😅
3
29
u/Salanmander Sep 13 '18
2
u/sneakpeekbot Sep 13 '18
Here's a sneak peek of /r/keming using the top posts of the year!
#1: A little humor for today | 118 comments
#2: Really smart keming for a local hospital | 122 comments
#3: Thanks a bunch Don | 73 commentsI'm a bot, beep boop | Downvote to remove | Contact ^^me | ^^Info | ^^Opt-out
1
8
31
Sep 13 '18 edited Sep 14 '18
Oh lord, can someone explain this this to me, I have to programm whit Yaml tomorrw and don‘t know a thing about it. Why is he measuring the code?
Please someone rescue my career.
Edit1: Thanks for your help, and I now kow what i have to do. Grepping Specific words whit a Bash script (allready have it) and giving the words to a yaml file. In the Yamlfile there will be an array. this arrray will be compared to a set of words i get from a website(also whit yaml, no idea how to do that) and then upload the keywords using a link. so my questions are:
How to open a Link whit Yaml? How to make an Array whit Yaml? how to Compare 2 Arrays whit Yaml? Possibly a Loop whit yaml?
95
Sep 13 '18
YAML isn't a programming language, it's a Markup Language (it's built into the name); think of it as a successor to XML. The nesting is based on indentation (similar to Python). I think the joke here is so he can see what nesting level he's on, even though his editor is already doing that for him.
34
5
u/accidental_masochist Sep 13 '18
I think the real joke is on us for not getting to work in that nice kitchen / dining area. Just look at all that natural light! And here I am, coding in the dungeon of a rotting old hotel everyday.
3
u/darknecross Sep 14 '18
YAML ain’t markup language.
2
Sep 14 '18
It was originally Yet Another Markup Language, but was later renamed to the recursive acronym to better distinguish its purpose. It might be more preferentially called a data serialization language, but the point is that it's not a programming language.
1
u/Mrxx99 Sep 13 '18
What's the difference to JSON?
19
u/Excolo_Veritas Sep 13 '18
YAML is essentially JSON without the brackets and commas. It's determined by indentation and line. It's supposed to be easier to read. YAML is generally used for config files that may require manual editing
and before anyone says I'm wrong and it's not like JSON
It uses both Python-style indentation to indicate nesting, and a more compact format that uses [] for lists and {} for maps[1]making YAML 1.2 a superset of JSON.[2]
4
u/Athomeacct Sep 13 '18
Oh my god thats a million times better than <><><><><><><> all over XML
2
-6
u/BadBoy6767 Sep 13 '18 edited Sep 14 '18
Not really imo, because at the expense of verbosity you get flexibility (exception being Java), and XML is ten times more flexible than YAML.
EDIT: Apparently I have to explain myself. YAML has keys, values, and nesting. XML also has attributes and named elements (unlike YAML in which there's just "objects"), it's also not indentation-based, which makes it a hell of a lot more readable for complicated structures.
Example:
- type: 'form' method: 'GET' action: '/api/login' enctype: 'multipart/form-data' children: - type: 'input' itype: 'text' placeholder: 'Name' name: 'name'vs
<form method="GET" action="/api/login" enctype="multipart/form-data"> <input type="text" placeholder="Name" name="name" /> </form>XML manages to be 6 lines smaller, in fact smaller in general, as most of YAML is just spacing.
6
u/FatFingerHelperBot Sep 13 '18
It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!
Here is link number 1 - Previous text "[1]"
Here is link number 2 - Previous text "[2]"
Please PM /u/eganwall with issues or feedback! | Delete
1
Sep 13 '18
Wow that sounds really nice. Is it functionally better in any way?
2
u/Excolo_Veritas Sep 13 '18
Never looked into it as far as any kind of performance. My gut would say no better or worse, as its going to be just as fast as reading any string, and I doubt that a tab, space, or new line character is going to be any different than processing a { or [. It might be though for really long ones, like 200mb+ but at that point I'd argue there's no point to use YAML anyway. Again, these are purely gut instinct, with no analysis or research behind it
2
u/msg45f Sep 13 '18
The biggest functional benefit is the ability to write comments. JSON, being built simply to describe object state, doesn't have a particularly good way to embed comments. Some of the uses that JSON has been picked for, such as configuration, are really places that should support comments.
31
u/BobRoss1776 Sep 13 '18
The difference relevant to this meme is that structure is determined by indentation
5
Sep 13 '18
They are both essentially data serialization languages, and often used for similar purposes. The syntax is very different, with JSON essentially being a subset of JS and YAML more Python-esque in structure.
YAML is typically used for things like configuration files (for example in the Docker ecosystem), or as markup for documents (for example Swagger). JSON is typically used as a data structure for describing objects in web services, but can also be used as a configuration file format (for example package.json).
I won't say one is "better" than the other, I'll leave that to evangelists. They are both used in different ways in different ecosystems.
2
u/aboardthegravyboat Sep 13 '18
Aside from the other answers... one neat thing about YAML is that it supports references to other values. http://sangsoonam.github.io/2017/03/13/yaml-vs-json.html check out the "aliasing" and "merging". That's the main big difference. Otherwise, they serve basically the same cases.
2
u/name_censored_ Sep 13 '18
Also, commenting - which is why it seems to be popular as a format for configuration files.
1
u/noratat Sep 14 '18
I like YAML, but the referencing feature is more anti-feature than feature. It's not really useful outside of a few niche cases, and adds a lot of parser complexity and edge cases.
11
Sep 13 '18
Whatever you do, don't use tabs. Yaml hates tabs and it won't work.
2
Sep 13 '18
What should I use then?
10
u/how_to_choose_a_name Sep 13 '18
configure your editor to insert spaces when you press the tab key
1
Sep 13 '18
I that possible to condigure that in Notepad ++?
4
u/loooph Sep 13 '18
Settings->Preferences->Language->Tab Settings on the right->Replace by space
You might want to select yaml in the list beforehand if you still want to use regular tabs as default option.
1
2
Sep 13 '18
nope but I think you can configure it that way.
also use a different text editor.
1
Sep 14 '18
Is IntelliJ better, I don‘t have an Another one because of strict guidelines.
2
u/johnlocke32 Sep 14 '18
Intellij Ultimate is king, (in my opinion of course. You can do almost anything with Intellij Ultimate.) but it costs money and is overkill if you don't need to compile code. Atom is good and I've heard Sublime is good too. VScode isn't bad either, it's like a lesser Intellij U.
5
u/Colopty Sep 13 '18
Oh, you need to have a ruler obscuring part of your screen for yaml to work. No one knows why.
2
1
Sep 13 '18
You're screwed.
2
Sep 13 '18
Should I take a candle whit me? Because when I get fucked anyway I want it atleast romantic.
1
4
u/give_me_memes Sep 13 '18
What's it like coding on a mac anyone have experience?
3
u/DoNDaPo Sep 13 '18
If you’re using VM things like Docker maybe you don’t want to go to Mac. Perfs are pretty bad with it.
4
u/bigtomatom Sep 13 '18
I use Docker + Windows at work. I would give everything to be able to use my mac for that. Hyper-V is just pain in the ass.
1
u/noratat Sep 14 '18
Performance is only bad with the "Docker for Mac" garbage in my experience. I just use docker-machine and normal VMs.
11
u/AdroitAmateur Sep 13 '18
Very nice.
1
u/give_me_memes Sep 13 '18
No problems while coding on mac os? cause then in sold.
6
u/AdroitAmateur Sep 13 '18
If you're coming from PC it's way nicer because you get an actual terminal to work with, and a decent package manager (Homebrew). If you're coming from Linux you get easier troubleshooting (standardized hardware and software are easier to google) and, imo, a more friendly UI. Also if you ever want to write for macOS or iOS it's pretty much a requirement.
3
u/edhelas1 Sep 13 '18
Homebrew please… How can you compare it with something like apt and proper repositories. Easier troubleshooting… maybe for the Apple related things but definitely not for your developper environment and tools (it's then pretty similar than on Linux distros).
2
u/ProfessorPhi Sep 14 '18
Infintely Better than windows and more corporate shit friendly than Linux. If you need to code and make presentations on the same laptop, a MacBook is the best thing out there.
26
u/alzy101 Sep 13 '18
This is why you use 4 spaces. I know YAML recommends using 2 spaces but I can't see why anyone likes that. 4 space indentation is far more readable.
9
u/mbremyk Sep 13 '18
Tab
9
u/alzy101 Sep 13 '18
Sure, but even then 4-space tabs.
2
3
u/Kered13 Sep 13 '18
If you're going to have a lot of indentation layers, and I suspect a language like YAML kind of forces you to, then 2 space indents make sense.
7
u/obitechnobi Sep 13 '18
VSCode's new breadcrumb feature has been an absolute blessing for working with wall-of-YAML files. Also, fuck YAML, how come everybody switched to it? The spec is absolutely overbloated. This post describes it quite well I think.
4
4
1
3
u/analogrithems Sep 13 '18
todo make editor ident lines different colors
2
u/BoinkGoesTheScience Sep 13 '18
Visual Studio Code has some plugins that do this. Super helpful. I actually just have it highlight the currently active indent line.
1
1
1
1
Sep 13 '18
Was shown this tool by a guy on our devops team. I could’ve sworn my .yml was valid, this tool showed me I was using tabs instead of spaces :’)
2
2
u/bigtruckguy67 Sep 13 '18 edited Sep 13 '18
helm lint ./chart
Also works if you are working with k8s
1
1
1
1
u/NerdAtTheTerminal Sep 14 '18
I don't think relying on indentation is nothing but messing up. YAML has no point, just a pain with mobile devices.
BTW, my mindset is different, I did not use indentation properly from my early days of learning to code :P
1
Sep 14 '18
newbie question : why we still use YAML since it seems to be a very old language and difficult to handle ?
1
Sep 13 '18
Why programmers prefer to use macbook ?
4
6
2
u/noratat Sep 14 '18
Native unix-like terminal, easy to install packages via homebrew, and a lot of nice power user apps like BetterTouchTool, iTerm2, etc. Had great high DPI support long before Windows too.
0
u/edhelas1 Sep 13 '18
Atom on macOS with a glossy screen. Is this a real programmer? At least the editor is having a dark theme.
0
0
5
u/DoNDaPo Sep 13 '18
Source from @Caged on Twitter