[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 133 KB, 897x806, matlab.png [View same] [iqdb] [saucenao] [google]
12600754 No.12600754 [Reply] [Original]

>And the award for worst programming syntax goes to...

>> No.12600887

I second this nomination OP

>> No.12600942

it's as easy as >> double(1.0) + int8(2)
3

>> No.12600990

>>12600754
Matlab is fine. Mathematica on the other hand is cancer

>> No.12601021

>>12600990
that's like comparing rotten apples to rotten oranges. it's just a different form of terrible

>> No.12601043

>>12600754
I can't believe some people actually think this craps holds the candle to python or R

>> No.12601060

Python, the shittiest language ever.
Script language that forces intentions. Die pls.

>> No.12601072

>>12600754
I hate MATLAB with most fibers of my being, but it was really good to me for image handling, since I generate and analyze a LOT of image sequences. Python is a little unwieldy with it.
That said, I use R >> Python >>>>>>>>>>>>>> Matlab for anything
>>12601060
>Python, the shittiest language ever.
I used to think this when I didn't actually code, just spent time on beginner coding forums trying to decide for 6 months "which language should I learn" to build my brilliant app idea/indie game "but I'm not unreasonable lol, just a twitter clone or like fortnite clone"

>> No.12601086

>>12601060
>Script language that forces intentions.
If you're a midwit, maybe

>> No.12601089

MATLAB is awesome for scientific computing. Only pajeets disagree.

>> No.12601142
File: 274 KB, 674x662, yes2.png [View same] [iqdb] [saucenao] [google]
12601142

>>12601072
Python is a bastard. It's not suitable for quick scripting, yet it is unsuitable for programs.

I use MATLAB for anything scientific and quick scripting anc C based high end language for everything else. And should I be lazy, I can transform MATLAB code to C code in no time.

>> No.12602183

>>12601060
Why is python is hated this much? i used to think of it as a bad language until i took it as an oop course in uni and it seems fine

>> No.12602193

>>12601060
>Script language that forces intentions
what the hell its even mean?

>> No.12602259

>>12601021
Matlab is fine. You must be trying to code as if it was java.

>>12601043
Python sucks way more than Matlab and isn't meant for numerical computing. You can get away with it, but it's awkward.

>> No.12602269

>>12601086
It means you must count how many times you hit the space bar to write code. And can't intermingle code that used different counts of spaces without manually re-spacing it. And for some crazy reason, nobody seem to know the tab key is a thing.
>but you can use other software to refactor and automate around our shitty design decisions
Or the language could have not been autistically designed.

>>12602183
What shitty university use python as an example oop language?

>> No.12602297

>>12602269
>nobody seem to know the tab key is a thing
in many text editors and IDEs, pressing the tab key inserts around 4 spaces instead of \t

>> No.12602304

>>12602259
i'm an expert at matlab. it's really fucking bad. i used to have a manifesto on it's broken-ass behavior before the drive it was on crashed.

>> No.12602323
File: 47 KB, 1200x1200, 19981927811.jpg [View same] [iqdb] [saucenao] [google]
12602323

>>12602269
>It means you must count how many times you hit the space bar to write code.
>And can't intermingle code that used different counts of spaces without manually re-spacing it
Or how to out yourself as a non programmer.
In the Vim editor, hitting the enter key after writing a line autoindents the next one.
And re-indenting a whole file can be done in a single command.

>> No.12602365

>>12602297
>in many text editors and IDEs, pressing the tab key inserts around 4 spaces instead of \t
Which is stupid.
>>12602304
>i used to have a manifesto
>can't figure out how to shift+i
Sure buddy.
>>12602323
>Vim
>>>/g/ay
>And re-indenting a whole file can be done in a single command.
Or the language could have not been autistically designed.

>> No.12602434

>>12602269
>It means you must count how many times you hit the space bar to write code. And can't intermingle code that used different counts of spaces without manually re-spacing it. And for some crazy reason, nobody seem to know the tab key is a thing.
what kinda filtered normie doesn't program using Whitespace
https://en.wikipedia.org/wiki/Whitespace_(programming_language)

>> No.12602438

>>12602365
Have you considered that maybe you're the one who's autistic? You're sperging out about the trivial inconveniences of Python which can be worked around in several seconds, instead of any of the more consequential drawbacks of the language.

>> No.12602468

>>12602365
Lmao. That's cute anon.
I can't infer more than that because of Poe's law, but yeah. That's cute.

>> No.12602475

>>12602269
>And can't intermingle code that used different counts of spaces without manually re-spacing it.
You're not copying and pasting code, are you anon?

>> No.12602479

>>12602475
you gotta do what you gotta do when you're sub 80 IQ

>> No.12602551
File: 39 KB, 303x566, 1587504074888.jpg [View same] [iqdb] [saucenao] [google]
12602551

>>12600990
Absolutely filtered.

>> No.12602805
File: 94 KB, 1200x1251, 1200px-Mathematica_Logo.svg.png [View same] [iqdb] [saucenao] [google]
12602805

>>12600754
>blocks your path

>> No.12603541

Ocaml

>> No.12603794

>>12601142
haha before I enlarged this image I thought it said "stop burping"

>> No.12603884

>>12600754
It's just fine. Great for quick prototyping and plots (not totally unique in this regard but still), science/engineering oriented things, and for image stuff. I think most people who hate it were forced to learn it.
>>12601142
extremely dangerous levels of based detected

>> No.12604127

>>12600754
Oh I've seen way worse. Matlab still sucks monkey ass though. Especially their business.

>>12601060
>Script language that forces intentions
Your code looks like shit. Also, it forces _consistent_ indentations.

>>12601142
>It's not suitable for quick scripting, yet it is unsuitable for programs.
Completely wrong. Is this a troll thread?
>>12602259
>Python sucks way more than Matlab and isn't meant for numerical computing
See above.

>>12602269
>It means you must count how many times you hit the space bar to write code
Hahahaha, okay, either full of trolls or complete dumblings.

>> No.12604247
File: 73 KB, 1024x1024, 1024px-Gnu-octave-logo.svg.png [View same] [iqdb] [saucenao] [google]
12604247

>>12600754
i beg your pardon

>> No.12604252

stop sucking cock and start programming in Coq

>> No.12604256

>>12600754
APL

>> No.12604353

>>12600754
Matlab is the biggest piece of shit I've ever used.
I needed to plot a constant and could not figure out how even after looking on the internet 2 hours for help.
Apparently you need to convert the constant into some sort of matrix and there's like 40 different ways of doing this, none of which work.
>ERROR, VECTOR MUST BE SAME LENGTH

>> No.12604464

>>12602269
>What shitty university use python as an example oop language?

that still doesn't answer my question. not denying that my university is a shitty one but i still don't see why would that be a bad example. i mean can't you apply an x oop-topic like polymorphism in python to other languages easily after understanding the topic?
if not then recommend me an oop language that i can learn on my own

>> No.12604510

>>12604464

>>12602269 is a retarded poster and has no idea what he's on about. Python will give someone a better understanding of OOP than Java or C++ will if you learn through it.

>if not then recommend me an oop language that i can learn on my own

If you actually want a language that does OOP better than Python than unironically learn Common Lisp.

>> No.12604532

>>12604510
lispfag please go back to your cage and stop spreading misinformation
>>12604464
>i mean can't you apply an x oop-topic like polymorphism in python to other languages
The problem is that Python doesn't have a good type system for OOP and as such is missing some features like interfaces, traits and generics.

>> No.12604550

>>12604532
>interfaces
>generics

If you have ducktyping you aren't 'missing' interfaces, as you can just use the concept implicitly.

>traits
If you mean Smalltalk style traits, than this is a fair point. If not, than could you explain what you mean?

>> No.12604631

>>12604510
Thanks i'll look into common lisp
>>12604532
>interfaces, traits and generics
I'll look into these topics thx

>> No.12604637

>>12600990
mathematica is fine
got free license from my uni

>> No.12604666

>>12604550
>use the concept implicitly
While type systems are not inherently OOP, they are very useful for statically making sure the program even makes sense. It's a system of promises, one part of the program promises X and the other Y, so your code should get less tangled as a result. It's not a silver bullet though and pajeets always find a way to tangle a codebase. And with any functional programming, it gets much more complicated than it needs to be. Just look at Haskell.

>Smalltalk style traits
No clue how they work. I meant like Rust traits or Java interfaces with default implementation. Something like Serializable or PartialEq, which really isn't a type and more of a description of what the type can do. Best to think of it as not a language feature but as a logical concept.

>> No.12604774

>>12604353
>what is hline/vline

>> No.12604801

>>12600754
u r gay and ur mom is gay

>> No.12604812

>>12600754
What's wrong with its syntax?

>> No.12604832

>>12600754
Matlab: all the bad parts of fortran and almost none of the good ones

>> No.12605023

>>12604353
Imagine being filtered by MATLAB of all things...

>> No.12606067

>>12604353
...I think you're just retarded

>> No.12606322

> all this fags shitting on Python
Get filtered.
Numpy all the way.

>> No.12606354

>>12605023
matlab unironically is one of the most difficult languages to program well in because it's so fucking broken and riddled with anti-patterns

>> No.12606358

>>12600754
omfg i hated using matlab.

>> No.12606390

>>12604353
>>constant = 69;
>>plot(1:100, constant*ones(size(1:100)));
replace 1:100 with whatever domain you want

>>fplot(@(x) constant);
>>fplot(@(x) constant,xinterval);

though you're probably too much of a brainlet to understand lambda functions

>> No.12606398

>>12604464
>if not then recommend me an oop language that i can learn on my own
C++20

>> No.12606437

>>12606322
>not having math built in to the language.
shit lang

>> No.12606445

>>12606354
>broken
how?
>riddled with anti-patterns
name some

>> No.12606949

>>12600754
>this filters the brainlets
char(arrayfun(@(x) char(nonzeros([(mod(x,3)&&mod(x,5))*num2str(x) ~mod(x,3)*'Fizz' ~mod(x,5)*'Buzz'])'),1:100,'Un',0))

>> No.12607713

>>12606949
So, anyway...

>> No.12607780

>>12602269
what the hell. it's not even bait. you're just that stupid

>> No.12607867

>>12601142
Agree, Matlab + C is a powerful combination.

>> No.12607929

>>12606445
>broken
one example is the udp library. i worked on a project that almost failed at the last moment because something as braindead basic as a udp library wasn't implemented correctly and was dropping packets like a sieve. matlab support told us udp isn't reliable, but i suspect no one at matworks knew how to fix the issue.

the language itself has several oddities that aren't technically broken, but are extremely questionable design choices. for example the type system is completely fucked, see >>12600942. This can be a headache because basic commands sometimes can't handle different datatypes, inexplicably. Worse, the weak typing can cause silent errors where data changes shape/structure that can be hard to track down.

the need to pre-allocate memory nullifies a major selling point of the language.

>anti-patterns
vectorization (a type of optimization) is critical for performance, and code needs to be structured around vectorizing from the start. premature optimization of programs is a known antipattern.

the script/function distinction has led to over emphasis on scripts, which encourages scripts that become 1000+ lines long (i've seen this from all of my colleagues and then some).

lack of references makes things like linked lists impossible. this makes writing recursive functions extremely difficult, and often odd data structures have to be made to deal with this issue.

etc. etc. these are just ones off the top of my head, not even necessarily the best. i can really tear into matlab's side of i think about all the bullshit i've dealt with over the years.

>> No.12608013

>>12607929
>scripts that become 1000+ lines long
kek, I see this a lot too. I used to be guilty of it myself until I knew better.

>> No.12608183

>>12607929
wtf no linked lists?
I am bashing my head against a horrible scripting language right now because its OOP with only proprietary defined classes from the application. My programs are an iterative evolution based on how i can bend the application to circumvent the way the application thought I would use their classes. dumbest shit in the world, i thought...
and then you said no linked lists.. like you have to implement them yourself or what?

>> No.12608207

>>12600754
Mathmatica has the worst syntax.

>> No.12608250

>>12602475
what is the alternative?

>> No.12608259

>>12600754
R

>> No.12608787

>>12607929
>vectorization (a type of optimization) is critical for performance, and code needs to be structured around vectorizing from the start. premature optimization of programs is a known antipattern.
You are not Donald Knuth, because he would've told you that you are retarded.
That quote is is about spending large amounts of time on making small optimizations of non-critical parts of the code. It doesn't mean that performance should be ignored for as long as possible.
>lack of references makes things like linked lists impossible.
This is just wrong. I don't even use Matlab, but I only needed ten seconds on Google to figure out how to implement a linked list using cell arrays. How efficient that would be depends on Matlab's internals which I don't know, but it's definitely possible.

>> No.12609620
File: 2 KB, 125x119, 1610317726171s.jpg [View same] [iqdb] [saucenao] [google]
12609620

>>12600754
What surprises me with all of these mathematical "graphing" tools is that if you'd spend 12 weeks at an hour a day you could come up with an adequate solution for graphing complex mathematical systems.

>> No.12609726
File: 1.12 MB, 1101x851, 1607119514866.png [View same] [iqdb] [saucenao] [google]
12609726

>>12608787
you clearly don't know matlab, opinion discarded.

the problem with loop structure vs. vectorization is that it's not trivial to identify which loops to vectorize, vectorization places severe limits on program structure, it's impossible to vectorize everything, and in a research environment with constantly moving targets one choice of vectorization might not be good for all applications. read that last point again, it means that either you have multiple versions of the same program vectorized different ways, or you try to shoehorn in your data (constant reshapes and squeezes and permutes) and have a cobbled together mess, or you need to resort to the god awful C interface and compiler nightmare. Either way, unless you have a CS background or prior programming experience, you are going to have a bad time on anything non-trivial. matlab stymies it's own selling points of being easy to use by working against you past adding arrays together.

the reference problem is quite serious, and you don't seem to appreciate the issue if you are googling "soultions". try deleting an element out of the center of that "linked list". What's the time complexity? It's not constant, that's for sure, unless you are marking list elements as dead and wasting memory. try accessing an element at index 1000, what's the time copmlexity? probably constant, which once again is giving strong indications of what you have isn't really a linked list, it just mimics one poorly.

after 10 years of programming this steaming pile, I'm glad I've managed to get some of my lab to see the light and use different tools. fuck matlab

>> No.12609759

>>12609620
>graphing complex mathematical systems.
??
Graphing isn't the issue, it's numerically solving the math efficiently. Lot's of numerical methods are exported to C or FORTRAN for this reason and people still complain.

>> No.12609816

>>12609726
>the problem with loop structure vs. vectorization is that it's not trivial to identify which loops to vectorize, vectorization places severe limits on program structure, it's impossible to vectorize everything, and in a research environment with constantly moving targets one choice of vectorization might not be good for all applications. read that last point again, it means that either you have multiple versions of the same program vectorized different ways, or you try to shoehorn in your data (constant reshapes and squeezes and permutes) and have a cobbled together mess, or you need to resort to the god awful C interface and compiler nightmare.
If that was your problem you should have just said "performance bottlenecks are difficult to identify and forced vectorization leads to convoluted programs". If you know that vectorization is necessary to ensure acceptable performance, then structuring your program in a way that leads to efficient vectorization is the opposite of premature.
>the reference problem is quite serious, and you don't seem to appreciate the issue if you are googling "soultions".
I only needed Google to check whether Matlab supports containers that can hold elements of arbitrary types (which cell arrays apparently can). That's enough to implement the basic list operations of cons, car and cdr.
Again, whether this will be efficient depends on how smart the Matlab interpreter is, but it's pretty much by definition a linked list.

>> No.12609862

>>12607929
>udp library
Just write a mex file dude.
>the need to pre-allocate memory nullifies a major selling point of the language.
Sorry the language can't magically know wtf you're doing before you tell it
>vectorization (a type of optimization) is critical for performance, and code needs to be structured around vectorizing from the start. premature optimization of programs is a known antipattern.
Found the freshman brainlet that doesn't know what "premature optimization" is. Of course the vector language is going to use vectors. Do you get mad at Java for forcing Objectification or lisp/scheme for forcing tail recursion (a type of optimization)?

>> No.12609875

>>12606437
Shit complaint.

>> No.12609892

>>12609726
>>the problem with loop structure vs. vectorization is that it's not trivial to identify which loops to vectorize
Never write loops. Always look for how to vectorize it first. Don't code in a language that you refuse to use its paradigm for.
>linked list
https://www.youtube.com/watch?v=YQs6IC-vgmo

>> No.12609934

>>12609892
>Always look for how to vectorize it first.
always look for preoptimizations. never mind if it makes your code incomprehensible and difficult to modify. gotcha

>> No.12610016

>>12609862
the udp library was an example of brokenness in matlab. what do you think we did?

you can write structured code without vectorization just fine in matlab, but the performance for interesting programs is so poor you quickly run into performance issues. hence you vectorize to reduce the time/space complexity, you know, optimize

>>12609892
linked lists are just one example. the same problem applies to trees (unless you are using something like a priority queue) and many other common data structures you'd find in a basic bitch data structure book

>> No.12610407
File: 19 KB, 660x447, hmmmmmm.jpg [View same] [iqdb] [saucenao] [google]
12610407

>>12609934
>always look for preoptimizations. never mind if it makes your code incomprehensible and difficult to modify. gotcha
I hate matlab but vectorization/applying rather than iterating is babbys first real performance
jesus christ anon way to out yourself as armchair fizzbuzz aficionado

>> No.12610427

>>12610407
vectorized operations are cryptoloops

>> No.12610462

>>12600754
This isn't a picture of VHDL.

>> No.12610467
File: 625 KB, 1096x869, racket.gif [View same] [iqdb] [saucenao] [google]
12610467

I see nobody in this thread had to use racket. this is what my undergrad taught their intro to CS on.
I think this one course broke my parentheses keys

>> No.12610599
File: 19 KB, 192x220, 1490067654204.jpg [View same] [iqdb] [saucenao] [google]
12610599

>>12610467
ABSOLUTELY THIS. Say what you will about matlab, about methematica, about python.... but at least it is humanly possible to read code written in those languages.

>> No.12610651

>>12610016
>you can write structured code without vectorization just fine in matlab

You can write structured code without functional programming in scheme too. You're fucking retarded if you actually do that though.

>> No.12610656

>>12610599
The tab key is your friendo in making racket/scheme readable. ))) )) )))) ) ))

