[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 324
Thread images: 36

File: 1240590811928.png (516KB, 934x1000px) Image search: [Google]
1240590811928.png
516KB, 934x1000px
What are you working on, /g/?

Old thread: >>58174411
>>
Nagato should have a Santa hat.
>>
File: typing.png (41KB, 551x372px) Image search: [Google]
typing.png
41KB, 551x372px
>>
>How can I do recursion with lambda functions in java
>I need a way to call my lambda function again
PLS ANSWER
>>
>>58181779
This thread is pathetic. It is not about programming. It's just a bunch of computers illiterates and first semesters memeing about whatever they just learned.

A quick search shows that most arguments used here are not original and have been copied from some trendy tech blog or other shit site.

The only real programming questions I have seen so far are from beginners(it's fine to be a beginner btw).

This entire site is shit and I don't know why anyone would regularly come here.
>>
>>58181804
fix f = f (fix f)

in Java
(this syntax might only be approximate)

a fix<a>(Function<a,a> f) {
return f(fix(f));
}
>>
Functional programming thread:

>>58174033
>>
File: logan.jpg (49KB, 466x296px) Image search: [Google]
logan.jpg
49KB, 466x296px
>>58181800
>casting the result of malloc
>>
I'm tagging lots of different images with my image viewer Ivy. I've been testing it's ability to cope with images that have weird XMP in the file before I add any tags and it's been able to take care of most problems that crop up rather well. Anything really weird would break from the RDF spec, so I don't think I'll be encountering anything I can't handle - or at least be able to solve with a few new lines of code.
>>
>>58181823

just keep it all in one thread, wtf.

the /dpt/ hasn't been as good since the divide
>>
Just fucking around.
>>
File: 1472269721369.gif (1005KB, 540x304px) Image search: [Google]
1472269721369.gif
1005KB, 540x304px
>>58181811
And you use it like this:

fix (\f -> \x -> ...)

(in Java, no \s)

Inside the ..., x is the parameter to the function, and f is the function. Calling f will recur.

>>58181846
>i-it's not like i missed FP or anything! baka!
>>
>>58181856

want to do stuff like this in C. how?
>>
>>58181873
It requires averaging multiple colours to compute a cell. Unfortunately averaging numbers isn't possible in C.
>>
>>58181811
Okay I think I got it thanks
>>
>>58181846
When Lisp threads started appearing (and then moved to that shithole Lainchan), I knew things really jumped the shark.
>>
>>58181873

You'll need some sort of BMP library. If you don't want to render text yourself, find a comprehensive 2D graphics library.
>>
File: mohd.jpg (23KB, 210x210px) Image search: [Google]
mohd.jpg
23KB, 210x210px
>>58181877
>Unfortunately averaging numbers isn't possible in C
>>
>>58181846
People wanted Haskell niggers GTFO, they GTFO.
What's wrong with that?
Now other programming paradigms can flourish on their own.
>>
>>58181811
>>58181885
Just kidding haha I'm too much of a brainlet for recursion haha
>>
>>58181856

how do we know you didn't just use one of those online ascii art generators?
>>
>>58181934
see >>58181868
fix (\f -> \x -> ...)


\x -> ...
is a function

and f is that function (so you can call it from inside itself)
e.g.


fix (\factorial -> \n -> if n == 0 then 1 else n * factorial (n - 1))
>>
I think I'm getting closer
In a recursive function the return type has to be the same as the parameter type right?
>>
>>58181947

You don't, but I promise I didn't. It's written in Cshart.
>>
>>58181955
not necessarily, but normally there is some parameter of the same type
>>
I'm trying to make a Rebbit bot that monitors a specific user in real time and draws statistics about the user, such as a graph of how ofthen the user posted in the last X hours etc

I'm doing this with Python and praw

Anyone knows if this is the right way to do it, if something similar has already been made and any tips/advice?
>>
>>58181955
Not at all. In the functional argument to fix, it has to be the same type because the type is that of the resultant function.
>>
>>58181973
>>58181995
But lets say you have a public Car f(Road r)
You couldnt make that one recursive right?
>>
>>58181971

im pretty new to programming. So to write code to do ascii art, do you first put all the characters into a 2d array and then loop through them to change the color? or is there somehow to read the file and it does it for you?
>>
>>58182010
Car f (Road r) {
return f(r);
}

Boolean g (Road r) {
return g(r);
}


Camel h (Boolean x, Float y, Camera z) {
return h(x,y,z);
}
>>
>>58182010
In theory, you could, if there was a way of getting a Road from a Car and vice versa.

When you call fix, you're defining a recursive function by supplying a function from a function to a function (well, it doesn't have to be a function to a function but in a strict language you will just end up with an infinite loop if not).
>>
>>58182035
in C++

template <typename R, typename ... A>
R forever(A&& ... args) {
forever(std::forward<A>(args)...);
}


A function taking any types you want and returning any type you want.
>>
>>58182036
In my case one is a generic so I dont think I can cast it or anything
>>58182035
Ok I see thanks
>>
>>58182015

What I actually do is take the RGB values of a pixel, and then average them. After that, I map the average (0..255) to an index in a string containing characters for each level of brightness (0..str.length-1) and then I place that character in that position with the original pixel's color.

That's how the magic is done.
>>
>>58182078
In terms of actually useful functions, here's an example:

void printNums(int x) {
print x
if x =/= 0
printNums (x - 1)
}


This doesn't return anything, but it is recursive.
The important thing is that the parameters change.
If the parameters don't change, then the function will probably run forever.

And in many cases, changing the parameters means you need some way of creating a new parameter value out of the old one.

So that might be the reason why you thought they needed to be similar types.
>>
>>58182086
your image has 1229x1192
so you have to iterate through 1464968 pixels

isn't that slow?
>>
Very new to programming here, how long would it take to start developing apps for Android? I have made several programs with Arrays and Objects so I am very much a beginner to Java and programming in general.
>>
>>58182163
On a modern CPU? No.
On a modern GPU? Instantaneous
>>
>>58182170
Take Pascal, you'll get a working app in a week.
>>
File: Graph.jpg (47KB, 653x350px) Image search: [Google]
Graph.jpg
47KB, 653x350px
>>58182136
Yeah I get that
Maybe I should describe my problem more concretely
I want to replicate pic related, it obviously allows you to traverse a graph but I cant figure out how to tell the continuetraversal function what the lambda function is
The only solution that I think might work is to save the lambda function in a class wide variable and use it for continuetraversal
But that seems rather impure
>>
>>58182215
Is continueTraversal not going to call startTraversal?
It's in scope.
>>
>>58182215
The lambdas have nothing to do with the recursion here. The lambdas are continuations.
>>
>>58182228
I might but startTraversal requires a lambda function and I dont know how to tell continueTraversal which lambdafunction was used

>>58182232
The lambda function calls a functions which uses the aforementioned lambda function to again call itself and so on
Seems pretty recursiveish, but then again I dont know what you mean with continuation
>>
html sucks.
What is the best canvas/webgl gui library for making websites?
>>
>>58182282
Oh, I see what you want to do. Is this Java? It may be easier to use an anonymous class because then you have a named method that you can call recursively very easily. Java is really not equipped for stuff like higher order combinators.
>>
>>58182163

Actually, since I'm using fixed-width characters, I only iterate through (width/fontWidth) * (height/fontHeight) pixels in the source image.

Even iterating through all the pixels is pretty much instant.
>>
>>58181800
Did you just try to define a tranny? Haskell is based. C will get you into a trap.
>>
>>58182350
that's why Hime was casting the return value of malloc
>>
>>58182163
If the pixels are arranged in memory so they can be iterated through while making optimal use of the cache and prefetch, it will be very fast.
>>
>>58181824
This.
Calloc master race.
>>
>>58182337
Yes it is Java and the picture I showed you is something that actually exists in the form Ive described, so they mustve made it work somehow, maybe the dirty attribute version is actually the way to go
>>
>>58182347
>fontWidth
>fontHeight
what did you mean by this?
>>
>>58177424
>Pure functional that allows for direct memory management with guarantees
Is it ever possible?
Doesn't direct memory managment comply with purism?
What guarantees?
>>
Hi /g/

I was given the following task to make in SQL for CS
>The minimum salary of a teacher is determined in the following way:
>You start with a base salary of 2000€.
>The bonus for the courses is 100€ per course multiplied by 10% of the number of students per course
>The bonus of the assignments is 50€ per designed assignment.
>Each scale after scale 10, increases the salary by 500€.

where i already have the following code and the following constraints
CREATE TABLE teachers (
bsn BIGINT PRIMARY KEY,
first_name VARCHAR(15),
surname VARCHAR(35),
salary REAL,
scale INT,
CONSTRAINT salary CHECK(salary < (25 * scale) AND salary > (20 * scale)));

The rules of the school define the salary of the teacher cannot be less than 20 times the value of the scale and not more than 25 times the value of the scale.


I have no idea where to start on the assignment. Can someone help me?
>>
>>58182518
>SQL
>Programming
Captcha: STOP Nigger
>>
>>58182484
By guarantees I meant more like things that only use manual memory won't invoke GC, and if the whole program is manual memory then no GC

Memory management doesn't conflict with purity if you're building up a kind of AST or action, like with monads.
>>
>>58182484
>Is it ever possible?
ATS

>Doesn't direct memory managment comply with purism?
No, you just have to model it appropriately with types.

>What guarantees?
Whatever you want that can be modelled in the types, really.

>>58182556
Substructural types are a lot better for resource stuff.
>>
File: file.png (555KB, 960x615px) Image search: [Google]
file.png
555KB, 960x615px
I want to learn how to program but I suck at it.
All I can seem to do ever is just copy paste code from the internet and cry when it doesn't even work.

I tried to get into C and/or C++ but the fucking linking/including mechanism had me scratching my head and I don't know how to fucking use it and I gasp at how much fucking code I have to write to get even one fucking xwidgets or GTK+ or QT4 or FLTK window up and running.
Python fucking sucks because i have to press spacebar 4 fucking times each fucking time I want to do anything and it's not even a proper programming language.
Lua fucking sucks because you have to work from top to bottom and the syntax sucks and it isn't fucking usable by itself at all unless you use it implement in a C or C++ application.
PHP is fucking PHP.
Javascript is a meme.
I may be fucking retarded because I couldn't deal with config files on debian either because my firefox kept opening zip files with fucking wine or whatever so I just switched to fucking Xubuntu like some cheap Apple whore.


Where do i go from here?
>>
What's the best book to start with?
>>
>>58182613
>Python fucking sucks because i have to press spacebar 4 fucking times each fucking time I want to do anything and it's not even a proper programming language.
Lol u just need a IDE maybe
Also stop this everything is a meme shit, that only applies if u have some sort of knowledge
Just continue with Python or another babby language like Java or C#
>>
>>58182613
Learn Racket

>>58182654
How to Design Programs
>>
>>58182613

this is the problem with modern programming. Everyone gets butt hurt over what language to learn or use. Completely depends on what you wanna make. Stop being a faggot and letting memes control your life.
>>
>>58181808
I know. It's all consumerism here. Every thread with substance gets like 10 replies tops. But if you post something about dragon dildo's, OS bullshit, ricing desktops the thread will hit bump limit.
>>
>>58182613
>Python fucking sucks because i have to press spacebar 4 fucking times each fucking time I want to do anything and it's not even a proper programming language.
You're literally retarded.
>>
>>58182732
>press spacebar 4 fucking times

do you even tab, bro?
>>
>>58182732
>>58182752
>>58182613

it might be bait
>>
File: file.png (308KB, 336x425px) Image search: [Google]
file.png
308KB, 336x425px
>>58182680
I want to make a multiplatform GUI application that is able to run opengl without needing any other software besides the base operating system to run it.
>>58182665
>lisp
It looks too complicated for me.
>>58182664
python is only usable for small programs and doesn't scale up well, last I heard. Besides that it won't even run if you don't have python.
>>58182732
are you implying python is even a programming language?
>>
>>58182801
No, I'm stating that you're mentally challenged.
>>
>>58182786
Ok now I'm pretty sure youre right, but it was good so have a (You) >>58182801
>>
>>58181877
>Unfortunately averaging numbers isn't possible in C.
what
>>
>>58182801
>It looks too complicated for me.
Programming might not be for you.
>>
>>58181856
you got that off /pol/ suffice it to say she's unique features she doesn't have negroid features albeit she's like one of them really fucking desert niggers. i bet she's stupid as a seagull but i'd fuck her pulling on them pigtails making her say 'yes colonize me daddy, colonize me daddy, fucking genocide all the other desert niggers daddy i'm your fucking abd little naughty girl'.
>>
>>58182825
it's not bait, but >>58182820 is probably right.

is the best way to learn programming really with BASIC on a commodore pet?
>>
>>58182801
>multiplatform GUI
>complain about programming being retarded
If only you knew... Python is a great language so please stop bullying the snake. If you hate programming this much you should create your own CPU with a much simpler set of instructions and architecture.
>>
>>58182664
recommend a python IDE.
>>
what are some good java open source projects to look at, to improve your coding practices?
>>
>>58182998

PyCharm
or a plug-in for Eclipse or whatever you are using now
>>
>>58183004
You're not gonna learn anything in the echo chamber of shit that is Java. Look at good procedural or functional code and try to apply it.
>>
>>58182998
Pycharm
>>
>>58182998
emacs
>>
>>58183022
you OOP atheists are literally the fedora tippers of /g/

>>58183004
just google "open source java projects"
>>
>>58181779
Whats the book she is holding?
>>
>>58183142
SICP
>>
File: 1478317641386.jpg (290KB, 1280x720px) Image search: [Google]
1478317641386.jpg
290KB, 1280x720px
>>58183142
sicp scappers
>>
>>58182998
>Python
>IDE

Literally why?
That's like asking for a HTML IDE.
>>
File: 1478021956281.jpg (29KB, 640x360px) Image search: [Google]
1478021956281.jpg
29KB, 640x360px
>>58183145
>>58183211
ty lads
>>
>>58183227
>HTML IDE
http://brackets.io/
>>
>>58183236
i like this image
>>
File: pepensive.jpg (9KB, 224x225px) Image search: [Google]
pepensive.jpg
9KB, 224x225px
Ever notice that "IDE" is an anagram of "DIE"?
>>
>>58183326
Have you ever noticed that "frogposter' is an anagram of "Complete retard"?
>>
File: head.png (542KB, 800x800px) Image search: [Google]
head.png
542KB, 800x800px
Is this a good choice?
>>
>>58183345
>Java
Definitely not.
>>
>>58183345
no.
SICP only.
>>
File: 1480040389454.jpg (47KB, 645x968px) Image search: [Google]
1480040389454.jpg
47KB, 645x968px
>your brain on java
>>
File: file.png (112KB, 645x968px) Image search: [Google]
file.png
112KB, 645x968px
>>58183364
>your brain on perl
>>
>>58183347
Then what, C#?
>>
>>58183442
this is bait and you should feel bait
>>
>>58183442
Definitely not that either.
>>
>>58181779
This morning, I finished 2 new features for my Python Discord Bot.

I can now send messages to every server the bot is in (such as Merry Christmas or announcing New features)

I also updated my Renaming feature, so the bot can name people using Fancy Text (some Gothic font).
>>
>>58183452
Sorry I'm a little clueless here.
>>
>>58183473
If your selection of languages is between Java and C#, you damn sure are, faggot.
C/C++ if you want a real language.

You got a few categories here:
>Software/Games/Apps
C/C++, Rust, D
>Web
PHP, Perl, Ruby, Python, few others
>Scripts and Bots
PHP, Perl, Python, Ruby, Lua, Shell Scripting Languages

>And of course, your meme languages
Like Haskell (It's actually good if you know what to do with it, but fucking pointless for most people - its primary purpose is to do what other languages do in a much more difficult-to-read way)

>THESE, however, are the languages you DO NOT use, unless you're an idiot (or need it for work, omg)
Java, Visual BASIC/VBA

>These languages are jokes:
C# (better than Java, but still fuck it)
>>
>>58183455
>Python Discord Bot.
how does one make bots?

using the API of the website you making a bot of?
>>
>>58183571
>C/C++
Why the hell are you grouping two completely separate language together?
>>
>>58183571
Thank you for all of this but why all the hate for Java?
>>
>>58183623
>language
languages*
>>
>>58183629
I don't know. Why do we hate retards again?
>>
>>58183658
Isn't language retardation based on how you use it?
>>
>>58183683
>>58183629
Java encourages retardation.
Checked exceptions, forced OOP, ridiculous standard library, amongst other things.
>>
I know javascript and some python, but want to learn another language.

Suggestions? I was thinking either Go, C, Java, Clojure, or just more python.
>>
>>58183604
>how does one make bots?
You authorize the application:
https://discordapp.com/developers/docs/topics/oauth2
(make one, then auth it, then program it)

>using the API of the website you making a bot of?
You need to use one of the libraries.
They currently support
>various Node libraries
>a couple Java libraries
>PHP (terrible support, and LOTS of broken/poorly implemented features)
>Ruby
>Lua
>Rust
>D
>C#
>Python
and a couple others, I think.

Highly recommend Python. The library 'just werkz'. The documentation also doesn't suck ass

>>58183623
Because if you write C++ not in the Style of C, you're an idiot. But, if you give up classes simply because OO is EVILEVILEVIL, you're also an idiot.

Strictly-written C vs OOP-Clusterfuck C++ ARE, for all intents and purposes, 2 separate languages, but C++ should be used as an extension of C, and I consider it as such.

>>58183629
As referenced above, "OOP-Clusterfuck"
Java is NOTHING BUT an OOP-Clusterfuck.
It's a fucking disaster, and I hate writing code in it.

Literally NOTHING is NOT a class. Even main() is a class.
**The only things NOT a class are some primary data types, like int, char, and float, but some float and stuff fucks up if you don't wrap it in the BigDecimal wrapper class, and that's just one fun thing to hate about it.
When you're the only one in your DS&A class who actually learned the damn language, you realize it's a fucking nightmare, because you had to rewrite EVERYONE else's code. So you get good practice at hating it
>>
>>58183714
Racket
>>
>>58183623
I've seen this post before.
Please make unique posts.
>>
File: n.jpg (30KB, 350x350px) Image search: [Google]
n.jpg
30KB, 350x350px
>>58183683
>>
>>58183697
You can nitpick details from every language and call it retarded. Why is Java so popular then or is it the jews?
>>
>>58183789
Just because something is popular, it doesn't mean that it's good.
>Why is Java so popular
Marketing.
>>
>>58183789
Java is popular, because it can be easily transplanted between regular applications and Web.

And a lot of people learn it in Highschool or as one of the languages in college. Also, India.
There are plenty of websites slowly migrating away from Java, because it's also a security hole.

Java is basically popular, despite being retarded, because a very large portion of the people who use it are fucking retarded as far as programmers go.
>>
>>58183750
>C++ should be used as an extension of C, and I consider it as such.
The world does not think that way and doesn't care if you do, you should get out of your bubble.
>>
>>58183828
regardless, C is a subset of C++.

But, you're just playing word games now. You didn't even need to comment on that in the first place.

Whether you consider them as one language and an extension or one language and a subset, you can't deny that C is PART of C++

It can be run on its own, but it can also be run inside of any C++ application.

But, feel free to consider them 2 separate languages if you like. I just don't.
>>
>>58183828
C++ is perfect as it is as a warning about degeneracy.
>>
>>58183870
>C is a subset of C++
You are fucking retarded.
That is not true at all.
>>
File: 1476917022206.jpg (174KB, 1001x823px) Image search: [Google]
1476917022206.jpg
174KB, 1001x823px
>tfw after your first 2 languages, programming starts to make sense and every new language is easy to learn
>>
>>58183822
So it's C++ or GTFO?
>>
>>58183913
No.
C++ is fucking awful as well.
>>
File: 1473904892658.jpg (362KB, 1106x1012px) Image search: [Google]
1473904892658.jpg
362KB, 1106x1012px
>clang, gcc, or a meme compiler are the only options

Why doesn't somebody create a compiler that's understandable and can support everything from tiny 8-bit microcontrollers to the latest 64-bit CPUs.
>>
>>58183930
GCC supports a lot of shit, and there are lots of 3rd party ports to other obscure things.
>everything from tiny 8-bit microcontrollers to the latest 64-bit CPUs
Because there is no point.

Also, kill yourself, you retarded frogposter.
>>
>>58183893
#include <stdio.h>

int main(int argc, char** argv){
printf("Hello world!\n");
return 0;
}

That will run compiled either as C OR C++

#include <cstdlib>
#include <iostream>

int main(int argc, char** argv){
std::cout << "Hello world!" << std::endl;
return 0;
}

This will only work in C++.

C++ is an extension of the C Language. And it was always intended to be.
Stop being a faggit

>>58183913
Well, as you may have been reading, if you will do C++, write it as C. So, optimally, learn C and then add in necessary C++ features to improve your programs.

But do NOT overdo it. C is VERY good on its own
>>
>>58183970
t. brainlet nigger
>>
>>58183893
It's not 100% true but it's 99% true you piece of shit.
>>
>>58183998
char *pt = malloc(1024); // fuck you c++

Also _Generic, _Bool...
>>
>>58183894
>2 languages
What are they?
>>
Why do I have to do EOF twice to make this while loop stop?
std::string b;
while(std::getline(std::cin, b, ' ')) // Tokenizes string into words.
words.push_back(b);
>>
>>58184028
C and Erlang.
>>
>>58183998
That is a completely trivial program, you fucking idiot.
Why don't you try:
#include <stdlib.h>

int main()
{
int *ptr = malloc(sizeof *ptr);
}

int main()
{
int my_array[] = {
[3] = 10,
[1] = 7,
[0] = 12,
};
}

struct my_struct {
int a;
float b;
int c[5];
};

int main()
{
struct my_struct s = {
.a = 10,
.b = 1.0,
.c = { [2] = 15 },
};
}

And so on.
>>
>>58184053
Solid base.
>>
>>58183571
>D ahead of c#
>Rust ready for prime time
You're a meme of your former self
>>
File: browser #113.png (2MB, 1920x1080px) Image search: [Google]
browser #113.png
2MB, 1920x1080px
>that comfy feel when browsing on the tv from the couch and posting your botnet program again
>>
>>58184051
And to add to this if I type:
"hello hello "
I have to do EOF twice.

But if I do:
"hello hello\n"
I only have to type EOF once.
>>
>>58184148
>botnet program
do you even know what a botnet is?
>>
>>58184205
Sure, it's anything /g/ dislikes, right?
>>
Developing on windows feels so icky.
>>
For the guy who wanted to try out my voip protocol:
http://0x0.st/pKA.exe is a static linked, linux binary of it, to connect and join do
/mkreactor ws://crossbar.animebitch.es:8080/ws (username)
/joinchannel dpt
>>
File: png.png (14KB, 817x548px) Image search: [Google]
png.png
14KB, 817x548px
>>58184332
You should get:
>>
>>58183571
Where is Free Pascal / Delphi?
>>
>>58184472
Those are both garbage, and literally nobody uses them anymore.
>>
>>58184474
>FPC
>Garbage
Kek. kys, faggot
>>
Is GO a decent language if I want access to Google libraries, C-esque syntax, and just a decent general purpose language?
>>
>>58184527
It's a good language if you want to be useless
>>
>>58184579
What languages are good for being useful? Python?

Let's just say I like to develop general programs for testing a myraid of different ideas. New drawing algorithms, testing embedded systems, web and mobile work, et cetera?
>>
>>58184608
C#
>>
>>58184608
C. Don't listen to >>58184623 he's a certain tripfag shitposting undercover.
>>
>>58184644
It's true. I am.
>>
>>58184644
C might be good for the embedded systems, but really mobile and web?
>>
>>58184680
>mobile and web
You said you wanted to do something useful.
>>
>>58184692
But I want to write websites and have dynamic elements on them.

I just wish there was something that compiled to Javascript seamlessly while serving itself as a good scripting language by itself.

Like Swift syntax with all the goodies of Javascript.
>>
>>58184729
This is entirely possible in C. You might want to take a look at Emscripten.

https://github.com/kripken/emscripten
>>
>>58184729
The only thing Swift gives you is not having to type semicolons.
>>
>>58184729
There's loads of langugaes that compile to JS. But compile-to-JS langugaes are generally bad unless they are very close to JS already.

I recommend looking at CoffeeScript and/or TypeScript.
>>
>>58184729

First answer best answer >>58184623

The rest are meme spouting fedora-tier hipsters
>>
>>58184829
Coffeescript looks really nice.

>>58184789
Maybe that's why I like it. It just didn't plain hurt my eyes. I remember making an app back in college with Swift and I had fun. Like real, consistent fun where I'd go work with my friend every day.
>>
>>58184843
Thanks, Rahul!
1₹ has been deposited into your Microsoft® Account™.
>>
>>58184843
>The rest are meme spouting fedora-tier hipsters

>>58184868
>Thanks, Rahul!
>1₹ has been deposited into your Microsoft® Account™.

And... there ya go.
>>
I like Sublime but I hate how it spams me to buy its stupid shit every other time I save. Is there a good editor on Winblows for scripting?
>>
>>58184918
you can't spare $10 to pay someone for making a editor that you love and probably will spend hundreds of hours using?
>>
>>58184918
https://foicica.com/textadept/

Have you thought about buying it though?
>>
>>58184925
I can but I don't want to. That's $10 for drugs.
>>
>>58184925
don't buy anything
>>
>>58184925
Fuck off shill.
>>
File: 1461737108240.png (860KB, 841x720px) Image search: [Google]
1461737108240.png
860KB, 841x720px
>Proprietary text editors
>Proprietary programs at all
>>
File: ?.png (7KB, 120x120px) Image search: [Google]
?.png
7KB, 120x120px
Is there a non-free programming language?
>>
>>58185251
Java. Their API is copyrighted, apparently.
>>
>>58185251
Most languages were non-free until about 2005.
>>
>>58185251
MATLAB
>>
File: fag_buys_music.jpg (82KB, 599x600px) Image search: [Google]
fag_buys_music.jpg
82KB, 599x600px
>>58184918

Activate it, dummy!
http://appnee.com/sublime-text-3-universal-license-keys-collection-for-win-mac-linux/

>>58184925

Sublime is $70, Anon. Also:

>Paying for software
>>
>>58185251
Yes

>>58185261
Being copyrighted is not the same as being non-free. The GPL works because of copyright laws.
>>
File: 06771813.gif (171KB, 590x679px) Image search: [Google]
06771813.gif
171KB, 590x679px
>>58185228
>Using Atom
>>
>>58184918
----- BEGIN LICENSE -----
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
200C25BE DBBC4855 C4CFB774 C5EC138C
0FEC1CEF D9DCECEC D3A5DAD1 01316C36
------ END LICENSE ------
>>
>>58185274
Who the hell said I was using Atom?
>>
So it seems like there are plenty of resources on how to code, but I've never seen anything that shows me how to get the code I've made and create an application which can be clicked on and executed. Where do I learn said thing?
>>
>>58185251
Delphi.

>>58185261
OpenJDK is entirely free
>>
>>58185251
MATLAB
LabVIEW
Delphi
Anything .NET (C# and it's CLR is free, .NET isn't)
>>
>>58185317
Oh I'm sorry anon you use Vim.
>>
>>58184918
Notepad++
>>
ordered pro django from amazon, 2nd edition

going through pro python right now. learning and employing

type safety decorators was the last topic
>>
>>58185364
The entire .NET source code is online and .NET core is completely open source
>>
>>58182801
>python is only usable for small programs and doesn't scale up well, last I heard.

Python powers reddit, one of the largest websites on the internet.
>>
>>58185386
>pro python right now.

Python lives on land, because is above C level
>>
>>58185399
>The entire .NET source code is online and .NET core is completely open source
Open source != free

The reference implementation is free as in freedom (since 4.6), but the actual framework is proprietary.
>>
>>58185432
>>58185399
Oops, forgot the link

https://en.wikipedia.org/wiki/.NET_Framework#Licensing
>>
>>58185346
>OpenJDK
Oracle shit.

Stop defending a trash language.
>>
>>58185560
>defend
He didn't defend it, he just corrected anon. Jeez, lying about stuff you don't like is for liberal cucks.
>>
>>58185413
That explains so fucking much.
>>
>>58184073
because hes only ever written trivial programs.
>>
>>58185591
oh yeah?

what, fagboy?
>>
Oh hey, .NET Core got brought up!

.NET Core is not backwards compatible with .NET Framework applications. The standard libraries are... a little different in some areas. Enough so that you can't reference DLLs compiled in one using the other. I learned that one the hard way. So it's not right to say that .NET Core is .NET Framework. They're more like two separate .NETs. Although strictly speaking, .NET Core is the future of .NET, and not the current .NET Framework.

What is free is Mono, which contains the entirety of .NET Framework (or at all least the parts that matter), is under a free license, and which is developed by Xamarin (owned by Microsoft), Microsoft itself, and the overall open source community. Since Microsoft itself is contributing to it, .NET can be considered free in and of itself.
>>
>>58185897
in terms of programming languages, what are your guns of choice?
>>
>>58185966

Ruby for general purpose scripts.

C++ for anything that needs performance or needs to be done low level. If it's simple enough, I might use pure C.

I don't own any guns, but I'm thinking one of these days I want an MKA-1919, and a Colt M1911. One for in the home, the other for out of the home.
>>
>>58186067
>tfw you'll never be American
>>
>>58186082

>tfw I will always live in the land of the free
>as long as Trump doesn't kill us all
>>
File: 1482391221917.jpg (23KB, 260x258px) Image search: [Google]
1482391221917.jpg
23KB, 260x258px
>>58186120
>settling for the land of the free
>not living in the land of hope and glory
>not living in the mother of the free
>>
>>58185897
>Although strictly speaking, .NET Core is the future of .NET
[citation needed]
>>
>>58186120
>land of the free
also land of the plenty

goddamn you faggots are well paid over there
>>
>>58186218
land of money and greed
they need to exploit each other to pay for the higher costs caused by being exploited
>>
>>58186170

The fact that Microsoft is throwing their full weight behind .NET Core, and is creating a .NET Standard Library to unify .NET Core with Xamarin and .NET Framework, should at the very least suggest that it's not going to be the retarded cousin of .NET. And if .NET Core is going to have at least as much support as other variations of .NET, which do you think should be the choice of industry to throw their weight behind? The one they're free to fuck with thanks to the MIT license, or the one that's proprietary, but has the same amount of Microsoft support?
>>
File: 1480872086252.gif (4MB, 200x360px) Image search: [Google]
1480872086252.gif
4MB, 200x360px
Is the KISS concept a meme?
I seem to have a problem with over-complicating simple tasks then feeling like a jackass when I realize my mistake.
How can I correct this bad habit. Is my brain fucked?
A-Am I autistic?
>>
>>58186067
Can u give me a specific of something that is too complcated for C?
i just use it for everything.
>>
>>58186337

I wouldn't say there's a such thing as too complicated for C, per se. It's just that C++ is a more useful language in general, at least in my opinion. For me, a reason to drop from C++ to C is where the problem is simple enough that no significant abstractions from C++ would be useful for the problem.
>>
>>58186311
Don't try to solve the world's problems when programming.
Some people seem to think they need to write general solutions that work in any situation and that everybody else is going to use it.
Just solve the problem at hand.

Only try to generalise things when you're writing a library where it really should be generalised.
>>
>>58186407
Can u give me a specific example of a situation where the abstractions in C++ are useful to the problem?
>>
>>58186407
You really do have colossally shit taste.
>>
>>58186425
When you're trying to win the "World's most ugly program" competition, C++ is a good bet.
>>
>>58186256
that's actually a bullshit stereotype, california is socialist as fuck while programmers earn a ton
>>
>>58186425

Well, I find objects with virtual methods make managing game states to be an easier task. I also find most programs to be easier when I don't have to implement my own vector or string type.

>>58186427

I genuinely don't care what you or anyone thinks of my tastes. Most of the world likes Python while I like Ruby. Most Ruby programmers like web development, while I don't. We're allowed to have different opinions.

>>58186432

IOCCC takes the cake on that, Anon.
>>
>>58186532
>IOCCC takes the cake on that, Anon.
Intentionally obfuscated programs are works of art.
Typical C++ is just fucking hideous.
>>
>>58186432
Try Perl5
>>
>>58186450
>implying socialism is somehow not exploitative by definition
>implying this is even possible in a place which is "socialist as fuck"
get this leftist bullshit out of my thread.
>>
>>58186563
https://www.willamette.edu/~fruehr/haskell/evolution.html
>>
>>58186604
>programmer """humor"""
>>
>being a leftist in 2016
>>
>>58186532
>virtual methods
I hate coming up with unique names for unique functions.
>vector or string type
These are arrays of floats/chars, no special types, no special casts or structs.
u sould like u dont really understand the benifits of c++ over c.
>>
>>58186779
>u
Why do you type like a retard?
>>
>>58186788
The way i type doesnt matter to me that much.
Its more about logic, reasoning, and truth.
The guy i responded too uses false claims of importance to confuse himself, now hes trying to confuse us!
>>
If you write C/C++ and you don't check for leaks/memory errors using valgrind or a similar tool, you are a bad person.
>>
>>58186779
what if the methods aren't unique (think: inheritance)?

how do you simply replace a character in the middle of a c string? how about a character where you don't know the index ahead of time? what if you're dealing with utf-8? or ucs16?
>>
>>58186805
Typing like a literal 5 year old undermines any point you have, and just makes you seem fucking stupid.
Also, it's expected of you to have correct spelling and grammar here. We have to maintain some semblance of quality.
>>
>>58186805
>logic, reasoning, and truth
fedora
>>
>>58186768
i hope you realize that all socialism is by definition leftism
>>
>>58186834
Obsessing over how people speak over what they say? That is immature.
>>58186819
If they have different parameters they are unique.
Im not going to explain how to replace/parse an array.
>>
>>58186863
>Types like a child
>I'M A SPECIAL SNOWFLAKE I DON'T HAVE TO FOLLOW COMMUNITY RULES AND YOU HAVE TO LISTEN TO MEEEEE!!!
>Calling someone else immature
>>
>>58186813
My brograms never leak, fag.
>>
>>58186879
>COMMUNITY
fuck off, commie shitstain
>>
>>58186886
>calling free at the end of your program
S
L
O
W
>>
>>58186863
virtual function have nothing to do with adhoc polymorphism.

why not? can you not do it? std::string and std::vector have methods built in, that are quite performant, that can do this. I'm putting the burden of proof onto you to explain why C++ is worse than C by extending your examples into simple real world scenarios.

>u sould like u dont really understand the benifits of c++ over c.
>>
>>58186886
So it's just your asshole then, good to know.
>>
>>58186563

If you're in a competition to make the most ugly program, the result will be considered a work of art, Anon.

>>58186779

>I hate coming up with unique names for unique functions.
You are thinking of function overloading, and the problem is not quite that. Game states are different data structures, and so an update function for them must have a different function signature for each structure. I would like to update the current game state without spending any time checking what state I am in. In theory, I could use a function pointer, but that would be gross. I'd also need to be using a void pointer argument for the state (or a global), but that would be gross. Enter the virtual method. Under the hood, it's a function pointer to a function that knows the type of data it is operating on anyways.

It's a simple example of C++'s usefulness, but an example nonetheless.

>These are arrays of floats/chars, no special types, no special casts or structs.
std::vector and std::basic_string are slightly more than arrays, which are by definition static in nature. They are resize-able data structures, and so under the hood would likely look like:

struct vector {
int *data;
size_t length;
size_t capacity;
};


If the length is less than the capacity, you can append elements in O(1) time. Otherwise, it takes O(n) time to reallocate data. But this only happens O(log(n)) times. This isn't hard to write in C, but it is annoying to have to write over and over again any time you need it for a different data type. Oh hey, that's what templates were designed for, and what the Standard Template Library was designed for. Thanks C++!
>>
>>58186910
That's the job of the OS, though you might wanna free some sensible resources.
>>58186926
Wow, rude.
>>
>>58186813
>valgrind
>We do not distribute binaries

into_the_trash_it_goes.tar.bz2
>>
File: 1466488521628.gif (461KB, 640x480px) Image search: [Google]
1466488521628.gif
461KB, 640x480px
>>58186953
>That's the job of the OS
so your programs do leak
>>
>>58186964
>using a binary distro
into_the_trash_you_go.c
>>
>>58186813

If you are using C++, RAII should handle most of this unless you explicitly use operator new yourself, or you are using cyclical data structures.

>>58186964

sudo apt-get install valgrind
>>
>>58186993
Letting the OS clean up resources at exit is not leaking unless something really isn't cleaned up.
>>
>>58187013
>apt-get
>>
File: 24231.jpg (54KB, 500x500px) Image search: [Google]
24231.jpg
54KB, 500x500px
>>58187015
>Letting the OS clean up resources at exit is not leaking
it's ok if your programs still wet the OS anon :^)
>>
>>58186993
idk about my programs but something from under me is definitely leaking right now
>>
Where can I get a quick and dirty intro to git
>>
>>58186910
Fork it and do the cleanup there so the terminal can instantly be used.
>>
>>58186918
Your asking me to prove a point i didnt make. (c++ worse than c) Stop getting all excited an puting words in my mouth,
So what do u want from me?
an example of how i can build in
functions?

>>58186942
You seem to have this thought that because you dont write the line that checks what kind of data its operating on.
That extra check is skipped over, and therefore ur function is more efficient.
But behind the scenes OOP computer keeps track of every object type. (additional overhead)
So u may think ur virtual methods skip the check. But they just check behind the scenes.

And ur vector example, ofcouse i keep track of length and capacity myself. I do this for EVERY array (except for tight packed null term strings).
Your just telling me how u abstract simple data types.
>Thanks C++
Implying c++ invented dynamic lists?
>>
>>58186964
why not just install it from your distros package manager?

also, its not hard to build: simply configure make, make check and make install like any other autoshit build

>>58187046
https://git-scm.com/book/en/v2
chapter 2. then the rest for when you fuck something up
>>
>>58187072
>Implying c++ invented dynamic lists?
lel
>>
>>58187075
Awesome, I tried pic related, but it got pretty heavy on the internals of git
>>
Are unconditional indirect branches really any more expensive than conditional direct branches? Both can be predicted, no?

It should come down to whether you want an open/closed system.
>>
>>58187035

The OS will toss your application's pages in the garbage whether or not you free things at the end. Memory allocated in main doesn't really need to be freed. Memory allocated anywhere else does.

>>58187072

>But behind the scenes OOP computer keeps track of every object type. (additional overhead)
>So u may think ur virtual methods skip the check. But they just check behind the scenes.
Computer keeps track only of objects that use virtual methods. Those that don't are just structs with compile time protections against certain unauthorized access. Those that do use virtual methods don't check what type it is. Rather, pointers to virtual methods are stored in a virtual method table. There's one extra dereference, but that's it. You could argue that there's a memory overhead, but it's not that large unless you make a lot of instances of the object, and make it use a lot of virtual methods. But that would be dumb.

>Implying c++ invented dynamic lists?
No, I'm saying C++ gives access to templates, which blow C macros out of the water, and allow me to not have to implement vectors of every type I need myself. Of course you can write it in C yourself. It's just that it's more work.
>>
>>58187231
>Memory allocated anywhere else does.
why does it matter where the memory was allocated?
>>
Why would my SharedPreferences not be saving in an Android app?
>>
>>58187149

1. There is no prediction necessary in an unconditional branch. Not that it matters, because branch mis-prediction isn't particularly expensive.
2. It's not so much about cost as it is about code overhead, and how to best design a program with an indeterminate number of types of possibles states. I just see virtual methods as an easy, but nonetheless efficient solution to the problem.

>>58187255

Memory allocated outside of main, when not freed, remains allocated and unusable for the duration of the program. Within main, it is at least reachable somewhere within the call stack at all times.
>>
>>58187149
Enterily too context dependent too make any general evaluation of them.
Depends on how often the branch target changes and in what kind of patterns, what the code before and after is doing, what the dependency chain from data before and into the branch target looks like, how likely the indirect branching variable is to be in cache, and lots of other factors probably.
>>
>>58187303
>unusable for the duration of the program
gotcha, i thought for a second you were saying that memory allocated outside of main wouldn't be freed at exit :O)
>>
>>58182836
>you got that off /pol/

Do you not recognize that I'm the guy posting negresses ON /pol/?

>>58182414

It's the width/height of a single character at N px, my man.
>>
>>58187420

Sorry, not N px, not N pt, the width/height I'm talking about converts that into real pixels.
>>
Why do I get a System.IO.IOException {"Cannot create a file when that file already exists.\r\n"} when there are no files in there named episode something?

foreach (string fileName in dirs)
{
int fileNumber = 1;
File.Move(@fileName, animeFolderPath + "Episode " + fileNumber.ToString());
}
>>
>>58181808
this

i only came here because i saw this vid i could use to make a shitpost about
>muh anime

https://www.youtube.com/watch?v=4nXUOixv3hc
>>
>>58187595
read through the logic in your loop
whats not changing?
(hint, filename1.txt is the same as filename1.txt is the same as filename1.txt)
>>
>>58187667
Congrats dude
>>
>>58187696
thanks anon
>>
what directory do i have to be in to make a .c file in Vim and then how do i compile it? i have gcc. First time using linux don't judge
>>
>>58187722
Any directory works senpai, but you should probably make a separate one for programming
>>
>>58187722
and if you have make installed, its defaults can be good enough so doing :make in the buffer will work for somewhat simple projects
>>
>>58183571
>its primary purpose is to do what other languages do in a not Algol-like way
FTFY
>>
>>58187388

Well technically ALL memory is freed at exit. The problem is that the time of exit might be days from now.
>>
I have this C++ code,
printf("Block Start End: %i\n", b->end);


and I get this earning when I compile it.
warning: format '%i' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]


What am I supposed to use instead of "%i"?
>>
>>58188106
%ld
>>
>>58188001

Design your program such that it only needs to be run for a short period of time and then go wild with allocations!
>>
>>58188217

Nah. Reminds me of the time when I had to force Java to garbage collect because I allocated 3 GB of memory in one function call, and it ran out of memory after said function call.
>>
>>58188134
That works, thanks.
>>
>>58188217
well, this has actually been my typical use case with C since i've really only been using it for project euler problems
i have written large, long-running programs in java
>>
File: 2646840-rw.jpg (42KB, 480x480px) Image search: [Google]
2646840-rw.jpg
42KB, 480x480px
>>58181779
it rly triggers my autism every time someone modifies or rotates this pic
>>
about to design a library in C++ for reading from a file and rendering a 2d image from it (think psd or svg) what are some well-designed libraries out there to reference from? Id like the user(the one using my library) to be able to configure certain things like simd speeups and threading and such. Should I use templates or preprocessor defines?
>>
>>58188457
Do u trust out opinion?
Try them both and see what works better/ is faster.
>>
>>58188467
but i trust /g/...
>>
File: 1468745563225.jpg (31KB, 389x550px) Image search: [Google]
1468745563225.jpg
31KB, 389x550px
>>58181779
Word fucks up my CV by opening in the "Protected View" mode.
d-doshio?
>>
>>58188268
>I allocated 3 GB of memory in one function call

Doing what?
>>
>>58188570
ur mum
>>
>>58188573
>tfw Ruby-senpai tried to GC GTP's mom because Java won't collect it.
>>
>>58188570

Training a neural network. Specifically, that was the amount of memory used just reading in a bunch of data from CSVs. After running the garbage collector, it went down to about half a gigabyte. So Apache CSV reader was eating about 2.5 GB

>>58188509

Do your CV in LaTeX. It's what I did.
>>
>>58188642
But that will produce a .pdf isn't? A friendo did his cv in LaTeX and told me companies didn't like to receive it in .pdf formal so he changed it back to a word (.docx) file.
>>
>>58187264
      // We need an Editor object to make preference changes.
// All objects are from android.context.Context
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("silentMode", mSilentMode);

// Commit the edits!
editor.commit();
>>
>>58188679
i figured it out thanks tho

i was confusing "id" with "key" in my XML file
>>
How do I stop being lazy and actually program something? I am still a beginner, and I love the "theory" on programming. I love how everything is logical, and how everything is put together. But, man, am I lazy to type all that out. Would a good text editor help me with with this problem? I reckon I won't git gud at programming unless I start typing. Thanks in advance.
>>
>>58188674

It does produce a .pdf, although I think it is possible to output to some other formats. It's a fairly well-accepted format though. Some companies are retarded, but most aren't, and will accept it. When I put in my application for a PhD, they said I could use .pdf, .docx, or paste it in as plaintext with no formatting.

And speaking of, I need to get around to doing more PhD applications. Not sure if I should ask my professors to do another letter of rec, or ask different professors this time around.
>>
I was helping my gf learn programming. I made a visualization where a person would walk over to 1 of 2 buckets one contains letter a tiles the other letter b's. the person would then walk back to a separate location and lay them out. The person couldn't carry both a's and b's at the same time. The pattern of the tiles was abaabaaabaaaabaaaaa.... eventually I guided her to understanding that a loop was needed for each time the person walked to the 2 separate buckets, then had to explain for the purposes of understanding that it was an infinite loop. She gets mixed up in syntax too early because of horrible college professors who can't teach. Eventually we talked about why an infinite loop wouldn't work because the person would have to get a basket, then a wheel barrow then a dump truck, and so on to carry the letter a tiles, and how a computer was attempting to do the same thing with it's resources. It made me remember my deliriously existential life experiences.
>>
File: TooManyFemaleProgrammers.jpg (28KB, 383x345px) Image search: [Google]
TooManyFemaleProgrammers.jpg
28KB, 383x345px
>>58188940
>>
I make github
https://github.com/baklava151
>>
>>58188642
>Specifically, that was the amount of memory used just reading in a bunch of data from CSVs.

Oh, right. I remember you talking about this before, when I noted I had similar issues with large CSV files.
>>
>>58189021

Run that shit through an autoformatter, senpai.
>>
Redpill me on the reason people on this board are so enthusiastic for Linux. They're all just pretentious and wannabees, right?
>>
>>58189071

you dont learn shit about computers when you let Windows hold your hand for everything.
>>
>>58189066
oh fug
>>
>>58189066
>>58189136
Fixed it senpai, now you can gaze upon my D
>>
>>58189213

Will look at it tomorrow. As a note, since you're using D, you could have written your VM less like C.
>>
>>58189002
Woah Jessie really made me think there
>>
>>58189071
they're fedora tippers who think using linux gives them geek cred
>>
Try my firefox plugin /dpt/.
It changes is.4chan to i.4cdn since is.4chan loads so slow.
https://my.mixtape.moe/rgdqrn.xpi
>>
>>58189329
Probably because I originally started it in C. I'll have to see about changing all the pointers to ref tomorrow
>>
>>58189395
(((dubious)))
>>
>>58189395
>It changes is.4chan to i.4cdn since is.4chan loads so slow.
interesting, hadn't noticed the different urls, yeah is.4chan can be insufferably slow sometimes
>>
It was signed by big bro Mozilla how could it be bad.
>>
>>58189456
var fourchImgFix_nodes = document.getElementsByClassName("fileThumb");
var fourchImgFix_i;
for (fourchImgFix_i = 0; fourchImgFix_i < fourchImgFix_nodes.length; fourchImgFix_i++) {
fourchImgFix_nodes[fourchImgFix_i].href = fourchImgFix_nodes[fourchImgFix_i].href.replace("is.4chan", "i.4cdn");
}


xpi is just a zip archive, got it and looked at what it does. thats pretty much the meat of it. the rest is required to turn it into an addon (a manifest, an icon, etc)
>>
>>58189501
In a real/more complex addon should variables be hidden within a scope or something?
How do you avoid name collision? Just use unique prefixes?
>>
>>58181912
>>58182831
Let's not go there again...
The whole thread may be consumed by that question...again...
>>
>>58189122
I'm learning to program by building things with the help of Google. What's wrong with this? How old are you btw? You have the reasoning of a teenager.
>>
>>58189529
modules: with amd.js/require.js/whatever you use for modules (or es6), it'll let you "export" and "require" symbols (functions). so you can create file-level (module-level) scopes and dependency trees.

inside each one, you can encapsulate data into prototypes or classes or objects (i.e maps) or whatever. an old common technique was to wrap things in anonymous functions (lambdas) like:
(function() {
// code here
var a = 42;
})()
// a not visible here

but variable hoisting is still a thing.. and too complex to explain at this time in the night

(I'm not the addon author)
>>
>>58189071
>They're all just pretentious and wannabees
Yes, if that's what makes you sleep at night
>>
>>58189608
Would Firefox do something like this behind the scenes when it loads in the script of an addon?
Or could the addon variables overwrite other variables from the page or other addons?

Why did lambda go out of style?
>>
>>58182397
slow
>>
>>58189661
firefox sandboxes the addons (jetpack or whatever they are calling it this month. the name changes too often. jetpack addons are the ones that don't need a restart to be installed) so they can't mess with other running javascript, they can communicate but thats about it. they just get dom access and their own little sandbox to play around in. its basically chrome's addon model but slightly different.

as for stopping the clashing between your own javascript names, thats up to you but AMD.js is pretty standard and I'm pretty sure its include into the addon SDK, and probably into the browser now. so you can just create modules like someone would in node (where the inspiration came from) or any sufficiently modern webdev project

as for the lambda style: its still sort of used, but modules give you structured programming and let you create dependency graphs and choose when specific javascript files are loaded and when. example: you could have a module for mobile that loads when the comment section loads but include something different for desktop.

also it allows encapsulation and much easier-to-do unit testing. javascript is finally moving out of the 90s in terms of development models.
>>
>>58184918
its a one byte patch if you know how to use a debugger and hex editor
>>
>>58187056
forked programs have different address space
>>58186910
this
>>
>>58186910
Why is this slow?
>>
>>58189796
I assume they are suggesting it adds precious time to the time command. or whatever
>>
>>58189796
why move brk when you can just yank the whole thing out of memory and call it good
>>
>>58189796
it's doing useless work when the program is exiting anyway
>>
>>58189818
>>58189838
Oh I see.
>>
>>58189529
>>58189608
afaik the let keywork handles this in ES6
let a = 4;
{ //not sure if you can just place a block like this, but fuck it let's make like C
let a = 3;
}

assert(a == 4);

i've never used it or read the full documentation on it so i cannot verify this, but it's definitely worth looking into
>>
New thread:

>>58190194
>>58190194
>>58190194
>>
>>58186768
There's always something at the left of you.
Thread posts: 324
Thread images: 36


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.