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.
 
  • Locked thread
JewKiller 3000
Nov 28, 2006

by Lowtax

Shaggar posted:

tbh I wouldn't call javascript a p-lang unless you're doing something stupid like node.js or super heavy client side stuff. some javascript to validate a form is fine. obviously pre-compiled bytecode from a better language would be optimal, but as long as you aren't trying to write applications in it then whatever.

yeah javascript kinda gets a pass because when you're in the browser you really do need to use it. that need makes its awfulness just barely acceptable

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
its like the rest of html/css/js or smtp. it was barely ok when it was first designed and now theres no hope of fixing it.

Shaggar
Apr 26, 2006
just wait until web "developers" amazingly invent compiling a language to a middle layer bytecode that the browser can run in a vm w/ a jit optimzier along side a separate markup document. then they'll be ecstatic that then can then write a "high speed" compiled javascript interpreter for their favorite new p-lang

double sulk
Jul 2, 2010

i used a js thing today to modify a page to use retina assets if it was possible based on the screen. i didn't really have to think about the code and it just worked really so that's the most useful js thing i've used that wasn't jquery.

it's utter garbage otherwise though

double sulk
Jul 2, 2010

i'm sure it'll break eventually for someone though

JewKiller 3000
Nov 28, 2006

by Lowtax
the only time you can get away with not thinking about the code is when you're doing barely anything besides calling an api function that already implemented all the real work for you. this applies across all languages

double sulk
Jul 2, 2010

yeah i mean i thought about it a lil but it mostly seemed to do what it was supposed to. if it fails there's still a default asset anyway so whatev.

JewKiller 3000
Nov 28, 2006

by Lowtax
i guess i shouldn't be surprised that lovely languages dominate in a world of minimum viable products

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
I would really like ruby with strict types that would be great.

basically give me ruby syntax with memory management and strict types and make it so it can compile to a binary and I'll be in love

JewKiller 3000
Nov 28, 2006

by Lowtax
for some reason i can't resolve cs.umd.edu, something must be down, so i can't link the papers. but once it's up, have a look at the work by jeff foster and his group on type inference for ruby

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

JewKiller 3000 posted:

no it isn't because dynamic languages remove perfectly good type checks for no acceptable reason. i shouldn't have to write those tests (of course i should write tests, just not for things that the compiler can easily check for me, if i would only give up my bad habits of writing in p-langs)

seriously if you're going to write good code, then use a good programming language. there are two reasons to use a bad one: (1) your boss or the technical situation absolutely requires it, or (2) you are a bad programmer and you want a language that will accept your obviously incorrect programs on the condition that you never actually execute the parts that are wrong

god drat jewkiller, are you stealing this poo poo from my non existent blog? you are my kindred spirit.

JewKiller 3000
Nov 28, 2006

by Lowtax
<3 u

double sulk
Jul 2, 2010

USSMICHELLEBACHMAN posted:

I would really like ruby with strict types that would be great.

basically give me ruby syntax with memory management and strict types and make it so it can compile to a binary and I'll be in love

rust, kinda.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

JewKiller 3000 posted:

for some reason i can't resolve cs.umd.edu, something must be down, so i can't link the papers. but once it's up, have a look at the work by jeff foster and his group on type inference for ruby

thanks, i think i found it, reading through it now

http://www.cs.umd.edu/~jfoster/papers/oops13.pdf

JewKiller 3000
Nov 28, 2006

by Lowtax
yeah it's back up now. they have some other papers at http://www.cs.umd.edu/projects/PL/druby/

Miley Virus
Apr 9, 2010

um so i'm currently doing a computer security subject and part of one of my assignments is making a metamorphic c++ program. i'm kinda unsure how to code one, and there's not many examples that i can find cause y'know, viruses.


would i just start with a quine, and then add a bit of like, randomisation to the code written to the new file? there's a long example in c on stackoverflow but that uses opcodes and jesus :stare:

Miley Virus fucked around with this message at 08:15 on Sep 26, 2013

Nomnom Cookie
Aug 30, 2009



Actual metamorphic viruses are working with machine code not source. I have a hard time seeing the connection between self-modifying source and security.

BONGHITZ
Jan 1, 1970

Pollyanna posted:



i don't know why, but i don't like java



shaggar did this to you

Pollyanna
Mar 5, 2005

Milk's on them.


gucci void main posted:

