let test = new Test(); test.SomeEvent = (data) => { alert(data); };
es6 classes only seems to have getter properties or functions?
Anthony Butler
Same way you do in TS, but without the type annotations. class Test { constructor() { setTimeout(() => this.SomeEvent('event!'), 1000); } }
let test = new Test(); test.SomeEvent = data => alert(data);
Liam Thomas
okay I see, thanks. feels kind of weird using/setting a property without defining it first.
James Moore
Class is a lie in js! Learn classless oop!
Ayden Ward
Is there a web-centric programming language other than PHP?
meaning the language was built from the ground up for web.
Tyler Lopez
I got drunk and learned grunt last night. I don't really remember much of it, but now I have a project set up with live reload, a few other neat plugins, and detailed notes full of wildly inappropriate metaphors.
Drunk me is an okay guy.
Henry White
JavaScript
Jace Perry
It can't do back-end stuff out of the box though.
Samuel Edwards
NodeJS, senpai
Elijah Butler
that's not out of the box
Levi Sanchez
>Current roman year >single-threaded
Christian Wright
It literally is though.
Caleb Fisher
function obj(){ }
var copy = [];
for( i=0; i < 5; i++ ){ var copy[i] = new obj(); }
Why can't I create objects in a loop and then access them by copy[i]?
David Powell
Thoughts on CodeKit?
Cooper Thomas
because obj is a function and not an object? o.O
Adrian Jones
In all honesty, use TS, whenever you can. Some of the shit from earlier versions is stupid and redundant, but once they decided to become a superset of ES6/7, it became the best way to date of writing maintainable and robust JS code.
Julian Kelly
you calling the function within itself?
Brayden Garcia
It's just syntactic sugar. Do you enjoy writing Foo.prototype.bar = () => ... all the time?
Tyler Edwards
Obj() is an object constructor with several values. I want to create five different objects in a loop so as to get copy1, copy2, copy3, etc.
Jeremiah Richardson
Why is doctrine the most awesome bloatware ever made?
Henry Hughes
Let me rephrase, a language that's built from the ground up to handle the fornt and back end without the need for any add-ons or modification.
whilst node.js is out of the box, because it is based on js, the back-end leaves something to be desired.
Caleb Collins
k
Parker Lopez
How do you like Symfony so far?
Michael Cox
Never used it. Looks like a nice way to get off the ground quickly without having to learn a bunch of boring setup stuff though.
Connor Ramirez
I haven't done much until now, but since 90% of web jobs in Switzerland require symfony I decided to give it a go.
It's very clean, logic, and nice to use. I did the error of using the latest stable instead of the lts, so many components don't work yet if I don't use their unstable branches. For example, I can't make the SonataAdminBundle work.
so far so good, actually. Coming from Java btw, haven't done much web development n my life.
Josiah Jenkins
Sup nerds
I like CoffeeCup, but I'm poor. I want something similiar to it but 100% free as in gratis. Care to reccommend?
Pic unrelated
Brandon Turner
Is there a nodemon equivalent for Python?
Dylan Wood
I actually went from grunt to gulp to codekit. I've worked on relatively small projects lately and hated having 20+ node_modules folders.
Thomas Barnes
Re-declare the "copy" variable in a different way? I'm way too sleepy to know what language syntax that is, but usually it needs to be able to accept arrays.
James Howard
Oh fuck nevermind, didn't know nodemon works for both Python and Node. Was pleasantly surprised.
Landon Roberts
function obj(){ }
var copy = [];
for(var i=0; i < 5; i++ ){ copy.push(new obj()); }
Ayden White
So, is codekit faster to use than a gulpfile.js? Is it worth the 32 bucks? Is it as annoying as the webpage?
Jayden Wright
DQL is so fucking awesome
Lucas Nelson
>fapping with other men
Jacob Cruz
I haven't noticed any big drawbacks in performance. If by speed you mean setting up your project and actually start coding, then it is much faster. There is a new and less annoying version coming soon I think.
Evan King
Well in the time you answered I downloaded it and found it's a really nice program. I can do the same stuff I do with gulp or grunt but also have a nice livereload and an url I can look in the mobile device. So thanks for the tip! Maybe for more complex stuff gulp is still necessary but my workflow is really simple atm.
Michael Ramirez
Why the fuck is Node such a pain in the ass.
I've got this in my scripts in package.json: "build": "node ./node_modules/browserify/bin/cmd.js -t [ babelify ] src/app.js -o build/app.js",
When I run "npm build", it results in empty build/app.js file, but when I run that line manually from the command line, it outputs the correct code in app.js, what gives?
Kayden Wilson
>Take a look at PHP RFCs for the first time >Callable Typehinting, Pipe operator, named arguments, typed properties, traits implementing interfaces, nullables, reflectable attributes, generics, short lambda syntax... >Holy shit, if those got implemented, the language would actually be pretty sweet! >Eventually find out that those are basically all just bad copies from hack, which already has all of those >Also find out that those require a 2/3+1 majority by the morons who call themselves "PHP Core dev" to be accepted >Those morons already declined some, like short lambdas and C# style properties because it "could be confusing (To PHP developers) >Those RFCs being implemented: Never ever
You know, I'm actually thinking about giving hack a try. It has the features I want, the performance I want and you don't have to wait for it to recompile after every change, like Java. Unlike PHP's devs, Facebook's dev team actually seems to know what makes a good language. Does it already have proper IDEs, frameworks and community support?
Oliver Hill
You could make copy an object instead of an array. If you want to use an array, you will need to call push instead of setting the index.
Austin Gray
What is this SonataAdminBundle good for? I have used Symfony for almost a Year now, but I never used that.
Blake James
it's a pre-made admin backend for basic CRUD stuff. It's great.
Aaron Williams
But what does it do? Automatically create list / details / edit / delete views for all your entities? That would indeed be quite cool.
I just launched a demo container on their site. Do they also allow clients to create their own pages by just clicking them together? Because that is EXACTLY what I need for an application that I'm currently working on. That is, if you can still give some specific rules for this websites and the forms it contains, if those forms are very specific and complex (you never know how bad form handling can get until you need to handle user-generated fields of any type, seriously).
Joseph Turner
>>Those morons already declined some, like short lambdas and C# style properties because it "could be confusing (To PHP developers)
Well they probably aren't wrong....
Juan James
>But what does it do? Automatically create list / details / edit / delete views for all your entities? That would indeed be quite cool. exactly this. And it's very customizable. Still, it has every needed default convention for most use cases.
Samuel Rogers
I know. I mean, just look at PHP developers, holy shit. They actually think that their barebones OOP that is just a terrible clone of Java's is "complex" and "fleshed out".
Thomas Wilson
>Why the fuck is Node such a pain in the ass Flask is comfy as fuck brah, switch to Python.
Evan Anderson
I see. That's pretty cool then. Would save me a lot of time making those over and over again. Symfony's generatorBundle does a poor job once your entities get at least a tiny bit complex.
How well does this admin bundle handle entities that are "children" of other entities? For example, in my application, nearly all entities relate to one parent entity, which appears in the URL basically all the time. So for example, whenever I need to generate a URL to it, I don't just say generate('cockshit' ['id' => $id]); but generate('cockshit' ['parentIdentifier' => $parent->getIdentifier(), 'id' => $id]);
Symfony and its generators by itself don't handle this that well.
Bentley Baker
Oh, I'm using Flask extensively because I do backend stuff (although I'm not that much into web development) but I'm working on an "application" based on Electron that's from webdev standpoint could be called purely front-end, that's why I'm using node for development (so I can manage dependencies and build it for the "browser"). Still it's weird that the command fails through package.json script (with no error in stdout/stderr) but works fine when I execute it manually.
Grayson Wilson
>It came out of an April Fool's joke but proved popular enough to make into a serious application in its own right
Jesus Christ, PHP is literally so awful that people have made april fools jokes that are better at handling web requests.
Nolan Sullivan
So I learned Laravel pretty good, but then discovered that there are literally no jobs, so now I'm learning rails. They're pretty similar so I'm thinking I should be able to pick it up quickly and hopefully get a job within the month.
Brandon Rivera
Requesting sauce on the "better at handling web requests" part
Caleb Scott
I figured it out, apparently I need to use "npm run build" instead of "npm build", which is weird because "npm start" executes the script for "start", but "npm build" won't execute the build script, whatever.
Noah Ortiz
>all that convoluted and bloated code to scrape porn websites
lmfao.
Josiah Reed
This. Just fucking write a single file Perl script in half an hour
Lincoln Hill
My boss is an idiot and got his password to one of our shitty WordPress marketing sites phished or stolen. He made me log all log in attempts failed or otherwise and this is what I threw together. I almost never do anything flat file related with PHP so I just wanna make sure this isn't too shitty. Opinions?
function log_login($user, $username, $password) { global $logpath;
Without a thick fat layer of abstraction like Symfony with Doctrine DBAL & ORM, this language can't do anything except creating serious vulnerabilities for your server, your company and your customers.
Gabriel Robinson
I'm glad I took the time to learn a little more about SQL than SELECT * FROM whatever -> filter everything client side. Our biggest application's code base has all raw SQL and one of our interview questions is asking what some of the more simple queries do. Almost everyone gets thrown off the second they see PDO and don't even bother to look at the actual query. Everyone else gets stuck on JOINs and sub queries. I'm going to have this job forever because literally all PHP devs are idiots
Easton Russell
Yeah, me too. I didn't actually mean to insult you (even though I did, sorry for that), I just have terrible experience with fellow PHP developers and PHP as a language.
SQL injections are a serious issue. Why? Because they are so hard to avoid? No. It's because PHP developers are fucking retards who simply have no idea WHATSOEVER. If you ever do string concatenation in a query and your alarm bells don't ring, then please quit your job, damn it...
Most people don't understand how easily injections are prevented via prepared statements. My boss doesn't believe me. He wants me to use a web application firewall for all my software because he believes that SQL injections could happen. How? I never do fucking string concatenation in my queries. I also use a templating language that auto-escapes every variable (which basically every proper templating language [Thus, not PHP] does by default) and explicitly requires me to say "Yes, please, please give me the raw output from this variable" if I'm 100% sure that is clean.
Literally everything and everyone close to PHP is retarded. Those that are not are trying to get away from it.
Gabriel Hall
>Wordpress
I'm so sorry user
Lucas Campbell
>tfw Django job lads this is the most fun I've had programming in 2 decades
Nolan Scott
I'm not a developer (but I am a information security guy)
every joe knows to do paremeritized queries in SQL, in every language, PHP especially
Asher Butler
where do I start learning django provided I have almost no experience with python?
Daniel King
what programming experience do you have? In any case, you'll be learning both at the same time, but it's very batteries-included so it won't be too tough to get things together
Noah Reed
just basic python & php
Anthony Scott
Yeah we still have a bunch of things left over from when our old "CTO" was still bossing me around. I want to transition all of our marketing shit to one of those static site generators, but I'm not sure how I'd implement some of our SEO tricks that do too much good to be lost in the transition. Its not that bad though. I had to go through hell last year replacing a bunch of shitty Pajeet tier plugins and themes with my own shit and since then its been pretty smooth. Every once in a while I need to actually write something new, and end up holding myself back from punching my monitor since WordPress's developer documentation is pure shit. Anything and everything you're looking for is a major version or two out of date or simply missing altogether
Jason Lopez
you're set. Start with the tutorials and make a blog using generic views
Isaiah Moore
is there any particular tutorial you would recommend? what worries me the most is my code is usually pretty disgusting looking I'd like to learn how to make it nice and clean along the way instead of just mashing shit together
Christian Evans
I'm not a PHP developer primarily and I'm not the guy who posted that porn site scraper so don't worry about it. I work with Perl primarily because I'm a rare breed of autist. I just happen to be better at PHP than everyone else we've interviewed, so I'm stuck maintaining our old PHP shit
Brandon Diaz
What wonderful planet do you live on and how do I get there?
Ethan Reyes
SEO is just literally reading google and bing and modifying your tags to have the proper data. And sitemaps.
And dude, all the competent new publications ar eswitching to build-based and static content now. It significantly lowers the cost of upkeep (db and app server gone ; only web server needed).
Samuel Evans
The official ones, and as long as your code is readable and makes sense, you shouldn't worry. Try not to abuse clever tricks (note that map, reduce, filter are important tricks) and it'll flow smoothly
Wyatt Turner
Canada
Bentley Kelly
Its not really up to me what we do SEO wise. My adderall addicted boss is a self proclaimed SEO "ninja" and while he lets me do whatever the fuck I want otherwise, anything marketing related has to be approved by him first. So I'm stuck spinning content and targeting location based results
Kayden Lopez
I'm sorry...
you couldn't pay me to work with PHP
Ruby maybe,
PHP is just pajeet tier
Evan Wood
Everything is pajeet tier to you morons.
Ayden Powell
Say what you want, but Pajeet still has a very clear definition. Sure, maybe it'll join the ranks of autism one day but for now its still a very targeted insult
Christopher Nguyen
I asked this in /dpt/ but they told me to come here.
So, here it is:
Sup Forums, I'm wondering if you can help me out a sec. This is beyond my level of code as I'm new, but I want to create something (for GreaseMonkey) that will automatically close a certain type of website.
For example, say I'm buying shit on Amazon. I want it to automatically close when it's something like:
What should I be looking at doing, or is there something like this already?
I seem to be spending a lot of time closing tabs for things after they've finished, but I can't just right click and 'close all', because not everything has finished.
Help?
Justin James
Again, I don't work with PHP primarily. I just maintain old shit that's left over from when our old "CTO" was still in charge. There were a few months of hell where I had to replace all of our Pajeet-tier plugins and themes, but since then its been smooth sailing since I'm not a retard and can write shit that doesn't break with every WordPress update
Evan King
Java + Spring and PHP without Laravel about sums it up
Justin Davis
Pajeet tier is just a meme for "poo" tier
anyone can commit a pajeet tier, believe me
Hunter Phillips
QUESTION
How long to learn rails if i know php + frameworks?
Carson Brooks
So instead of a DB you have all your data in a shit ton of files? How's that going to help anyone?
Isaac Torres
is there any prettier way to get a bunch of element references instead of putting them all into variables once? maybe something where I don't have to give everything an id/class?
I want to avoid having to do this every time. const buttonOk = document.getElementById('button-ok'); const buttonCancel = document.getElementById('button-cancel'); const buttonClose = document.getElementById('button-close');
it adds up.
Michael Jones
You don't have to run a database server. I don't see how that isn't an advantage
Dominic Campbell
REEEEEEEEEEEEEEEEEEEEEEEE
Henry Allen
Now if only Laravel wasn't as slow as a snail stapled to a cardboard box, that bleeds network errors under the slightest load.
Julian Cooper
Then just use SQLite or LevelDB.
Evan Cook
If you have a lot of records, running a local db for builds aint bad.
Ideally your builder should know when to regenerate the entire index or not (based on changes)
Nolan Campbell
Write a userscript that runs on all amazon pages and calls window.close(), when need be.
Ethan Reed
And roll my own CMS around it? Use something less popular and likely less supported than Wordpress? No thanks, I'd rather just use a static site generator.
By the way, I'm already using WordPress. Keep track of the convo
Elijah Barnes
Or you could just use another language with another framework. I only claimed Laravel was one of the few ways to write non-Pajeet code in PHP.
Benjamin Rogers
Seems pretty straightforward. What are you having difficulty with?