[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
▼ Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


im trying to learn from some imageboard software and they just use one character variable names. is there some program that does this for you? why release something to the public that is barely parseable?
>>
an imageboard is extremely simple to implement.
what do you even need to reference?
>>
>>109932890
What the hell am I even looking at. What language is this, looks weird as fuck.
>>
>>109932890
just get claude to rename the variables to easier names bro...
>>
>>109932890
This is not obfuscated. Pic unrelated?
>>
>>109932890
https://en.wikipedia.org/wiki/Minification_(programming)
Find the original source code and read that.
>>109933011
JavaScript
>>
File: 1099.png (175 KB, 702x993)
175 KB PNG
>gazou_img
>>
>>109933280
I assumed it was JavaScript but its just weird with all those commas all over the place. And !1 especially makes no sense whatsoever.
>>
>>109932890
those are usually .js files that have been stripped to save bandwidth using webpack, rollup, parcel and similar tools
>>
>>109933304
!1 evaluates to false
>>
>>109933304
how newfag are you? not knowing non-zero in C-like languages
>>
>>109933672
I have used javascript before. Its just the specific syntax style generated by the minimizer differs from what a human would code. Humans are not compilers. I generally read code by pattern matching standard constructs, rather than picking appart syntax like a compiler does.
>>
>>109933735
in that case you probably don't know comma operator
function foo() {
console.log('foo')
}
function bar() {
console.log('bar')
}
function baz() {
console.log('baz')
}
foo(), bar(), baz() // evaluates everything, returns the last value
>>
>>109932890
This is not obfuscation, this is minification.
When writing JavaScript you often want to use the newest version of the language, put everything in separate files and add all sorts of comments and long variable names. But not every browser supports them so you transpile it to simpler js version and bundle them into few bundle files. But all of that compounds size of your files which make your browser slower to load the page, so you do minification that removes comments, reduces variable names, etc so your code is short and fast to load.
You should thread the final production js files as opaque as binary .exe. Just look at the actual source code instead of this transpilation artifact.
>>
File: file.png (113 KB, 800x600)
113 KB PNG
>>
That's just what javascript looks like
>>
>>109934072
cute
>>
That's a holdover from algebraic from math. And examples at that. They used to carve these into stone tablets so it made sense.

Some programmers like and agree with this principle.
Personally, I don't. I think math notation is dogshit, that's why I write in programming languages and Latin, not mathematics and Greek.
This extends to their virtues too.
In math, using single letter names is common if not encouraged. And things like scope just do not matter, what's `c`? It's a well known constant. Oh you don't know about it? Well it's well known so you should.

How about "capacity". Oops, my bad I forgot we still use punch cards were every character is important, and widescreens are uncommon.
Which isn't even the hardest argument. You don't even need more than the arbitrarily agreed upon line width of 80 characters, you can still easily meet that with full English words in your variables and functions if you actually abstract it well.
But people retain this single character nonsense anyway. Just name all variables `x`, why not?
>>
>>109934543
>That's a holdover from algebraic from math. And examples at that.
maybe better said as
>from algabraic math notation
And I specifically mean examples used to teach, not used in real practical applications of the principles.

In math, that's less true. But in programming I feel it's more common.
You see in examples people writing `x` or `foo`, but you see that less in projects of worthy merit. And I don't think its a coincidence.
People take example code too literally and don't understand it's just an example. Maybe that makes it a bad example, but I think I made the point.
We should have better examples and better code for programmers. Less math legacy.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.