being python-inspired is half the reason golang is unenjoyable to use because python syntax is loving ugly

there are several things i would say about python but ugly is not one of them

now c-style is ugly.

Pollyanna
Mar 5, 2005

Milk's on them.


also doing an objc tut now at least i dont have to download anything else to use it (thanks xcode)

Pollyanna
Mar 5, 2005

Milk's on them.


gucci void main posted:

if you're writing poor dynamic language code, that's on you for either writing poor tests and/or poor implementation outright.

dynamic language yes, that's literally the only type of language i've learned so far

i started with MATLAB.

also in what world is javascript considered better than ruby or python

JewKiller 3000 posted:

if you are actually constrained by a modern type system to the extent that you really cannot write the code you need to write, there will almost certainly be a magic cast you can use for such rare esoteric situations

what you shouldn't do is say "gently caress type systems, i'm coding in python from now on"

im trying to learn at least the basics of several languages since i am still in my ~formative stage~

JewKiller 3000 posted:

the only time you can get away with not thinking about the code is when you're doing barely anything besides calling an api function that already implemented all the real work for you. this applies across all languages

whats wrong with using an api :colbert:

BONGHITZ posted:

shaggar did this to you

java did this to me and shaggar. who's shaggar

Pollyanna fucked around with this message at 11:12 on Sep 26, 2013

Morkai
May 2, 2004

aaag babbys

Notorious b.s.d. posted:

lastly, learning how to tune mysql's wretchedness just means spending more time with people who were too loving stupid to avoid mysql

unless you're gonna be a mysql/postgres or mysql/oracle porting expert ABORT ABORT ABORT