>> No.12611443
File: 186 KB, 1200x899, lossy-page1-1200px-Simulink_model_of_a_wind_turbine.tif.jpg [View same] [iqdb] [saucenao] [google]
12611443

>>12600754
>programming syntax
>programming
Matlab is an engineering Toolbox if you can't understand it, you are a brainlet

>> No.12611609
File: 362 KB, 567x765, 1610502327280.png [View same] [iqdb] [saucenao] [google]
12611609

>>12611443
imagine being so stupid you actually resort to using simulink

>> No.12611712

>>12611609
imagine being so stupid to don't understand what simulink is

>> No.12611836

>>12601072
>>12601086
>>12602183
>>12602193
>>12604127

Perl = Matlab >> ruby >>>>>>>> bash >>>>>>> applescript >>>>>>>>>>>>>>> rust >>>>>>>>>>>>>>>>>>>>> python

>> No.12612086
File: 31 KB, 256x256, 1580187314298.png [View same] [iqdb] [saucenao] [google]
12612086

*blocks your path*

>> No.12613668

>>12604256
>It's all Greek to me!

>> No.12613853

>>12611836
You's trolling.

>>12612086
I allow it.

>> No.12614840

>>12612086
the syntax is probably the least concerning issue

>> No.12614863

>>12604252
please coq is shit, try something worth your time like lean, hol4, metamath

>> No.12614905

>>12600990
Mathematica has its sore points (see Fateman's review of it) but it's also a pretty respectable design really.

>> No.12614959

>>12614905
maybe i'm not good enough at it, but all my code look like i'm trying to fit an entire program on one line