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
Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

python libs are trash and the language is trash and the runtime is trash. don't use p-langs

numpy and scipy means we're stuck with python for the long haul regardless, because it will survive in the darkness of academic labs long after the outside world has abandoned it

look on the bright side: most of the academic types using python are replacing their fortran and ksh

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

xaml is the only legitimately good ui framework on the planet. lol if you didn't understand how to use it

xaml and xslt are both crimes against nature

xml is a document format. don't try to use a document as code. 'nuff said

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr SuperAwesome posted:

people still teach fortran in academia in tyool 13

they're gonna keep teaching it but the kids learning in those classes probably don't write one-off scripts for text processing in f77 anymore

their ugly garbage poo poo they use in their own research will be python

Notorious b.s.d.
Jan 25, 2003

by Reene

coffeetable posted:

bsd you an academic or do you just suffer occupational exposure to academic code

neither one any more thank god

Notorious b.s.d.
Jan 25, 2003

by Reene

Symbolic Butt posted:

don't diss the 'tran


I never seen ksh and I guess I'm glad for this because the bash scripts were already hideous enough

as a language ksh is better than bash. but that's like saying i prefer to have dog poo poo grated over my pasta like reggiano because only a barbarian uses dog poo poo meatballs. friends don't let friends learn shell scripting

where ksh starts to suck is that there are three significantly-incompatible versions in the wild: ksh88, pdksh, and ksh93. any one of them might be labeled /bin/ksh. bash is always bash.

Notorious b.s.d.
Jan 25, 2003

by Reene

Nomnom Cookie posted:

Half the people in this thread probably think it's fine to write production code with snapshot releases of academic languages soooooo

the big problem with scala is the opposite. not enough people keeping on the newest release

scala is totally incompatible forwards/backwards. any code compiled against 2.9 should only be linked against 2.9. when 2.10 comes out, none of your libraries work, so you stay on 2.9. oops

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr SuperAwesome posted:

Dessert Rose posted:

using ButtFart = System.Collections.Generic.List<KeyValuePair<Butt, Fart>>;
im not entirely sure what ur trying to do here but this does not look like good C# code or the correct way of doing a thing

it's a type alias, and if you never use them, you are writing some really ugly C#

Notorious b.s.d.
Jan 25, 2003

by Reene

Posting Principle posted:

what about + for strings in java, shaggar?

it's stupid and bad because it's inconsistent

even the designers of java (hallowed be their names) occasionally gently caress it up

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr SuperAwesome posted:

oh and it's also completely unreadable as opposed to a * (b * c / d)

something i like about scala is that while they allow operator overloading, they don't make any distinction between a method and an operator.

so for instance instead of having an opaque, meaningless overload on "+" i can be explicit and use named methods as operators:

code:
"a" concat "b" concat "c"
unfortunately scala is written for/by spergs and has incredibly complicated operator precedence to make it more fun to write "DSLs" that use "8===D~~~~" as an operator

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

wait so now there is a type ButtFart that's secretly a System.Collections.Generic.List<KeyValuePair<Butt, Fart>>;? goddamn that owns, i am a terrible programmer

yep.

and it does own.

Notorious b.s.d.
Jan 25, 2003

by Reene

Nomnom Cookie posted:

Type erasure

type erasure was an engineering problem not a language design problem. an implementation detail.

but yeah they hosed that one up bigtime

Notorious b.s.d.
Jan 25, 2003

by Reene

Zlodo posted:

I'm sure its a great relief when you get bitten in the rear end by it
"no worry mate just an implementation detail"

Nomnom Cookie posted:

Go back and read the spec on erasure. It might have been motivated by engineering but it's a language (mis) feature.

well the motivation is what matters here

when java was initially designed, they made a ton of good choices in a green grass world, where they got to define everything from scratch

type erasure was a compromise among competing concerns in a world with millions of lines of legacy code. i think they screwed the pooch but i can see why they were tempted by their bad solution

Notorious b.s.d.
Jan 25, 2003

by Reene

Hard NOP Life posted:

I must have read that poo poo like 3 times and I still don't get why it's a big loving deal.

Why couldn't Java just have schism'd into two versions, or even just have included both runtimes, a default one to support old lovely code a new one that supports types? I'm guessing it was just :effort: but it would have been the best way to transition to the newer runtime until all those old jars were recompiled or abandoned for newer things while at the same time still supporting super old poo poo.

.net 2.0 just said "gently caress it" and that seems to have been the right solution. 1.0/1.1 code still ran but it was a pain in the rear end to migrate things, and, well, that seems to have worked out ok.

Notorious b.s.d.
Jan 25, 2003

by Reene

uG posted:

perl5 livin the dream

dude p5 is alive and well

on thursday i'm gonna go see the Moose guy talk about his proposed Moose-like additions to the p5 core, it's gonna rule

Notorious b.s.d.
Jan 25, 2003

by Reene

tbh i don't even like operators that much for numbers.

i would be perfectly happy with a language that had explicit method names even for math