(this is also why i no longer write .NET code. C# is awesome, but writing for .NET puts you in contact with people/organisations so fuckin stupid they bought Windows and SharePoint)

late but I want to chime in that learning entity framework freed me from having to write sql, but only because i already knew sql enough to avoid the traps. repository and unit of work with code first set me free!

weird
Jun 4, 2012

by zen death robot

Pollyanna posted:

also in what world is javascript considered better than ruby or python

i havent used python much and ive never used javascript but i thought python's closures and scoping were broken, and js got them right

quote:

im trying to learn at least the basics of several languages since i am still in my ~formative stage~

learn different paradigms, not necessarily different languages. learning how to do the same thing the same way with different syntax is a waste of time. procedural and oo are everywhere but seek out functional and logic programming too

Johnny Cache Hit
Oct 17, 2011

VanillaKid posted:

seek out functional and logic programming too

please this, once i learned how to apply functional programming concepts my code stopped being this nasty brittle babby code and turned into something that is actually somewhat reliable and something I could easily read and think through which is the most important thing

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

JewKiller 3000 posted:

if you are actually constrained by a modern type system to the extent that you really cannot write the code you need to write, there will almost certainly be a magic cast you can use for such rare esoteric situations

what you shouldn't do is say "gently caress type systems, i'm coding in python from now on"

correct. you should say gently caress type systems, I'm coding in php from now on

types are a fake concept and in 50 years coders will lol at the very idea

gonadic io
Feb 16, 2011

>>=

Pollyanna posted:

who's shaggar

who is anybody really

Pollyanna
Mar 5, 2005

Milk's on them.


VanillaKid posted:

learn different paradigms, not necessarily different languages. learning how to do the same thing the same way with different syntax is a waste of time. procedural and oo are everywhere but seek out functional and logic programming too

Johnny Cache Hit posted:

please this, once i learned how to apply functional programming concepts my code stopped being this nasty brittle babby code and turned into something that is actually somewhat reliable and something I could easily read and think through which is the most important thing

what's the difference between functional programming and whatever you end up doing in python? eg this thing https://github.com/retrocombine/stockta/blob/master/ta.py

i assume MATLAB is functional programming? i.e. mathematical functions and plotting graphs and poo poo

reading up on it, it seems i've mostly been doing functional programming. which makes sense. i haven't done as much oop

quote:

In practice, the difference between a mathematical function and the notion of a "function" used in imperative programming is that imperative functions can have side effects, changing the value of program state. Because of this they lack referential transparency, i.e. the same language expression can result in different values at different times depending on the state of the executing program. Conversely, in functional code, the output value of a function depends only on the arguments that are input to the function, so calling a function f twice with the same value for an argument x will produce the same result f(x) both times.

what

if f(x) is defined as x^2 - x + 1 then no matter what you put in for x you should get the same answer

why the hell would you get a different one???

Pollyanna fucked around with this message at 12:01 on Sep 26, 2013

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
javascript is so quirky (the type system that sometimes makes you get 1 + 1 = 11) and full of straight stupid poo poo (prototype inheritance? not really... we got it wrong but we fixed it in 2011!)

I'm sure there are some really smart programmers using javascript but heck if it's a favorable environment for good code.

also lol at this:

Wikipedia posted:

JavaScript is officially managed by Mozilla Foundation, and new language features are added periodically. However, only some JavaScript engines support these new features:
  • iterator protocol (adopted from Python)
  • shallow generators-coroutines (adopted from Python)
  • array comprehensions and generator expressions (adopted from Python)

at least steal lua co-routines coooome oooon

power botton
Nov 2, 2011

Functional programming means that everything is a function. No dumb gay classes. A program is a series of steps you execute.

It is also why JavaScript is one of the best and most versatile languages out there.

power botton
Nov 2, 2011

JavaScript is an honorary j language with Java and c#. It's like the anti ruby.

Pollyanna
Mar 5, 2005

Milk's on them.


javascript reminds me of being 10 years old

power botton
Nov 2, 2011

JavaScript allows the developer to do anything. Sever side, client side. It's all good. Like lisp and scala it's lack of structure helps weed out bad/inexperienced programmers.

Zlodo
Nov 25, 2006

its u

power botton
Nov 2, 2011

Even if you don't like it either you can make web services, web apps, or you can be pushing terrible enterprise thick clients.

The other option is mobile dev but you can at least use js long enough to ship a v1 there.

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

git clone trooper posted:

JavaScript allows the developer to do anything. Sever side, client side. It's all good. Like lisp and scala it's lack of structure helps weed out bad/inexperienced programmers.

:crossarms:

Pollyanna
Mar 5, 2005

Milk's on them.


welcome to javascript
this is javascript
welcome
this is javascript welcome to javascript
you can do anything with javascript
anything at all
the only limit is yourself
welcome to javascript
welcome to javascript!
this is javascript!
WELCOME TO JAVASCRIPT!!!!!!!!!!!!!!
THIS IS JAVASCRIPT WELCOME!!!!!!!!
yes. this is javascript.

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
pure functional programming is stuff like ml, haskell, erlang, lisp...

it's not just about "using functions", there's a great deal on never mutating objects and recursion... which are 2 things that python is not really made for. the functional programming in python that people talk about is mostly comprehensions and... the general style of structuring data I guess?

this is kind of a bad thing about python, it's a freaky frankenstein of programming paradigms, if you really want to know what those ideas are all about you gotta look outside python to understand.

weird
Jun 4, 2012

by zen death robot
functional programming is about maintaining referential transparency, where if an expression = x then anywhere you see that expression you can replace it with x without changing the meaning of the program (if x = 5, then you can't reassign x to 6 later, and if f(x) = 5, then f(x) always equals 5). you also use functions as first class values, where you can pass them to or return them from functions like any other value. scheme, sml, and haskell are the big functional languages

if you want to be pedantic/antiquated, a procedure is a block of code that does something, and a function is a block of code that returns a value. procedural programming is all about side effects (procedures are not just value goes in, value comes out). fp uses 'function' in the same sense math does

qntm
Jun 17, 2009
javascript yourself and face to bloodshed

Adbot
ADBOT LOVES YOU

Pollyanna
Mar 5, 2005

Milk's on them.


VanillaKid posted:

functional programming is about maintaining referential transparency, where if an expression = x then anywhere you see that expression you can replace it with x without changing the meaning of the program (if x = 5, then you can't reassign x to 6 later, and if f(x) = 5, then f(x) always equals 5). you also use functions as first class values, where you can pass them to or return them from functions like any other value. scheme, sml, and haskell are the big functional languages

if you want to be pedantic/antiquated, a procedure is a block of code that does something, and a function is a block of code that returns a value. procedural programming is all about side effects (procedures are not just value goes in, value comes out). fp uses 'function' in the same sense math does

so it's the difference between

Python code:
x = 2
y = 3
z = x + y
print z
and

code:
def addNumbers(x, y):
   num1 = x
   num2 = y
   z = num1 + num2
   print z

>>> addNumbers(2, 1)
3
?

  • Locked thread