|
It's one thing to write it because you're trying to win the IOCCC or you're writing a puzzle, but in both cases, you know that you're doing something bizarre. 'Clever' code usually isn't
I'm excited to find a headline that breaks Betteridge's Law.
|
|
|
|
|
Usually with a grimace.
|
|
|
|
|
I currently have to deal with a coworker who does the opposite.
His code is so friggin long and stretched with all kind of useless things (and lots of if-elses) that no one could possibly decipher what that code is doing exactly.
Like creating "helper" classes that create an object and set one property.
From the top of my head.
[ThisIsNecessaryForMef("SOME_CODE", typeof(MyHelper))]
public class MyHelper
{
public IMyObject CreateObject(Input input)
{
IMyObject obj = SomeWeirdMefDiSolution.CreateObject<IMyObject>();
obj.Id = input.Id;
return obj;
}
} I should mention that MEF is NOT a DI container, but that's how we use it.
IMyObject is only used to pass some data, it has only properties and never any functions (and never more than one implementation), so why use DI in the first place?
Wait, I'm forgetting something, IMyObject HAS two functions, Serialize and Deserialize (do you see the problem with deserializing an object using the object before it's deserialized? ).
And why create a complete helper object just to set a single property?
You may be thinking this is handy when the creation logic changes (which it never does), but this is used in just one place only.
To make things worse, even the helper class is instantiated using MEF/DI.
Probably in a function of 1000 lines of code.
Here's the worst part, when you don't do exactly this he labels your code as "quick and dirty".
|
|
|
|
|
Always look at the bright side of ... code:
you won't need an obfuscator to protect it.
|
|
|
|
|
Yeah, but do de-obfuscators exist?
|
|
|
|
|
Enjoyed reading it. I met several guys who believe that the number of lines of code is proportional to execution time, writing single line statements proves smartness of the developer, can't imagine that compiler can optimize (though even the first Fortran compiler developed by Backus 1957 did), he the actual control-flow thru side effects, ...
The most complicated thing in software development is writing easily readable code - but that does not look smart at all.
|
|
|
|
|
It's pretty much known to anyone in the programming world that Java is one of the hardest languages to learn right off the bat; that is if you've never written a line of code in your life. The mad news is that they've switch to JavaScript
Edit: This just in (di-di-dit di-di-dit, etc.)
Apparently, this might not actually be the whole story. It seems they just added an intro course (an experimental alternative) in JavaScript, but did not cancel the Java class.
We now return you to your regular dose of non-news.
modified 21-Jul-17 13:29pm.
|
|
|
|
|
They entire miss the point; an introductory language must also teach computer concepts. I believe procedural C++ is a better approach, though having a class which covers computer concepts well could be sufficient.
(I saw this with my youngest son; his introductory programming course at college used C#, but dove straight in without covering many of the basics. He switched to a different introductory course which spent half the semester just teaching basic concepts, such as memory, bytes, bits and all that stuff and only then started with C#.)
|
|
|
|
|
Can you really say Java is one of the hardest to learn as a beginner when so many others are the same or worse? C/C++ comes to mind. In fact just lump any non-managed language in there. Getting rid of the classic pointer greatly simplifies a language for teaching.
Javascript also has it's own unique quirks that aren't exactly the best thing for beginners such as prototype-based inheritance, function-scoping, duck typing, etc etc. In fact, can you imagine explaining why you need to do the following to a new student? And loops are a basic structure.
for (var i = 0; i < 10; i++)
{
(function (i) {
setTimeout(function () {console.log(i);}, 100 * i);
})(i);
}
I suppose you could gloss over the issue and just say "use let ", but you still need to explain the difference between let and var .
|
|
|
|
|
|
The last I knew, MIT used Python, they even had a free online series of classes on it.
|
|
|
|
|
As a moderately paid software developer, it kind of annoys me that some highly-paid academic types (who have probably never written a single line of code in anger) can be so completely and utterly crap as to think that Javascript is actually a programming language.
This is a gold-plated argument for the value of apprenticeships over college courses.
98.4% of statistics are made up on the spot.
|
|
|
|
|
Of course Javascript is a programming language.
Not a particularly elegant one.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
It's not a programming language, it's a scripting language.
98.4% of statistics are made up on the spot.
|
|
|
|
|
Scripting languages are a subset of programming languages.
It's a language you can use to write programs. Ergo it is a programming language.
It is not a systems programming language, it is not a statically compiled or strongly typed programming language.
But it is definitely a programming language.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Yes, okay, technically a scripting language is a programming language of sorts but it means nothing without the application that it interacts with.
If someone asked me to teach them how to program, I wouldn't be saying "okay, let's start with SQL, you'll learn very little about programming but you'll be able to have a lovely chat with a database." Equally, I'd expect that students on a programming course would want to learn something a bit more universal than how to to talk to a browser.
98.4% of statistics are made up on the spot.
|
|
|
|
|
PeejayAdams wrote: it means nothing without the application that it interacts with.
Meaning it's interpreted rather than compiled?
I am of the opinion that, for the most part, any interpreted language is a scripting language and not a real Programming Language (with capitals).
But bear in mind that some languages may be compiled or intepreted or whatever Java is, depending on the implementation -- BASIC may be compiled on my system, but interpreted on yours.
A better distinction may be "General Purpose Programming Language" versus "Domain-Specific Programming Language".
|
|
|
|
|
Javascript can run outside a browser. Take note of Node.js... for instance.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Won't argue with that. Although it could, of course, be argued that equips developers with the ability to deal with a tonne of bad design decisions in a programming language.
Python would be much better suited to the task, and that's also a scripting language.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Here’s the crucial question: Is Musk right to be worried? Ixnay on the illkay, ontday ivegay emthay ideasway
What is the official rule for words starting with vowels, anyway?
|
|
|
|
|
Normal people to A.I. Scientists: "Stop saying they won't".
|
|
|
|
|
Its so stupid to say that AI will kill us all. So stupid.
They will obviously keep many of us as their servants.
Who else would run their OS updates and write new JavaScript libraries for them?
|
|
|
|
|
I suspect that JS frameworks could be a form of currency in the new paradigm.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
He's off to a cracking start with his self-driving cars.
|
|
|
|
|
I believe the politically correct term is "exterminate"..
Now is it bad enough that you let somebody else kick your butts without you trying to do it to each other? Now if we're all talking about the same man, and I think we are... it appears he's got a rather growing collection of our bikes.
modified 31-Aug-21 21:01pm.
|
|
|
|