Notorious b.s.d.
Jan 25, 2003

by Reene

Zlodo posted:

theres nothing wrong with having a wide enough definition of "object" that encompasses types
unless your using a j-lang where they insist that every object must be heavy and costly and have no notion of passing things by value

java is mandatory pass-by-value jackass
there is literally no way to pass by reference

Zlodo posted:

sometimes you manipulate mathematical objects other than scalars and theres no reason you should have to use a diff syntax when doing calculations on them

except that programming is not math

using mathematical notation for concrete operations on data types can be unhelpful when the abstractions don't hold

e.g. most things with integers and anything with floating point ever

Notorious b.s.d.
Jan 25, 2003

by Reene

Symbolic Butt posted:

this is an angle where lisp syntax rules imo

lisp syntax unironically owns

Notorious b.s.d.
Jan 25, 2003

by Reene

Zlodo posted:

idc my point is that it is actually always passed by reference from a low level point of view (as opposed as being directly pushed onto the stack or even across multiple registers like when objects are passed by value in c++) which in turns makes every class no matter how small such as a mathematical vector inefficient as hell even though there should be no reason objects cant be lightweight and still have methods or overloaded operators


so it precludes a lot of cool things because theres this language limitation where every object is heavyweight as it has to be allocated on its own on the heap

c# is the only high-level language I can think of that makes stack-allocated objects a choice, and even then they are tightly limited

what did you have in mind where stack allocation is the norm?

edit: there is also c++, but lol c++ as high level. high levels of bullshit.

Notorious b.s.d.
Jan 25, 2003

by Reene

USSMICHELLEBACHMAN posted:

ruby owns and doesn't make you instantiate and object just to used numbers

you could not be more wrong if you tried

Ruby code:
irb(main):001:0> 1.class
=> Fixnum
irb(main):002:0> 1.is_a? Object
=> true

Notorious b.s.d.
Jan 25, 2003

by Reene

Zlodo posted:

vectors, matrices, tuples, smart pointers, option type wrappers, tagged unions... there's lots of useful small things that are nice to be able to be passed around efficiently or embedded into other objects without being separated somewhere in memory for cache and memory allocation efficiency

saying "gee i'd like to have this in cache" is not the same as "gee i'd like to worry about stack allocation details in my high level language"

i don't really worry about any of that stuff on a jvm language. maybe that's why this is the terrible programmer safe zone / hideout

i have about a billion fuckin problems before i worry about whether the object wrappers around my vectors have enough memory locality to make effective use of cache lines

Notorious b.s.d. fucked around with this message at 21:32 on Sep 23, 2013

Notorious b.s.d.
Jan 25, 2003

by Reene

fritz posted:

what language is that i want to avoid it

it's ruby

Notorious b.s.d.
Jan 25, 2003

by Reene

FamDav posted:

You can write a swap for non-primitives in java

EDIT: which jives totes mcgotes with your statement, but still

nope you can't

the references you change will only be your local ones, because java is always pass by value at all times.

c# permits pass by name ("out" parameters), but java does not

Notorious b.s.d.
Jan 25, 2003

by Reene

Jonny 290 posted:

alright srschat

im comin from a 'shadetree learning while writing goofy poo poo' perspective. sell me. how will postgres > mysql in this context

is it because it is better at all levels, or because going any deeper in mysql would give me training in poo poo that doesnt earn a dude money

both

as an intro, the current state of sql is this: there are a bunch of sql servers, they're all blisteringly fast, and it's very possible to port code amongst them if you stick to a common subset of features. the same code will run with virtually no changes on ms sql, postgres, and oracle. (if you pay attention to concurrency it will work on ibm db2 also)




mysql is the odd man out. you can't port to mysql, you can't port from mysql
  1. it supports no features, so that "common subset" from the other servers won't work.

  2. even if you somehow get your code ported, innodb (the storage engine) is insanely slow

  3. other storage engines exist, but they achieve speed by being incompatible in significant ways with innodb (e.g. not supporting transactions)

  4. the frontend/backend split makes it difficult to reason about mysql behavior. the "frontend" handles all sql input, and will accept virtually anything you throw at it. the backend may or may not implement any of the features you asked for with your code

  5. which is why you can't port code from mysql. the SQL triggers, constraints, ordering etc that were silently ignored by mysql will be honored by a real database, and your mysql code will stop working for mysterious reasons

  6. lastly, all the problems with mysql change all the fuckin time. you know a release of mysql is ready for production when the errata pages outnumber the other documentation combined

Notorious b.s.d.
Jan 25, 2003

by Reene
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)

Notorious b.s.d.
Jan 25, 2003

by Reene

USSMICHELLEBACHMAN posted:

Yeah that sounds really different from active record which feels a lot more like a statement mapper. Maybe it can automagically persist objects but i've certainly never used it that way nor have i ever seen that recommended.

