Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
PHP is more related to websites. If you want a nice and easy modern language, go with python. If you want to make websites, go with JavaScript
Ruby is like python but I would learn python first. -
Levy557yYes, I would like to work on websites. But JavaScript ist running on clients. So you could disable it.
I want to rebuild my web-tool (PHP) in another more modern language. So I need a database connection as well ... -
sSam15017yI'd recommend Java myself, but I heard that C# is evolving faster. If you don't know any of these you should probably checkout C# first. You could also use nodeJS it's JavaScript that runs on server side.
-
PHP doesn't feel old. It has lmost every feature that I wanted. I hope they add soon operator overloading.
-
Levy557yOkay, I might be a dumb person but...
C# and Java isn't really made for web development, isn't it? I am looking for an alternative for PHP. Database connection, get data from html-form, cookies and so on... -
mt3o19147y@edwrodrig i guess that won't happen in near future. Last time I checked there was nothing like that planned. Maybe something changed by those 3 years since I checked, but don't think so.
Honestly, I don't see much appliance for operator overloading in php. It would be useful when you deal with math, but there you need more than those few operators that are there. And there are more suitable languages for math than php. -
mt3o19147y@Levy they are general purpose languages with capabilities you never dreamed of. Including web related stuff.
If you want to go with java, look at Spring Boot project.
For c# aim at ASP.MVC
There are others, but those are the most popular.
You see, the point is, you can run almost any language with dotnet/jvm except for java/csharp respectively. Including php or js or python or ruby. It might not be a best idea, but it would work. Well, jvm has js nashorn engine included ;-)
Keep openminded with the technologies you use. Project I'm working on is strictly java, but I have a use case for dynamically loaded scripts, think of js. I have to extract some parts of the algorithm, so that they can be modified at runtime. Without scripting languages this would be impossible. -
@mt3o Operators are useful in many context.
+ - ++ -- are useful in set types.
<< >> are useful in stream context
/ in path context
and so on -
mt3o19147yOk, about / is system dependant. Most often used as a string or dynamic symbol.
You can also multiply, use modulo division, use bitwise operations. Going extreme, override brackets.
Now let's imagine we should implement a dot product operator. What works be your approach? :-D -
mt3o19147y@edwrodrig if you really need that operator overloading, go for languages like haskell or lisp :-P google for them and their usecases.
-
@mt3o Python has operator overloading too. I ask an implementation like the one in C++ that is the best IMO. You can do very useful patterns with it.
-
node.js
Javascript is quietly becoming the language of the future, cross platform and cross everything.
Thanks to Google Chromium opening source project. -
mt3o19147y@edwrodrig
It's not the point of 'what language' but 'why that language'.
It will be hard for me to keep explaining without doing some research, so I'd ask first: have you completed algebra, calculus and discreet mathematics at university level?
If not then: there are situations where operations like addition and multiplication are not (hrmpf, reversible?) a+b!=b+a
In that case sticking to + symbol is wrong. So it is safer to forbid operator overloading at all.
Remember that programming comes from advanced math. For different operations you need different operators. -
@mt3o I don't agree. Symbols are made for men and not men for symbols. Using + in non conmutative context is very acceptable in many situations. For example, for string concatenation (a + b != b + a, but it is ok). Using <<, >> for stream operations is acceptable although they are used in bit shifting at the start.
If the context is well known is better to do list + a + b + c; than list.add(a).add(b).add(c);
PD: I have courses in calculus, algebra and discrete maths at university levem -
mt3o19147yCout << 5<<2
What is what? Where's the stream operator, where's bit shifting? Why?
A*b*c where a is integer, b and c are vectors. Where do we have multiplication? Why not the dot product? What is the order of operations? Which multiplication has higher priority? What has higher priority with overloaded operators + or * ?
This syntax is not clear. So it shouldn't be used. Use fluent syntax instead. Or use different languages than imperative ones.
You have math background, so you know some examples where typical operations perform differently just because the datatype is different.
You agree that when use case is clear, we could use operator overloading, but what will prevent someone from violating this rule? Common sense? C'mon :-D
Imperative languages are not meant to be used that way. -
@mt3o Generally you should have code guidelines with some subsets of the language, indentation rules, file organization and naming conventions. If these rules are reasonable, then using operators as a feature for your code is a good thing. Is true that the case of a chain of operators is not clear because operator precedence, but the solution is simple, use parentesis. I also put parenthesis in math expression to don't get lost.
(!rant)
I need an advise...
I am quite used to work in PHP. But I feel like it's getting older and older. Is there another comparable language? I'm thinking about Ruby or something...
What do you think? Do you have a more modern language in mind? Is it easy to use?
undefined