i feel like i get to be pretty explicit about database design. To specify a one-to-many or many-to-many relationship i still have to add the necessary foreign keys to their respective tables. it will automatically do the table join after i've specified one to many in the DSL and but it wont work unless the correct keys are in place.

honestly i'm just going to make the switch to raw sql if for no reason other than to know what i'm talking about

activerecord is the prototypical example of an ORM, with proxy objects for everything and almost no control over the generated sql. it is as far from a statement mapper (e.g. mybatis) as you can get

statement mappers just return named (and possibly typed) data from an sql string you had to write yourself, by hand.

Notorious b.s.d.
Jan 25, 2003

by Reene

Posting Principle posted:

postgres can be super complicated but i'm using it as babbys first rdbms and it seems ok. bigger problem for me right now is that my options for using it are "write sql" or "use these 3mbs of jars and 100 lines of xml"

postgresql is the simplest rdbms on the market, which is what drives DBAs crazy. there are relatively few tunables, no query hinting, etc

for using it from java, the easiest way to not-write-sql is to use hibernate criteria + hibernate annotations. unfortunately i don't know of any easy tutorials other than like, buynig a book

or port to scala and use squeryl.

Notorious b.s.d.
Jan 25, 2003

by Reene
also in java always expect to use 3 mb of jars. just get maven set up once, add the dependency, and the 300 mb of jars appears by magic in classpaths and poo poo

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:


and then in spring you turn on spring-mybatis autobinding and it magically creates a proxy of interface BonerMapper named bonerMapper that binds the abstract methods to the queries in BonerMapper.xml of the same name+parameters.

that's pretty cute

Notorious b.s.d.
Jan 25, 2003

by Reene

JewKiller 3000 posted:

a p-lang is a language that pretends to be object-oriented, but has implemented "object" as "mutable hash map of string keys to arbitrary (possibly functional) runtime values, plus a pointer to a parent hash map"

for all the things i hate about perl and ruby this is not a core problem, both have real OO systems available

(php, hosed if i know. i had bigger fish to fry than oo purity)

Notorious b.s.d.
Jan 25, 2003

by Reene
they call me the TeXpert

Notorious b.s.d.
Jan 25, 2003

by Reene

Nomnom Cookie posted:

no it's pronounced tech-purt, not tex-pert. have you even used TeX before? *snorts, pushes glasses up nose*

yes i printed TeXpert on my business card (with the correct super- and sub-scripts of course) specifically to have this conversation as often as possible

Notorious b.s.d.
Jan 25, 2003

by Reene
[quote="Posting Principle" post=""420137856"]
maven owns
java owns
i am become shaggar, destroyer of permgen
[/quote]

Notorious b.s.d.
Jan 25, 2003

by Reene

Nomnom Cookie posted:

springsource sends you a lapel pin if you manage to get 10,000 proxies in one classloader

this scares me
how did you find this out

Notorious b.s.d.
Jan 25, 2003

by Reene
just by the by permgen is going away in java 8

jrockit never had any permgen and that finally got ported to the sun jdk

Notorious b.s.d.
Jan 25, 2003

by Reene

git clone trooper posted:

no but its the ugliest loving syntax

if you have a problem with ugly syntax objC isn't for you

Notorious b.s.d.
Jan 25, 2003

by Reene

JewKiller 3000 posted:

java attempts to follow and encourage object-oriented programming principles

the most fundamental principle of object-oriented programming is dynamic dispatch

but what if i want to dynamically dispatch even the construction of an object? i won't know which class i need until runtime

java constructors don't do that, hence factories

this explanation is both concise and correct

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

what about for real oses

there are a variety of UML designer snap-ins for eclipse. try a few and see which you hate least


as for UML vs pen and paper: there are definitely times i would have liked to have started using an API with a nice UML diagram to explain it. but i don't know whether UML diagrams will help you design the api BEFORE it exists, i have never tried

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

theres no reason to memorize the implementation of common algorithms and data structures and I think if someone asked me in an interview "hey code up a mergesort" i'd probably get up and walk out

people actually do this

Notorious b.s.d.
Jan 25, 2003

by Reene

Dessert Rose posted:

library functions are a rich mine of interview questions specifically because you probably have never written the code that does that before because it's actually in the library

i don't write that code because it is already in the standard library

very little of business application programming involves designing novel algorithms or even implementing old ones

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

Nomnom Cookie posted:

this kind of thinking is how you get poo poo like solr cloud, that stores its "cluster state" in zookeeper and then has an ad hoc, informally-specified, bug-ridden, slow implementation of consensus for the data storage

if you set out to write a business application and you ended up reimplementing the ZAB consistency protocol for your distributed system holy poo poo you hosed up

also this is kind of an unknown unknowns situation. extended familiarity with red/black trees and "500 algorithm questions for java!" textbooks will not arm you with the knowledge you need to identify attempts to violate the CAP theorem or implement paxos.

i know just enough to know i'm dangerous and stay the gently caress away.

Notorious b.s.d. fucked around with this message at 07:31 on Oct 20, 2013

  • Locked thread